From 60bae09dca7c9604ab7694cdd8787c3b94719de4 Mon Sep 17 00:00:00 2001 From: mdickson-adbe <95774602+mdickson-adbe@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:44:44 -0400 Subject: [PATCH] display msg when no deliverables in calendar (#157) --- blocks/gmo-program-details/gmo-program-details.css | 6 ++++++ scripts/program-calendar.js | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/blocks/gmo-program-details/gmo-program-details.css b/blocks/gmo-program-details/gmo-program-details.css index f79a0d4..b877e35 100644 --- a/blocks/gmo-program-details/gmo-program-details.css +++ b/blocks/gmo-program-details/gmo-program-details.css @@ -189,6 +189,12 @@ body { } .tab.calendar { margin-top:10px; + & > .no-data-msg { + height: 100px; + margin-top: 15px; + display: flex; + align-items: center; + } & > .control-wrapper { height: 32px; padding-top: 1px; diff --git a/scripts/program-calendar.js b/scripts/program-calendar.js index 7bb73b1..c61b324 100644 --- a/scripts/program-calendar.js +++ b/scripts/program-calendar.js @@ -28,6 +28,14 @@ export async function buildCalendar(dataObj, block, type, mappingArray, period) const currentDate = new Date(); const currentYear = currentDate.getFullYear(); + // if there are no deliverables, display msg to user and end construction. + if (deliverables.length === 0) { + const calendarTab = document.querySelector('.calendar.tab'); + calendarTab.innerHTML = ` +