Skip to content

Commit

Permalink
display msg when no deliverables in calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickson-adbe committed Aug 14, 2024
1 parent 84bbd45 commit c59c391
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions blocks/gmo-program-details/gmo-program-details.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions scripts/program-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
<div class="no-data-msg">Required Data is Unavailable.</div>
`;
return;
}

// get start of the view
viewStart = getTimeBounds(deliverables, "start", startDateProp);
Expand Down

0 comments on commit c59c391

Please sign in to comment.