Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MH3.FY24.0716 Release #140

Merged
merged 41 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
423a378
Added mapping for uuid (#74)
mathieu-lessard May 3, 2024
f7c918a
Removed Prefix from Displayed UUID Value on Assets (#76)
cheintzman May 8, 2024
61f7611
Modified formatAssetMetadata() to allow custom dc-format Labels (#79)
cheintzman May 9, 2024
777b5cb
Removed "required" and custom values for fields (#86)
mathieu-lessard May 17, 2024
e1748ca
Added getBaseConfigPath to Collections Back Button (#89)
cheintzman May 23, 2024
9c80f01
Releasing HCV Dashboard code (#106)
shiv-gup Jun 3, 2024
112dc3a
ASSETS-88912 : [Issue] Last page number is not matching with total nu…
TyroneAEM Jun 4, 2024
62f579f
Performance refactoring (#107)
mdickson-adbe Jun 4, 2024
4764101
add programID parameter to deliverable query (#109)
mdickson-adbe Jun 5, 2024
fcc7312
Update query names, handle formatting (#110)
mdickson-adbe Jun 5, 2024
9232962
fix typo in graphql query name (#111)
mdickson-adbe Jun 5, 2024
887a1e7
ASSETS-88914 : Fix Pagination Frontend Code (#108)
TyroneAEM Jun 5, 2024
c53f1ca
Merge remote-tracking branch 'origin/main' into rc
Jun 5, 2024
b272d9c
Restored previous logic using cursorArray to manage the calculation o…
TyroneAEM Jun 6, 2024
d129198
Adjust height of deliverables tab on program-details block (#114)
mdickson-adbe Jun 7, 2024
ba077db
DXI-26587- Modify landing page for v3 Hub, so Signin goes to CH/v4 (#…
staware30 Jun 11, 2024
ae27a9c
Replace throwing 404 error when the asset is not found, with asset.sv…
TyroneAEM Jun 11, 2024
525d50a
Make content fragment path for WF mappings configurable (#118)
mdickson-adbe Jun 12, 2024
719a27f
Merge branch 'main' into rc
mdickson-adbe Jun 12, 2024
69d6ec3
Fixed issue where header didn't load if the user didn't have a profil…
mathieu-lessard Jun 12, 2024
1ea6d9b
add checks for null 'review link' and 'final asset' (#122)
mdickson-adbe Jun 12, 2024
6c55177
Refactor header and query variable extraction (#123)
mdickson-adbe Jun 12, 2024
af3e26b
Updated Product List (#117)
mathieu-lessard Jun 12, 2024
780be97
Restored calling the function attatchEventListerners() at the end of …
TyroneAEM Jun 13, 2024
f33f4aa
Fix text wrapping issue in Project Owner column for smaller viewports…
TyroneAEM Jun 14, 2024
61f4dd6
ASSETS-88920 : Cosmetic Updates from MVP Feedback (#126)
TyroneAEM Jun 18, 2024
a818f5b
Merge branch 'main' into rc
mdickson-adbe Jun 20, 2024
0a413be
ASSETS-88921 : Marketing Moments Clickable Title and Underdevelopment…
TyroneAEM Jun 25, 2024
f2806bb
Sorted the options in the dropdown lists alphabetically on the option…
TyroneAEM Jun 28, 2024
5b61d34
ASSETS-88922 : Review the Deliverable page load time (#130)
TyroneAEM Jun 28, 2024
309fbd9
assets.js (#132)
TyroneAEM Jul 8, 2024
f229613
Merge branch 'main' of https://github.com/hlxsites/adobe-gmo into rc
Jul 10, 2024
18ddd12
gmo-program-details.js
TyroneAEM Jul 11, 2024
4f77547
Revert "gmo-program-details.js"
TyroneAEM Jul 11, 2024
ffa3451
gmo-program-details.js
TyroneAEM Jul 11, 2024
e16de1c
Resolved typo in variable programName
TyroneAEM Jul 11, 2024
359a8d8
Merge branch 'main' into rc
TyroneAEM Jul 11, 2024
5151195
feat: Improve page load speed and add lazy loading for images (#134)
TyroneAEM Jul 11, 2024
a40ff9e
ASSETS-88926 : Review and Improve Page Performance of Marketing Momen…
TyroneAEM Jul 12, 2024
bd7b9a9
ASSETS-88927 : Toggle Read More Button (#138)
TyroneAEM Jul 15, 2024
a668e8a
Modified FAQ Nav (#139)
mathieu-lessard Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions blocks/adp-header/adp-header.css
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ header nav .nav-bottom {
width: 100%;
}

header.hide-navigation-tabs nav .nav-bottom {
display: none;
}

header nav {
display: grid;
grid-template-areas:
Expand All @@ -526,6 +530,12 @@ header nav {
box-shadow: 0 0 4px rgba(233 233 233 / 100%);
}

header.hide-navigation-tabs nav {
grid-template-areas:
"nav-top";
grid-template-rows: calc(var(--nav-height) - var(--header-banner-height));
}

.contenthub header nav {
background: var(--contenthub-header-background);
border-bottom: unset;
Expand Down
6 changes: 3 additions & 3 deletions blocks/adp-header/adp-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ function toggleMenu(nav, navSections, forceExpanded = null) {
*/
export default async function decorate(block) {
block.textContent = '';

const logoUrl = document.querySelector('head meta[name="logo-link"]')?.getAttribute('content');
// decorate nav DOM
const nav = document.createElement('nav');
nav.id = 'nav';
nav.innerHTML = `
<div class="nav-top">
<div class="nav-brand">
<a class="adp-logo" href="${getBaseConfigPath()}/"></a>
<a class="adp-logo" href="${logoUrl ?? getBaseConfigPath()}/"></a>
<div></div>
</div>
<div class="nav-sections">
Expand Down Expand Up @@ -224,7 +224,7 @@ export default async function decorate(block) {
}

if (await getUserProfile() !== null) {
document.querySelector('.adp-logo').href = getBaseConfigPath() + '/assets';
document.querySelector('.adp-logo').href = logoUrl ?? (getBaseConfigPath() + '/assets');
loadSearchField(nav);
if (!window.unifiedShellRuntime) {
await createUserInfo(nav);
Expand Down
7 changes: 7 additions & 0 deletions blocks/gmo-program-details/gmo-program-details.css
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,10 @@ body {
}
}

.hide-overflow {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
text-overflow: ellipsis;
}
6 changes: 5 additions & 1 deletion blocks/gmo-program-details/gmo-program-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,17 @@ export default async function decorate(block) {
}, 300));

enableBackBtn(block, blockConfig);

block.querySelectorAll('.read-more').forEach((button) => {
button.addEventListener('click', (event) => {
const readMore = event.target;
const parent = readMore.parentElement;
parent.querySelector('.paragraph').classList.toggle('hide-overflow');
const paragraph = parent.querySelector('.paragraph');
paragraph.classList.toggle('hide-overflow');
readMore.textContent = paragraph.classList.contains('hide-overflow') ? 'Read more' : 'Read less';
});
});

decorateIcons(block);

}
Expand Down
52 changes: 34 additions & 18 deletions blocks/gmo-program-list/gmo-program-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ let totalPages = 0;
let campaignCount = await graphqlCampaignCount();
let blockConfig;

//Custom event gmoCampaignListBlock to allow the gmo-campaign-header to trigger the gmo-program-list to update
document.addEventListener('gmoCampaignListBlock', async function() {
//Build graphq filter that is passed to the graphql persisted queries
const graphQLFilterArray = getFilterValues();
Expand All @@ -64,18 +63,16 @@ document.addEventListener('gmoCampaignListBlock', async function() {
const block = document.querySelector('.gmo-program-list.block');
//Get Campaign Count for pagination
campaignCount = await graphqlCampaignCount(currentGraphqlFilter);
//Trigger loading the gmo-campaign-block

//Reset page variables
currentPageInfo = {};
cursorArray = [];
currentPage = 1;
currentNumberPerPage = DEFAULT_ITEMS_PER_PAGE;

//Trigger loading the gmo-campaign-block
decorate( block, currentNumberPerPage, '', false, false, currentGraphqlFilter);

});


export default async function decorate(block, numPerPage = currentNumberPerPage, cursor = '', previousPage = false, nextPage = false, graphQLFilter = {}) {
if (blockConfig == undefined) blockConfig = readBlockConfig(block);
const campaignPaginatedResponse = await graphqlAllCampaignsFilter(numPerPage, cursor,graphQLFilter);
Expand Down Expand Up @@ -117,8 +114,32 @@ export default async function decorate(block, numPerPage = currentNumberPerPage,
listContainer.appendChild(listItems);
listContainer.appendChild(listFooter);
// Show Hide Previous and Next Page buttons
const footerNext = document.querySelector('.footer-pagination-button.next');
togglePaginationButtons();

decorateIcons(block);

// Lazy loading for images
document.addEventListener('DOMContentLoaded', function() {
if ('IntersectionObserver' in window) {
const lazyImages = document.querySelectorAll('.lazy');
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const img = entry.target;
img.src = img.dataset.src;
img.classList.remove('lazy');
observer.unobserve(img);
}
});
});
lazyImages.forEach(img => observer.observe(img));
}
});
}

function togglePaginationButtons() {
const footerPrev = document.querySelector('.footer-pagination-button.prev');
const footerNext = document.querySelector('.footer-pagination-button.next');
if (currentPage > 1) {
footerPrev.classList.add('active');
} else {
Expand All @@ -130,9 +151,6 @@ export default async function decorate(block, numPerPage = currentNumberPerPage,
} else {
footerNext.classList.remove('active');
}

decorateIcons(block);

}

function getFilterValues(){
Expand Down Expand Up @@ -275,14 +293,13 @@ function buildStatus(statusWrapper, campaign) {
}

async function addThumbnail(parentElement, programName, campaignName) {
searchAsset(programName, campaignName).then((response) => {
if (response && (Object.hasOwn(response, 'imageUrl') && Object.hasOwn(response, 'imageAltText'))) {
const iconImage = document.createElement('img');
iconImage.src = response?.imageUrl;
iconImage.alt = response?.imageAltText;
parentElement.appendChild(iconImage);
}
})
const response = await searchAsset(programName, campaignName);
if (response?.imageUrl && response?.imageAltText) {
const iconImage = document.createElement('img');
iconImage.src = response.imageUrl;
iconImage.alt = response.imageAltText;
parentElement.appendChild(iconImage);
}
}

async function buildProduct(product) {
Expand Down Expand Up @@ -529,4 +546,3 @@ function sortColumn(dir, property) {
container.appendChild(row);
});
}

3 changes: 1 addition & 2 deletions scripts/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export async function searchAsset(programName, campaignName, imageWidth = 80) {

const indexName = await getSearchIndex();


if (!progamName && !campaginName)
if (!programName && !campaignName)
{
// Display Underdevelopment Icon
return await getUnderdevelopmentIcon();
Expand Down
3 changes: 3 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ async function loadLazy(doc) {
}
if (!(document.querySelector('head meta[name="hide-header"]')?.getAttribute('content') === 'true')) {
loadHeader(doc.querySelector('header'), 'adp-header');
if(document.querySelector('head meta[name="hide-navigation-tabs"]')?.getAttribute('content') === 'true'){
doc.querySelector('header').classList.add('hide-navigation-tabs');
}
} else {
document.querySelector('header').classList.add('hidden');
}
Expand Down
4 changes: 4 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ header.hidden {
display: none;
}

header.hide-navigation-tabs{
height: 30px;
}

h1,
h2,
h3,
Expand Down
Loading