Skip to content

Commit

Permalink
merge 72024 in, perform cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickson-adbe committed Aug 1, 2024
1 parent 7b6698e commit 3efaae2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 122 deletions.
7 changes: 1 addition & 6 deletions blocks/gmo-program-details/gmo-program-details.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { decorateIcons, readBlockConfig } from '../../scripts/lib-franklin.js';
import { executeQuery } from '../../scripts/graphql.js';
import { filterArray, getProductMapping, checkBlankString, dateFormat, statusMapping, getMappingArray, testCalendar } from '../../scripts/shared-program.js';
import { filterArray, getProductMapping, checkBlankString, dateFormat, statusMapping, getMappingArray } from '../../scripts/shared-program.js';
import { getBaseConfigPath } from '../../scripts/site-config.js';
import { searchAsset } from '../../scripts/assets.js';
import { buildCalendar } from '../../scripts/program-calendar.js';
Expand Down Expand Up @@ -254,12 +254,7 @@ export default async function decorate(block) {
});

decorateIcons(block);
//const calendarPeriod = { 'year': new Date().getFullYear(), 'quarter': 1 }
//buildCalendar(await deliverables, block, calendarPeriod, "year", await deliverableMappings);
buildCalendar(await deliverables, block, "year", await deliverableMappings);
//newBuildCalendar(testCalendar, block, calendarPeriod, "quarter", await deliverableMappings);
//buildCalendar(await deliverables, block, calendarPeriod, "year", await deliverableMappings);
//buildCalendar(testCalendar, block, calendarPeriod, "year");
}

function enableBackBtn(block, blockConfig) {
Expand Down
8 changes: 0 additions & 8 deletions scripts/program-calendar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { testCalendar } from '../../scripts/shared-program.js';
import { checkBlankString } from './shared-program.js';
import { searchAsset } from '../../scripts/assets.js';

Expand All @@ -7,10 +6,7 @@ let viewStart, viewEnd;
const startDateProp = 'deliverableProjectStartDate';
const endDateProp = 'deliverableProjectEndDate';

// todo: refactor so that the default date is the earliest deliverable start date
//export async function buildCalendar(dataObj, block, period, type, mappingArray) {
export async function buildCalendar(dataObj, block, type, mappingArray, period) {
//if (!deliverables) deliverables = dataObj;
if (!deliverables) deliverables = dataObj.data.deliverableList.items;
if (!deliverableMapping) deliverableMapping = await mappingArray;

Expand Down Expand Up @@ -282,8 +278,6 @@ async function addThumbnailToItem(itemEl, programName, campaignName, deliverable
}
}



function getUniqueItems(items, property) {
return [...new Set(items.flatMap(item => item[property])
.filter(value => value !== null && value !== undefined)
Expand Down Expand Up @@ -428,8 +422,6 @@ function refreshCalendar(period, view) {
block.querySelector('.calendar-wrapper').remove();
block.querySelector('.filter-dropdown-content').remove();

//buildCalendar(deliverables, block, period, view);
//buildCalendar(testCalendar, block, year);
buildCalendar(deliverables, block, view, deliverableMapping, period);
}

Expand Down
109 changes: 1 addition & 108 deletions scripts/shared-program.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,111 +62,4 @@ export async function getMappingArray(type) {
return response.data.jsonByPath.item.json.options;
})
return mappings;
}

export const testCalendar = [
{
'deliverableName': 'Content A',
'taskStatus': 'Complete',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2024-02-01',
'deliverableProjectEndDate': '2024-04-30'
},
{
'deliverableName': 'Content B',
'taskStatus': 'Complete',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2024-02-01',
'deliverableProjectEndDate': '2024-04-30'
},
{
'deliverableName': 'Test End Before Group',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2024-03-05',
'deliverableProjectEndDate': '2024-06-10'
},
{
'deliverableName': 'Bryan',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2024-03-15',
'deliverableProjectEndDate': '2024-06-30'
},
{
'deliverableName': 'Meagan',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2024-03-15',
'deliverableProjectEndDate': '2024-06-30'
},
{
'deliverableName': 'Content C',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Education',
'deliverableProjectStartDate': '2024-03-10',
'deliverableProjectEndDate': '2024-08-10'
},
{
'deliverableName': 'Content D',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Education',
'deliverableProjectStartDate': '2024-03-10',
'deliverableProjectEndDate': '2024-08-10'
},
{
'deliverableName': 'Content E',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Education',
'deliverableProjectStartDate': '2024-03-10',
'deliverableProjectEndDate': '2024-08-10'
},
{
'deliverableName': 'Richard',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Conversion',
'deliverableProjectStartDate': '2024-06-01',
'deliverableProjectEndDate': '2024-10-31'
},
{
'deliverableName': 'Kristine',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Other',
'deliverableProjectStartDate': '2024-08-01',
'deliverableProjectEndDate': '2024-12-31'
},
{
'deliverableName': 'Elwood',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Other',
'deliverableProjectStartDate': '2024-10-01',
'deliverableProjectEndDate': '2024-12-21'
},
{
'deliverableName': '2023 Item',
'taskStatus': 'On Track',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Awareness',
'deliverableProjectStartDate': '2023-04-27',
'deliverableProjectEndDate': '2023-11-11'
},
{
'deliverableName': '2022 Item',
'taskStatus': 'Complete',
'reviewLink': 'https://www.google.com',
'deliverableType': 'Education',
'deliverableProjectStartDate': '2022-05-05',
'deliverableProjectEndDate': '2022-09-02'
}
]
}

0 comments on commit 3efaae2

Please sign in to comment.