From 9ee90d266beffe5d0fd21de2ce4e39d4fca7d87c Mon Sep 17 00:00:00 2001
From: cheintzman <147882114+cheintzman@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:30:43 -0500
Subject: [PATCH 01/11] Assets 32349 (#24)
* Changed decorate(block) to use getBaseConfigPath() to create adp-logo href
* Cleaned up new code in adp-header decorate(block)
* Changed quickLinks selection resolving missing selection bug in QA
---
blocks/adp-header/adp-header.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/blocks/adp-header/adp-header.js b/blocks/adp-header/adp-header.js
index b9864550..68444981 100644
--- a/blocks/adp-header/adp-header.js
+++ b/blocks/adp-header/adp-header.js
@@ -105,13 +105,22 @@ function toggleMenu(nav, navSections, forceExpanded = null) {
*/
export default async function decorate(block) {
block.textContent = '';
+
+ // change adp-logo href depending on whether user is logged in
+ let logoHome = null;
+ if (await window.adobeIMS?.getProfile() != null) {
+ logoHome = `${getBaseConfigPath()}/` + 'assets';
+ } else {
+ logoHome = `${getBaseConfigPath()}/`;
+ }
+
// decorate nav DOM
const nav = document.createElement('nav');
nav.id = 'nav';
nav.innerHTML = `
-
+
@@ -338,7 +347,7 @@ function initQuickLinks() {
// set aria-selected on quick links
quickLinks.querySelectorAll('.item').forEach((item) => {
- if (item.querySelector('a')?.dataset.page === window.location.pathname) {
+ if (item.querySelector('a')?.getAttribute('href') === window.location.pathname) {
item.setAttribute('aria-selected', 'true');
}
});
From a70185d646d7b2c42294f004d78d415a3ba17ed3 Mon Sep 17 00:00:00 2001
From: Nithin Asokan <2903839+nithinasokan@users.noreply.github.com>
Date: Tue, 23 Jan 2024 11:17:46 -0800
Subject: [PATCH 02/11] Use full indexname (#27)
---
blocks/adp-search-field/adp-search-field.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blocks/adp-search-field/adp-search-field.js b/blocks/adp-search-field/adp-search-field.js
index 074653b1..3c31cdc1 100644
--- a/blocks/adp-search-field/adp-search-field.js
+++ b/blocks/adp-search-field/adp-search-field.js
@@ -85,7 +85,7 @@ function createSuggestionsPlugin(recentSearchesPlugin) {
if (enableSearchSuggestions) {
querySuggestionsPlugin = createQuerySuggestionsPlugin({
searchClient: getSearchClient(),
- indexName: 'query_suggestions',
+ indexName: INSTANT_SEARCH_INDEX_NAME + '_query_suggestions',
getSearchParams({ state }) {
// This creates a shared `hitsPerPage` value once the duplicates
// between recent searches and Query Suggestions are removed.
From b4d8028e5b708a5c87f0a6bc2b879d791da895bb Mon Sep 17 00:00:00 2001
From: cheintzman <147882114+cheintzman@users.noreply.github.com>
Date: Tue, 23 Jan 2024 15:06:38 -0500
Subject: [PATCH 03/11] Assets 33680 (#26)
* Changes link colors for landing page teasers
* Created Functions to Detect Background Color
Created getVideoColor() and waitForVideoLoad() in order to track the color of the background video and changed the CSS styling of Landing page links under a
element
* Code cleanup
Cleaned up some unused code and added a transition for the color change on landing page links
* More code clean up
---
blocks/gmo-landing-page/gmo-landing-page.css | 15 ++++++
blocks/gmo-landing-page/gmo-landing-page.js | 49 ++++++++++++++++++--
blocks/gmo-teaser/gmo-teaser.css | 12 +++++
3 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/blocks/gmo-landing-page/gmo-landing-page.css b/blocks/gmo-landing-page/gmo-landing-page.css
index aeb78abf..27374f22 100644
--- a/blocks/gmo-landing-page/gmo-landing-page.css
+++ b/blocks/gmo-landing-page/gmo-landing-page.css
@@ -8,12 +8,27 @@
color: #505050;
}
+.gmo-landing-page p a:any-link {
+ color: #035fe6;
+ transition:
+ color 0.2s;
+}
+
+.gmo-landing-page p a:hover {
+ color: #136ff6;
+}
+
+.gmo-landing-page p a:active {
+ color: #035fe6;
+}
+
.gmo-landing-page .video-background {
position: relative;
width: 100%;
display: flex;
justify-content: center;
}
+
.gmo-landing-page .video-background video {
position: relative;
top: 0;
diff --git a/blocks/gmo-landing-page/gmo-landing-page.js b/blocks/gmo-landing-page/gmo-landing-page.js
index af6187fd..1ec10c6d 100644
--- a/blocks/gmo-landing-page/gmo-landing-page.js
+++ b/blocks/gmo-landing-page/gmo-landing-page.js
@@ -1,5 +1,45 @@
import { readBlockConfig } from '../../scripts/lib-franklin.js';
+async function waitForVideoLoad() {
+ const video = document.querySelector('.desktop');
+ return new Promise((resolve) => {
+ video.oncanplaythrough = () => {
+ resolve();
+ };
+ });
+}
+
+async function getVideoColor(){
+ const video = document.querySelector('.desktop');
+ const canvas = document.createElement('canvas');
+ const context = canvas.getContext('2d', { willReadFrequently: true });
+ await waitForVideoLoad();
+
+ canvas.width = video.videoWidth;
+ canvas.height = video.videoHeight;
+
+ let hexColorOld = null;
+
+ // Capture the video frame and extract the color information at the specified interval
+ setInterval(() => {
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
+ const pixelData = context.getImageData(10, 10, canvas.width, canvas.height).data;
+ const red = pixelData[0];
+ const green = pixelData[1];
+ const blue = pixelData[2];
+ const hexColor = '#' + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1);
+
+ if (hexColorOld !== hexColor) {
+ hexColorOld = hexColor;
+ let linkActive = document.querySelector('.gmo-landing-page p a');
+ if (hexColor == '#000000') {
+ return linkActive.style.color = '#AEDBFE';
+ }
+ linkActive.style.color = '#035FE6';
+ }
+ }, 500);
+}
+
export default async function decorate(block) {
const host = location.origin;
const signInMsg = getSignInMsg(block);
@@ -8,10 +48,11 @@ export default async function decorate(block) {
block.innerHTML=`
-
@@ -32,6 +73,7 @@ export default async function decorate(block) {
`
const msgParent = block.querySelector(".signin-notif");
msgParent.append(signInMsg);
+ getVideoColor();
}
function getSignInMsg(block) {
@@ -42,4 +84,5 @@ function getSignInMsg(block) {
}
});
return msgDiv;
-}
\ No newline at end of file
+}
+
diff --git a/blocks/gmo-teaser/gmo-teaser.css b/blocks/gmo-teaser/gmo-teaser.css
index 8fed5986..6f7639d9 100644
--- a/blocks/gmo-teaser/gmo-teaser.css
+++ b/blocks/gmo-teaser/gmo-teaser.css
@@ -9,6 +9,18 @@
text-transform: none;
}
+.gmo-teaser a:any-link {
+ color: #72B7F9;
+}
+
+.gmo-teaser a:hover {
+ color: #8FCAFC;
+}
+
+.gmo-teaser a:active {
+ color: #AEDBFE;
+}
+
.gmo-teaser .teaser {
background-color: #292929;
color: #efefef;
From f3da5c53356b1da0c551ca9f17e87483db74c7b3 Mon Sep 17 00:00:00 2001
From: mdickson-adbe <95774602+mdickson-adbe@users.noreply.github.com>
Date: Tue, 23 Jan 2024 15:07:49 -0500
Subject: [PATCH 04/11] Assets 32164 (#25)
* refactor notification code
- new branch
- small change to immutable(?) head.html
* remove log statement
* update legal toast
- remove default msg and add logic: no longer display toast unless
configured
---
scripts/custom-scripts.js | 13 +++++++------
styles/gmo-styles.css | 3 +--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/scripts/custom-scripts.js b/scripts/custom-scripts.js
index 656b9009..f67f21cd 100644
--- a/scripts/custom-scripts.js
+++ b/scripts/custom-scripts.js
@@ -5,17 +5,18 @@ import showToast from "./toast-message.js";
initLegalNotice();
async function initLegalNotice() {
- const config = await getBrandingConfig();
+ const config = await getBrandingConfig();
+ if (config?.legalMessage) {
document.addEventListener(EventNames.SESSION_STARTED, function() {
showLegalNotice(config);
});
+ }
}
function showLegalNotice(config) {
- const legalDefault = `NOTICE: Adobe records and uses your e-mail address for tracking purposes.`;
- const legalToast = config?.legalMessage || legalDefault;
- const legalDuration = 10000;
- const toastType = "info";
+ const legalToast = config?.legalMessage;
+ const legalDuration = 10000;
+ const toastType = "info";
- showToast(legalToast, legalDuration, toastType, false);
+ showToast(legalToast, legalDuration, toastType, false);
}
\ No newline at end of file
diff --git a/styles/gmo-styles.css b/styles/gmo-styles.css
index 44fe5826..e7b2b014 100644
--- a/styles/gmo-styles.css
+++ b/styles/gmo-styles.css
@@ -28,5 +28,4 @@ header nav .nav-brand .adp-logo img {
.adp-toast {
text-transform: none;
-}
-
+}
\ No newline at end of file
From 0ad18f32575d1ad213f557ee26b93d6ad0a2945b Mon Sep 17 00:00:00 2001
From: cheintzman <147882114+cheintzman@users.noreply.github.com>
Date: Wed, 24 Jan 2024 14:22:58 -0500
Subject: [PATCH 05/11] ASSETS 33680 (Update) (#28)
* Changes link colors for landing page teasers
* Created Functions to Detect Background Color
Created getVideoColor() and waitForVideoLoad() in order to track the color of the background video and changed the CSS styling of Landing page links under a
element
* Code cleanup
Cleaned up some unused code and added a transition for the color change on landing page links
* More code clean up
* Changed color of landing page link
---
blocks/gmo-landing-page/gmo-landing-page.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blocks/gmo-landing-page/gmo-landing-page.js b/blocks/gmo-landing-page/gmo-landing-page.js
index 1ec10c6d..b6da5a47 100644
--- a/blocks/gmo-landing-page/gmo-landing-page.js
+++ b/blocks/gmo-landing-page/gmo-landing-page.js
@@ -33,7 +33,7 @@ async function getVideoColor(){
hexColorOld = hexColor;
let linkActive = document.querySelector('.gmo-landing-page p a');
if (hexColor == '#000000') {
- return linkActive.style.color = '#AEDBFE';
+ return linkActive.style.color = '#72B7F9';
}
linkActive.style.color = '#035FE6';
}
From 4cec07faa8d3eb5e9605c543b7092a77482cd667 Mon Sep 17 00:00:00 2001
From: Christopher Heintzman
Date: Thu, 8 Feb 2024 12:03:07 -0500
Subject: [PATCH 06/11] Assets 34038 (#31)
* Login status can be checked without redirect
- Made changes to checkUserAccess() that will allow login status to be checked even on pages where isPublicPage() is true
- Changed client_id to use imsLibConfig in case sharepoint is used for this purpose in the future
-Changes to getBearerTokenFromIMS() made so that window.adobeIMS.reAuthenticate() only runs on non public pages
- Simplified method of changing the adp-logo href using the ability to check user logged in status
- Header now loads quicklinks, searchfield and userinfo based on user login status, allowing quicklinks and userinfo to appear on public pages if logged in.
* Code Cleanup
---
blocks/adp-header/adp-header.js | 13 +++----------
scripts/security-imslib.js | 13 ++++++++-----
scripts/security.js | 6 +++---
3 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/blocks/adp-header/adp-header.js b/blocks/adp-header/adp-header.js
index 68444981..7590dd66 100644
--- a/blocks/adp-header/adp-header.js
+++ b/blocks/adp-header/adp-header.js
@@ -106,21 +106,13 @@ function toggleMenu(nav, navSections, forceExpanded = null) {
export default async function decorate(block) {
block.textContent = '';
- // change adp-logo href depending on whether user is logged in
- let logoHome = null;
- if (await window.adobeIMS?.getProfile() != null) {
- logoHome = `${getBaseConfigPath()}/` + 'assets';
- } else {
- logoHome = `${getBaseConfigPath()}/`;
- }
-
// decorate nav DOM
const nav = document.createElement('nav');
nav.id = 'nav';
nav.innerHTML = `