From e5038dd31c6b2ffb3e9c508188497964ff536526 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Tue, 19 Nov 2024 20:10:05 -0800 Subject: [PATCH 01/15] Export Asset Button --- .../gmo-program-details.css | 24 ++++++++++- .../gmo-program-details.js | 15 ++++++- icons/download-button.svg | 43 +++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 icons/download-button.svg diff --git a/blocks/gmo-program-details/gmo-program-details.css b/blocks/gmo-program-details/gmo-program-details.css index 2435fb6..a9a3a44 100644 --- a/blocks/gmo-program-details/gmo-program-details.css +++ b/blocks/gmo-program-details/gmo-program-details.css @@ -29,6 +29,27 @@ body { } } +.export-asset-count-button{ + background-color: #FFFFFF; + font: normal normal normal 15px/18px Adobe Clean; + height: 32px; + display: flex; + padding-right: 12px; + align-items: center; + border: 1px solid #D3D3D3; + border-radius: 4px; + cursor: pointer; + &:hover { + background-color: #c5c8c9; + } + & > .icon { + width: 15px; + margin-left: 10px; + margin-right: 10px; + } + +} + .gmo-program-details-wrapper { margin-top: 50px; min-height: 400px; @@ -1072,4 +1093,5 @@ body { color: #0096FF; cursor: pointer; margin-left: 10px; -} \ No newline at end of file +} + diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index c472cfb..07032f1 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -58,6 +58,14 @@ export default async function decorate(block) { ), ); + // export asset count button + const exportAssetCountButton = div( + { class: 'export-asset-count-button'}, + img({ class: 'icon icon-download' , 'data-direction': 'left', src: '/icons/download-button.svg'}), + span({ class: 'button-label'}, 'Export Asset Count'), + ); + + // tab wrapper const tabWrapper = div( { class: 'tab-wrapper'}, @@ -115,6 +123,9 @@ export default async function decorate(block) { div({ class: 'tags-wrapper'}), ), ), + div( + exportAssetCountButton, + ), div( { class: 'infocards-wrapper'}, div( @@ -124,7 +135,7 @@ export default async function decorate(block) { div( { class: 'card audiences'}, div({ class: 'card-heading h3'}, 'Audiences'), - ) + ), ), ); @@ -635,7 +646,7 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { } }); }); - } + } function buildKPIList(program) { let kpiList = document.createElement('ul'); diff --git a/icons/download-button.svg b/icons/download-button.svg new file mode 100644 index 0000000..ddabb18 --- /dev/null +++ b/icons/download-button.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 0cd2c755ff0dd77189d2ee73b5f4b8a74579aea9 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Wed, 20 Nov 2024 14:10:45 -0800 Subject: [PATCH 02/15] created 'Export CSV Button' and fetch data --- .../gmo-program-details.js | 61 ++++++++++++++++--- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 07032f1..09a9f3b 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -64,7 +64,6 @@ export default async function decorate(block) { img({ class: 'icon icon-download' , 'data-direction': 'left', src: '/icons/download-button.svg'}), span({ class: 'button-label'}, 'Export Asset Count'), ); - // tab wrapper const tabWrapper = div( @@ -385,6 +384,60 @@ async function addProgramStats(block) { }); + // Attach event listener to the button + const exportAssetCountButton = document.querySelector('.export-asset-count-button'); + exportAssetCountButton.addEventListener('click', () => { + createCSV(deliverableTypeToPlatformsMap); + }); + + function createCSV(deliverableTypeToPlatformsMap) { + // Define the CSV header + let header = `Program name: ${program.programName}\n\n`; + let csvContent = `data:text/csv;charset=utf-8,${header}Deliverable Type,Platforms (by Deliverable Type),Deliverable Types - Asset Counts,Platform - Asset Counts\n`; + let grandTotalAssetCount = 0; + + // Iterate over the deliverableTypeToPlatformsMap to extract data + deliverableTypeToPlatformsMap.forEach((platformsMap, deliverableType) => { + let totalAssetCount = 0; + + platformsMap.forEach(assetCount => { + totalAssetCount += assetCount; + }); + + // Add the deliverable type row + csvContent += `${deliverableType},All platforms,${totalAssetCount},\n`; + + // Add the platform rows + platformsMap.forEach((assetCount, platform) => { + csvContent += `,${platform},,${assetCount}\n`; + }); + + // Add to grand total + grandTotalAssetCount += totalAssetCount; + }); + + // add a blank row + csvContent += '\n'; + + // Add the grand total asset count row and bold the text + csvContent += `Total Asset Count,,${grandTotalAssetCount},\n`; + + // Encode the CSV content + const encodedUri = encodeURI(csvContent); + + // Create a link element to download the CSV file + const link = document.createElement("a"); + link.setAttribute("href", encodedUri); + link.setAttribute("download", "marketing-dashboard-hcv-count.csv"); + + // Append the link to the document body and trigger the download + document.body.appendChild(link); + link.click(); + + // Remove the link from the document + document.body.removeChild(link); + } + buildProductCard(program); buildFieldScopes('deliverable-type', uniqueDeliverableTypes, block, deliverableTypeToPlatformsMap); buildFieldScopes('platforms', uniquePlatforms, block, platformToDeliverableTypesMap); @@ -553,7 +606,6 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { t.classList.remove('selected'); // Remove the selected class }); const associatedItems = associationMap.get(scope); - console.log('Associated Items:', associatedItems); // Reset the associated buttons if (associatedItems) { @@ -585,17 +637,14 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { } else { // Hide all buttons const allTags = document.querySelectorAll('.scope-tag'); - console.log('All Tags:', allTags); allTags.forEach(t => t.style.display = 'none'); let associatedHeadingDiv = document.getElementById((scopeTypeId === 'deliverable-type') ? 'platforms' : 'deliverable-type'); // Fetch all .scope-tag class from associatedHeadingDiv let alternativeTags = associatedHeadingDiv.querySelectorAll('.scope-tag'); - console.log('All Tags1:', alternativeTags); // Get the associated items const associatedItems = associationMap.get(scope); - console.log('Associated Items:', associatedItems); // Update the clicked button's text content to include the length tag.textContent = `${await lookupType(scope, scopeTypeId)}`; @@ -609,9 +658,7 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { associatedItems.forEach(async (count, key) => { totalAssociatedAssetCount = totalAssociatedAssetCount + count; const associatedTag = Array.from(alternativeTags).find(t => t.id.includes(key)); - console.log('Associated Tag:', associatedTag); let alternateTextContent = await lookupType(associatedTag.id, (scopeTypeId === 'deliverable-type') ? 'platforms' : 'deliverable-type'); - console.log('Alternate Text Content:', alternateTextContent); if (associatedTag) { associatedTag.textContent = `${await lookupType(scope, scopeTypeId)}: ${alternateTextContent} (${count})`; associatedTag.style.display = 'inline-block'; From fa9c7a6ded4ace8a6d91af496dd289a15cab2e01 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 21 Nov 2024 16:09:22 -0800 Subject: [PATCH 03/15] button css changes --- .../gmo-program-details/gmo-program-details.css | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.css b/blocks/gmo-program-details/gmo-program-details.css index a9a3a44..9f6cdfb 100644 --- a/blocks/gmo-program-details/gmo-program-details.css +++ b/blocks/gmo-program-details/gmo-program-details.css @@ -32,9 +32,10 @@ body { .export-asset-count-button{ background-color: #FFFFFF; font: normal normal normal 15px/18px Adobe Clean; - height: 32px; + height: auto; + width: auto; display: flex; - padding-right: 12px; + padding: 5px 10px 5px 10px; align-items: center; border: 1px solid #D3D3D3; border-radius: 4px; @@ -44,8 +45,8 @@ body { } & > .icon { width: 15px; - margin-left: 10px; - margin-right: 10px; + margin-left: 5px; + margin-right: 8px; } } @@ -216,6 +217,11 @@ body { display: flex; flex-direction: row; justify-content: space-between; + position: relative; + & .export-asset-count-button{ + position:absolute; + right: 450px; + } } .tab.calendar { margin-top:10px; @@ -711,6 +717,7 @@ body { margin-bottom: 5px; &:not(:last-child) { margin-right: 5px; + cursor: pointer; } &.selected{ background-color: #0096FF; From 174507ac6646788de79bbccde58113efde99f01d Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Mon, 25 Nov 2024 13:44:58 -0800 Subject: [PATCH 04/15] minor change in csv code Co-Authored-By: TyroneAEM <147942284+TyroneAEM@users.noreply.github.com> Co-Authored-By: Samruddhi <150183547+staware30@users.noreply.github.com> Co-Authored-By: Tyrone Tse Co-Authored-By: Shivani gupta Co-Authored-By: Shivani gupta Co-Authored-By: shivanigupta --- blocks/gmo-program-details/gmo-program-details.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 09a9f3b..9ebe09d 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -420,7 +420,7 @@ async function addProgramStats(block) { csvContent += '\n'; // Add the grand total asset count row and bold the text - csvContent += `Total Asset Count,,${grandTotalAssetCount},\n`; + csvContent += `Total Unique Asset Count,,${grandTotalAssetCount},\n`; // Encode the CSV content const encodedUri = encodeURI(csvContent); From ab2f74c0c10a48aaa211c1cf81901fa5489915d8 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Mon, 25 Nov 2024 16:03:04 -0800 Subject: [PATCH 05/15] duplicates Co-Authored-By: TyroneAEM <147942284+TyroneAEM@users.noreply.github.com> Co-Authored-By: Samruddhi <150183547+staware30@users.noreply.github.com> Co-Authored-By: Tyrone Tse Co-Authored-By: Shivani gupta Co-Authored-By: Shivani gupta Co-Authored-By: shivanigupta --- blocks/gmo-program-details/gmo-program-details.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 4c6164c..51f070c 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -65,13 +65,6 @@ export default async function decorate(block) { span({ class: 'button-label'}, 'Export Asset Count'), ); - // export asset count button - const exportAssetCountButton = div( - { class: 'export-asset-count-button'}, - img({ class: 'icon icon-download' , 'data-direction': 'left', src: '/icons/download-button.svg'}), - span({ class: 'button-label'}, 'Export Asset Count'), - ); - // tab wrapper const tabWrapper = div( { class: 'tab-wrapper'}, @@ -132,9 +125,6 @@ export default async function decorate(block) { div( exportAssetCountButton, ), - div( - exportAssetCountButton, - ), div( { class: 'infocards-wrapper'}, div( From 1f4549321b3a2a25308547ff3c2d8b37880b3c12 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Mon, 25 Nov 2024 16:09:23 -0800 Subject: [PATCH 06/15] deleting extra brackets Co-Authored-By: TyroneAEM <147942284+TyroneAEM@users.noreply.github.com> Co-Authored-By: Samruddhi <150183547+staware30@users.noreply.github.com> Co-Authored-By: Tyrone Tse Co-Authored-By: Shivani gupta Co-Authored-By: Shivani gupta Co-Authored-By: shivanigupta --- blocks/gmo-program-details/gmo-program-details.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 51f070c..c68b1a1 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -731,8 +731,7 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { } }); }); - } - } + } function buildKPIList(program) { let kpiList = document.createElement('ul'); From 5272fe2fdc7ef915acddb5b7a9409d1611495a30 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:04:49 -0800 Subject: [PATCH 07/15] Update in asset count label --- blocks/gmo-program-details/gmo-program-details.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index c68b1a1..9699d9d 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -424,7 +424,7 @@ async function addProgramStats(block) { csvContent += '\n'; // Add the grand total asset count row and bold the text - csvContent += `Total Unique Asset Count,,${grandTotalAssetCount},\n`; + csvContent += `Instances of assets deployed,,${grandTotalAssetCount},\n`; // Encode the CSV content const encodedUri = encodeURI(csvContent); From c68a35f70705386b41025e1ebcc791358ecc0ad1 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:19:13 -0800 Subject: [PATCH 08/15] Merge branch 'rc' of https://github.com/hlxsites/adobe-gmo into DXI-30009 --- .../gmo-program-details.css | 7 ++++ .../gmo-program-details.js | 42 +++++++++++++------ .../gmo-program-header/gmo-program-header.js | 9 ++-- blocks/gmo-program-list/gmo-program-list.js | 2 +- icons/AddCircle_18_N.svg | 11 +++++ icons/RemoveCircle_18_N.svg | 11 +++++ scripts/graphql.js | 8 ++-- scripts/shared-program.js | 2 +- 8 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 icons/AddCircle_18_N.svg create mode 100644 icons/RemoveCircle_18_N.svg diff --git a/blocks/gmo-program-details/gmo-program-details.css b/blocks/gmo-program-details/gmo-program-details.css index a10283e..9e6737d 100644 --- a/blocks/gmo-program-details/gmo-program-details.css +++ b/blocks/gmo-program-details/gmo-program-details.css @@ -897,6 +897,9 @@ body { position: sticky; position: -webkit-sticky; top: 0; + & > .showhide-deliverables { + margin-left: 10px; + } } } @@ -1053,6 +1056,10 @@ body { width: 200px; } +.header.column1 { + margin-left: 16px; +} + .column3 { width: 140px; } diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 9699d9d..38a95a6 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -140,6 +140,7 @@ export default async function decorate(block) { // deliverables tab + const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; const deliverablesTab = div( { id: 'tab2', class: 'deliverables tab inactive'}, div( @@ -158,6 +159,8 @@ export default async function decorate(block) { { class: 'table-wrapper'}, div( { class: 'table-header' }, + img({ class: 'expand-deliverables showhide-deliverables', src: "/icons/AddCircle_18_N.svg", title: expandCollapseTooltip }), + img({ class: 'collapse-deliverables showhide-deliverables inactive', src: "/icons/RemoveCircle_18_N.svg", title: expandCollapseTooltip }), div({ class: 'header table-column column1' }, 'Deliverable Task Name'), div({ class: 'header table-column column2' }, 'Deliverable Type'), div({ class: 'header table-column column3' }, 'Platforms'), @@ -263,7 +266,6 @@ async function addProgramStats(block) { // build header let header = block.querySelector('.details-header-wrapper'); - // build header if (!(program === undefined)) { const programHeader = buildHeader(program, queryVars).outerHTML; // Update the header with the actual data @@ -458,10 +460,6 @@ async function addProgramStats(block) { // calendar tab buildCalendar(await deliverables, block, "year", await deliverableMappings); - // enable 'read more' buttons - // calendar tab - buildCalendar(await deliverables, block, "year", await deliverableMappings); - // enable 'read more' buttons block.querySelectorAll('.read-more').forEach((button) => { button.addEventListener('click', (event) => { @@ -478,22 +476,40 @@ async function addProgramStats(block) { switchTab(event.target); }); - // decorate any new icons - // enable tab switching - block.querySelector('.tab-wrapper').addEventListener('click', (event) => { - switchTab(event.target); - }); + // enable expand/collapse all deliverables + block.querySelectorAll('.expand-deliverables, .collapse-deliverables').forEach((button) => { + button.addEventListener('click', (event) => { + const clickedBtn = event.currentTarget; + document.querySelector('.showhide-deliverables.inactive').classList.toggle('inactive'); + clickedBtn.classList.toggle('inactive'); + + const expand = clickedBtn.classList.contains('expand-deliverables'); + document.querySelectorAll('.row.collapsible').forEach((group) => toggleGroup(group, expand)); + }); + }) // decorate any new icons decorateIcons(block); // remove loading spinner hideLoadingOverlay(bodyWrapper); - - // remove loading spinner - hideLoadingOverlay(bodyWrapper); } +function toggleGroup(group, expand) { + if (expand) { + group.querySelector('.icon-next').classList.add('inactive'); + group.querySelector('.icon-collapse').classList.remove('inactive'); + } else { + group.querySelector('.icon-next').classList.remove('inactive'); + group.querySelector('.icon-collapse').classList.add('inactive'); + } + Array.from(group.children).forEach((child) => { + if (child.classList.contains('row')) { + child.classList.toggle('inactive', !expand); + } + }); +}; + function enableBackBtn(block, blockConfig) { block.querySelector('.back-button').addEventListener('click', () => { const host = location.origin + getBaseConfigPath(); diff --git a/blocks/gmo-program-header/gmo-program-header.js b/blocks/gmo-program-header/gmo-program-header.js index 00f8cc6..e1edebf 100644 --- a/blocks/gmo-program-header/gmo-program-header.js +++ b/blocks/gmo-program-header/gmo-program-header.js @@ -1,5 +1,6 @@ import { decorateIcons } from '../../scripts/lib-franklin.js'; -import { graphqlCampaignByName } from '../../scripts/graphql.js'; +//import { graphqlCampaignByName } from '../../scripts/graphql.js'; +import { graphqlProgramByName } from '../../scripts/graphql.js'; import { statusMapping, productList, getMappingArray } from '../../scripts/shared-program.js'; export default async function decorate(block) { @@ -7,7 +8,7 @@ export default async function decorate(block) {
- +
@@ -80,9 +81,9 @@ export default async function decorate(block) { const value = this.value; if (value) { - const graphqlData = await graphqlCampaignByName(value); + const graphqlData = await graphqlProgramByName(value); //Get unique values - const searchItems = Array.from(new Set(graphqlData.data.programList.items.map(item => item.campaignName))); + const searchItems = Array.from(new Set(graphqlData.data.programList.items.map(item => item.programName))); autocomplete(value, searchItems); } else diff --git a/blocks/gmo-program-list/gmo-program-list.js b/blocks/gmo-program-list/gmo-program-list.js index 163910c..6a902fb 100644 --- a/blocks/gmo-program-list/gmo-program-list.js +++ b/blocks/gmo-program-list/gmo-program-list.js @@ -57,7 +57,7 @@ document.addEventListener('gmoCampaignListBlock', async function() { const searchInputValue = document.getElementById('campaign-search').value; if (searchInputValue!=='') { - graphQLFilterArray.push({type:'campaignName', value:searchInputValue, operator:'='}) + graphQLFilterArray.push({type:'programName', value:searchInputValue, operator:'='}) } currentGraphqlFilter= generateFilterJSON(graphQLFilterArray); diff --git a/icons/AddCircle_18_N.svg b/icons/AddCircle_18_N.svg new file mode 100644 index 0000000..c292803 --- /dev/null +++ b/icons/AddCircle_18_N.svg @@ -0,0 +1,11 @@ + + + + + S AddCircle 18 N + + \ No newline at end of file diff --git a/icons/RemoveCircle_18_N.svg b/icons/RemoveCircle_18_N.svg new file mode 100644 index 0000000..75f7810 --- /dev/null +++ b/icons/RemoveCircle_18_N.svg @@ -0,0 +1,11 @@ + + + + + S RemoveCircle 18 N + + \ No newline at end of file diff --git a/scripts/graphql.js b/scripts/graphql.js index 106d531..37993c1 100644 --- a/scripts/graphql.js +++ b/scripts/graphql.js @@ -83,12 +83,12 @@ export async function graphqlAllCampaignsFilter(first,cursor,filter) { } -export async function graphqlCampaignByName(campaignName) { - const queryName = 'getCampaignNameFilter'; - const encodedCampaignName = encodeURIComponent(campaignName); +export async function graphqlProgramByName(programName) { + const queryName = 'getProgramNameFilter'; + const encodedProgramName = encodeURIComponent(programName); const encodedSemiColon = encodeURIComponent(';'); //persisted query URLs have to be encoded together with the first semicolon - const graphqlEndpoint = `${baseApiUrl}/${projectId}/${queryName}${encodedSemiColon}campaignName=${encodedCampaignName}`; + const graphqlEndpoint = `${baseApiUrl}/${projectId}/${queryName}${encodedSemiColon}programName=${encodedProgramName}`; const jwtToken = await getBearerToken(); // Return the fetch promise chain so that it can be awaited outside diff --git a/scripts/shared-program.js b/scripts/shared-program.js index 7c0d2df..bf13f61 100644 --- a/scripts/shared-program.js +++ b/scripts/shared-program.js @@ -157,4 +157,4 @@ export function domEl(tag, ...items) { export function div(...items) { return domEl('div', ...items); } export function span(...items) { return domEl('span', ...items); } export function img(...items) { return domEl('img', ...items); } -export function a(...items) { return domEl('a', ...items); } \ No newline at end of file +export function a(...items) { return domEl('a', ...items); } From ee8365b5662aed985c1322a5a35c9ae649b9987a Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:23:32 -0800 Subject: [PATCH 09/15] conflict resolved --- blocks/gmo-program-details/gmo-program-details.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 38a95a6..3c10bd9 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -141,6 +141,7 @@ export default async function decorate(block) { // deliverables tab const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; + const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; const deliverablesTab = div( { id: 'tab2', class: 'deliverables tab inactive'}, div( @@ -161,6 +162,8 @@ export default async function decorate(block) { { class: 'table-header' }, img({ class: 'expand-deliverables showhide-deliverables', src: "/icons/AddCircle_18_N.svg", title: expandCollapseTooltip }), img({ class: 'collapse-deliverables showhide-deliverables inactive', src: "/icons/RemoveCircle_18_N.svg", title: expandCollapseTooltip }), + img({ class: 'expand-deliverables showhide-deliverables', src: "/icons/AddCircle_18_N.svg", title: expandCollapseTooltip }), + img({ class: 'collapse-deliverables showhide-deliverables inactive', src: "/icons/RemoveCircle_18_N.svg", title: expandCollapseTooltip }), div({ class: 'header table-column column1' }, 'Deliverable Task Name'), div({ class: 'header table-column column2' }, 'Deliverable Type'), div({ class: 'header table-column column3' }, 'Platforms'), From 9154d90e3c8fc73b6d9a8e7111c770901e7ec40f Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:29:30 -0800 Subject: [PATCH 10/15] conflict resolved-1 --- .../gmo-program-details/gmo-program-details.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 3c10bd9..1e08648 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -141,7 +141,6 @@ export default async function decorate(block) { // deliverables tab const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; - const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; const deliverablesTab = div( { id: 'tab2', class: 'deliverables tab inactive'}, div( @@ -498,6 +497,22 @@ async function addProgramStats(block) { hideLoadingOverlay(bodyWrapper); } +function toggleGroup(group, expand) { + if (expand) { + group.querySelector('.icon-next').classList.add('inactive'); + group.querySelector('.icon-collapse').classList.remove('inactive'); + } else { + group.querySelector('.icon-next').classList.remove('inactive'); + group.querySelector('.icon-collapse').classList.add('inactive'); + } + Array.from(group.children).forEach((child) => { + if (child.classList.contains('row')) { + child.classList.toggle('inactive', !expand); + } + }); +}; +} + function toggleGroup(group, expand) { if (expand) { group.querySelector('.icon-next').classList.add('inactive'); @@ -751,6 +766,7 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { }); }); } + } function buildKPIList(program) { let kpiList = document.createElement('ul'); From a4e303c94e003e801bd1a7f2ca50290644fc22fe Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:53:45 -0800 Subject: [PATCH 11/15] removed duplicates --- blocks/gmo-program-details/gmo-program-details.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 5bbd7c0..f18580f 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -141,7 +141,6 @@ export default async function decorate(block) { // deliverables tab const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; - const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; const deliverablesTab = div( { id: 'tab2', class: 'deliverables tab inactive'}, div( From b973cf70cb524e93158a00cf9e24a36532f5d7e5 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 11:56:44 -0800 Subject: [PATCH 12/15] removed extra bracket --- blocks/gmo-program-details/gmo-program-details.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index f18580f..8aa1355 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -511,7 +511,6 @@ function toggleGroup(group, expand) { } }); }; -} function toggleGroup(group, expand) { if (expand) { From c09cf3a209d3b3864462fa3723926ffed5a4ba6f Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 12:09:59 -0800 Subject: [PATCH 13/15] fixed conflict(declared twice) --- blocks/gmo-program-details/gmo-program-details.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 8aa1355..3c37751 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -512,21 +512,6 @@ function toggleGroup(group, expand) { }); }; -function toggleGroup(group, expand) { - if (expand) { - group.querySelector('.icon-next').classList.add('inactive'); - group.querySelector('.icon-collapse').classList.remove('inactive'); - } else { - group.querySelector('.icon-next').classList.remove('inactive'); - group.querySelector('.icon-collapse').classList.add('inactive'); - } - Array.from(group.children).forEach((child) => { - if (child.classList.contains('row')) { - child.classList.toggle('inactive', !expand); - } - }); -}; - function enableBackBtn(block, blockConfig) { block.querySelector('.back-button').addEventListener('click', () => { const host = location.origin + getBaseConfigPath(); From 26ea3280c2ab337279a48d9ff4a7cb7bc6c142e7 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 12:19:45 -0800 Subject: [PATCH 14/15] removed duplicate --- blocks/gmo-program-details/gmo-program-details.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 3c37751..38a95a6 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -161,8 +161,6 @@ export default async function decorate(block) { { class: 'table-header' }, img({ class: 'expand-deliverables showhide-deliverables', src: "/icons/AddCircle_18_N.svg", title: expandCollapseTooltip }), img({ class: 'collapse-deliverables showhide-deliverables inactive', src: "/icons/RemoveCircle_18_N.svg", title: expandCollapseTooltip }), - img({ class: 'expand-deliverables showhide-deliverables', src: "/icons/AddCircle_18_N.svg", title: expandCollapseTooltip }), - img({ class: 'collapse-deliverables showhide-deliverables inactive', src: "/icons/RemoveCircle_18_N.svg", title: expandCollapseTooltip }), div({ class: 'header table-column column1' }, 'Deliverable Task Name'), div({ class: 'header table-column column2' }, 'Deliverable Type'), div({ class: 'header table-column column3' }, 'Platforms'), From 2349feae3b9408dba44e8e08b98947e708ea1822 Mon Sep 17 00:00:00 2001 From: Samruddhi Date: Thu, 5 Dec 2024 12:31:45 -0800 Subject: [PATCH 15/15] removing duplicate for product card --- blocks/gmo-program-details/gmo-program-details.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 38a95a6..d729311 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -330,7 +330,7 @@ async function addProgramStats(block) { document.querySelector('.product-value-wrapper > .paragraph').textContent = productValue; // additional dom updates - buildProductCard(program); + //buildProductCard(program); // deliverables tab const deliverables = executeQuery(deliverableQueryString);