Skip to content

Commit

Permalink
update icon size naming
Browse files Browse the repository at this point in the history
Revert "MWPW-147867 - [marquee] support RTL for loc" (#2662)

Revert "MWPW-147867 - [marquee] support RTL for loc (#2640)"

This reverts commit 49df5f7.

Revert "[MWPW-145131] Send locale and language code to analytics" (#2661)

Revert "[MWPW-145131] Send locale and language code to analytics (#2600)"

This reverts commit 04e687f.

MWPW-155079 [MILO][MEP] Manifests not changing domains (#2626)

* replace overridePersonalizationVariant function

* Fix chaining

* Move parseMepParam

* add additional optional chaining operator

Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com>

* Refactor personalization.js

* Remove comment

* Add TargetManifestId

* Remove comment

* Add targetManifestId test

* Refactor addMepHighlightAndTargetManifestIdGnav

* Remove console.log from test

* Shorten function name

* Limits targetManifestId to target exp and adds missing name to  manifestId

* Fix test

* Handle default selectedVariant issue

* Mostly done

* Merging in prop display update

* Unit tests fixed

* Add targetmanifestid to useblockcode

* refactor to remove unnecessary import

* Remove commented code

* Removing unused functions

* Update tests, not including replacePage

* Shorten Function Name

* move insert inline back to fragment.js

* additional cleanup and unit tests

* Fix adobeTargetTestId issues

* add optional chaining

* Update condition for addAnalyticsForUseBlockCode

* Refactor to handle analytics for updatemetadata

* Fix useBlockCode test

* Fix merged merged test

* Remove applyPers from preload fragments test

* Fix martech init post-merge

* Fix tests and martech merge cleanup

* Dynamically import personalization.js

* add 2 ignore comments

* add conditional chaining

* Remove mwpw-146528 temp files

* MWPW-152275 Move manifest.json request up while waiting on sstats / etc. (#2608)

* add preload

* shorten if and and conditional chaining

* run loop even if Target is off

* Add nullish coalescing assignment suggestion

* MWPW-154998 [MEP][MILO] Manifests do not execute in the right order when there is a disabled manifest (#2616)

* add default execution order

* unit test

* normalizePath

* add normalizePath back into preload

* MWPW-155568 [MILO][MEP] If MEP is completely off, mep param should still show button (#2658)

don't return if param is present but empty

---------

Co-authored-by: markpadbe <markp@adobe.com>
Co-authored-by: Mark Perry <124626043+markpadbe@users.noreply.github.com>

MWPW-146030 and MWPW-143704 Add fresco-any and cc-paid-no-stock (#2657)

add entitlements

Attaching loadblock to window to provide alternative way of loading the script (#2660)

Attaching loadblock to window

MWPW-155316 - Fixing Pill Notification edge cases (#2639)

* handling pill edge cases

* pill edge case styles

* update tests to fix coverage

* correction to previous commit

* updates based on PR feedback

* more simplifying

* adding an additional filter

* style tweak

* change inline size for desktop pills

* revert of icon sizing

* revert of ribbon revert

Correctly pass on the dataset (#2651)

MWPW-155289: Fixed filtering and sorting in catalog sidenav (#2653)

handled empty hash case in deeplink

MWPW-154124: use preview index (#2654)

* MWPW-154124: use preview index

* should remove both links

[AUTOMATED-PR] Update imslib.min.js dependency (#2659)

Update self hosted dependency

Co-authored-by: GitHub Action <action@github.com>

[MWPW-152181] Tabbing gets "stuck" after second instance of merch-card CTAs, within a segment blade (#2650)

* Allow the default tab action to proceed if the current focused element is from the last merch card

* ran "npm run build"

* Updated readme

* fix vulnerability

* Revert "fix vulnerability"

This reverts commit e34d131.

* allow tabbing across section for merch cards

---------

Co-authored-by: Rohit Sahu <rosahu@adobe.com>

[MWPW-145131] Send locale and language code to analytics (#2670)

MWPW-147867 - [marquee] support RTL for loc - RePost (#2676)

added `support-rtl` selectors

MWPW-155691 [MILO][MEP] Also use region in placeholders decision  (#2680)

* use region for placeholders

* move region to it's own line

* move value to last and add other

MWPW-154901 Set debug=true on categories container (#2624)

* MWPW-154901: enables debug=true based on container type

* Update libs/blocks/caas/utils.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

[MWPW-136406] Tabs block enhancement: deep linking (#2652)

* query param for focused tab

* addressed feedback

add lockup support

lockup improvements

updating button defaults

fix button size logic

update default btn size for banners

MWPW-154981: adds a new Created Date option to details text (#2685)

Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com>

MWPW-155781 [MILO] Geo Modal Tracking on BACOM - Missing custom link (#2694)

add analytic

MWPW-154898 No wait for modal fragment (#2607)

No wait for modal fragment

MWPW-154191: Ability to have green promo text on merch-card to bottom of the card (under description) (#2663)

added promo-text slot to all merch cards

MWPW-155654 Open TWP modal with preselected tab (#2691)

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

* Trigger Build

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

* MWPW-155654 Open TWP modal with preselected tab

---------

Co-authored-by: Bozo Jovicic <bozo@hitthecode.com>

MWPW-154893 - [editorial-card] bugs (#2656)

* added .support-rtl variant for easier rtl loc support

* moved support-rtl to tablet up selector

* remove right

* removed margin-top bottom tablet styles

* added empty class and updated has-footer to equal-height to expose that as a variant

* s spacing gap default

* action column-gap

* no footer test coverage

* PR feedback

* revert marquee changes

* updated .footer class to .card-footer to prevent naming colision

* updated test ref

* linting whitespace, test label clarity

* revert icon block changes derp

ENB-6995 Query Params update & sendTargetResponse function update Resubmit for #2664 (#2682)

* Query Parms update & sendTargetResponse function update (#2664)

* Query Parms update & sendTargetResponse function update
- sendTargetResponse: Added Check for window._satellite and changed direct alloy call to _satellite call
- Added additional parameter as marketingtech to disable analytics calls

* Query Parms update & sendTargetResponse function update
- Updated conditional chaining

---------

Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com>

* Update martech.js

* not caching values

---------

Co-authored-by: theankit-sinha <ankitsinha@adobe.com>
Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com>

MWPW-153810 media image is seen loaded twice in product page urls in desktop (#2647)

* placeholderChanges

* placeholderChanges

* Update utils.js

* Update utils.js

* Update utils.js

* lint errors

* Update utils.js

* Update utils.js

* Adding promise.all

* Update utils.js

* Update utils.js

---------

Co-authored-by: Suhani <suhjain@suhanis-mbp.corp.adobe.com>

[MWPW-155627] Merch Callout feature: Missing font cascade (#2679)

add fallback to "Adobe Clean" font for callout text

Co-authored-by: Rohit Sahu <rosahu@adobe.com>

MWPW-153955 [PEP ] dismiss tool tip text is seen chopped in RTL locale in ipad and iphone in landscape mode (#2687)

* Fixed pep dismissal tooltip in rtl locales

* Update libs/features/webapp-prompt/webapp-prompt.css

Co-authored-by: Rares Munteanu <overmyheadandbody@gmail.com>

---------

Co-authored-by: Rares Munteanu <overmyheadandbody@gmail.com>

MWPW-154969 Log LCP and key user attributes (#2686)

* MWPW-154969 Log LCP and key user attributes

This adds the ability to log performance data back to Lana.

To enable the feature, metadata `pageperf = ‘on’ ` must be set for the page.  This feature only works in Chrome browsers.

Additionally `pageperf-rate` can be set to determine what percentage of pages will send data.  E.g `pageperf-rate=15` would have 15% of the pages send perf data.
The default rate is `50`%.

The sending of the data to Lana is delayed so as to not affect any parts of the page load.

Data sent:
* Chrome Version
* CLS Score
* Country (only if georouting is enabled via geo2)
* Downlink: Mbps - Chrome caps value at `10`
* LCP Score
* LCP Element Type
* LCP URL
  * If there is no identifying url, the element html will be used.
* Adobe IMS Logged In Status
* OS
* URL of page
* Window Width & Height
* MEP Manifest Data
  * Manifest(s) Used (only the ones that have been applied to the page)
  * Selected Target in the manifest

* Update logWebVitalsUtils.test.js

* Address PR feedback

---------

Co-authored-by: Okan Sahin <osahin@adobe.com>

[MWPW-150579] Update supported browser list (#2696)

MWPW-152952 Allow message for Marketo form success (#2545)

MWPW-146237: Repurpose seotech-structured-data feature for arbitrary JSON-LD (#2578)

* Add necessary helper functions

* Fix two checks

* Replace getStructuredData

* Move things around

* Fix regex?

* Add env

* Support localhost

* Update paths

* Fix test

* Use seotech api instead

* Update env/subdomain

* Fix test properly

* Update endoint

* Add homepage

* Update README

* Rework endpoint handling

* Add class to script tags

* More doc updates

revert  PR of placeholder function as placeholder value is seen displayed with additional nbsp text in locale product pages in stage (#2709)

Update utils.js

Standalone GNav for Non-Milo Consumers (#2669)

* Adding configuration for header component

* Adding test cases

* Adding css changes

* Updated for css

* Setting the origin to federal

* Removing promise array

* Adding redirect uri in meta

* Updating meta insert function

* Lint fix

* Making error message descriptive

---------

Co-authored-by: Snehal Sonawane <sonawane@Snehals-MacBook-Pro.local>

Making new GNAV experience default (#2689)

Fix: Load gnav search files only if it is authored (#2700)

[MWPW-154102] Accordion RTL alignment (#2704)

[MWPW-156163] Send additional Slack notifications for high impact PRs (#2713)

MWPW-156388 [MILO][MEP] fix for martech=off when page has manifest with enablements (#2720)

* initial fix

* Update libs/features/personalization/personalization.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* move where martech=off is used

* move logic to handleEntitlements function

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

MWPW-156220: Support pa code and product code for (#2712)

* MWPW-156220: Support pa code and product code for

checkout link configuration in addition to product family.

* optimize perf

* PR feedback

* PR feedback

Added download and open-in spectrum icons (#2595)

adde download and open-in spectrum icons

Co-authored-by: Dragana Trajkovic <dragana.trajkovic@lilly021.com>

MWPW-142166 One Page Gated (#2673)

* MWPW-142166 One Page Gated

* PR Changes

MWPW-153987 [MILO][MEP] looks in wrong location for MEP test block code on stage (#2693)

* calculate even on stage, find miloLibs and origin outside of loop

* MWPW-155314 [MEP] Enable Entitlements + Operator (#2638)

port over fixes

---------

Co-authored-by: Jingle Huang <32369333+JingleH@users.noreply.github.com>

[MWPW-154969] Performance consent (#2714)

* Require consent

* Improve the check

* Apply suggestions from code review

Co-authored-by: Narcis Radu <github@narcisradu.ro>

* Fix linting issues

* Fix linting and unit tests

* Return faster

* Track once consent is given

* Fix unit tests

* Remove defaults

* Only listen to privacy once.

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
  • Loading branch information
elan-tbx and narcis-radu committed Aug 12, 2024
1 parent 538b3be commit a0f2795
Show file tree
Hide file tree
Showing 90 changed files with 1,912 additions and 692 deletions.
4 changes: 2 additions & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
last 1 chrome version
last 1 firefox version
last 1 edge version
safari >= 14
ios_saf >= 14
safari >= 15
ios_saf >= 15
5 changes: 4 additions & 1 deletion .github/workflows/high-impact-alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ const main = async (params) => {
}

const { html_url, number, title } = context.payload.pull_request;
console.log('High impact label detected, sending Slack notification');
console.log('High impact label detected, sending Slack notifications');
slackNotification(`:alert: High Impact PR has been opened: <${html_url}|#${number}: ${title}>.` +
` Please prioritize testing the proposed changes.`, process.env.SLACK_HIGH_IMPACT_PR_WEBHOOK);
slackNotification(`:alert: High Impact PR has been opened: <${html_url}|#${number}: ${title}>.` +
` Please review the PR details promptly and raise any concerns or questions.`,
process.env.SLACK_MILO_UPDATES_WEBHOOK);
} catch (error) {
console.error(error);
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/high-impact-alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
SLACK_HIGH_IMPACT_PR_WEBHOOK: ${{ secrets.SLACK_HIGH_IMPACT_PR_WEBHOOK }}
SLACK_MILO_UPDATES_WEBHOOK: ${{ secrets.SLACK_MILO_UPDATES_WEBHOOK }}

jobs:
send_alert:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/label-zero-impact.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const zeroImpactDirs = [
'.kodiak',
'.vscode',
'.test',
'.browserslistrc',
'libs/mep',
'.eslintrc.js',
'CODEOWNERS',
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/accordion/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dl.accordion {
line-height: var(--type-heading-s-lh);
padding: var(--spacing-s) var(--spacing-m) var(--spacing-s) var(--spacing-xs);
position: relative;
text-align: left;
text-align: start;
width: 100%;
-webkit-text-size-adjust: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions libs/blocks/adobetv/adobetv.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const loadAdobeTv = (a) => {
const bgBlocks = ['aside', 'marquee', 'hero-marquee'];
if (a.href.includes('.mp4') && bgBlocks.some((b) => a.closest(`.${b}`))) {
a.classList.add('hide');
const { href, hash } = a;
const attrs = getVideoAttrs(hash || 'autoplay');
const { href, hash, dataset } = a;
const attrs = getVideoAttrs(hash || 'autoplay', dataset);
const video = `<video ${attrs}>
<source src="${href}" type="video/mp4" />
</video>`;
Expand Down
1 change: 1 addition & 0 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const defaultOptions = {
},
detailsTextOption: {
default: 'Default',
createdDate: 'Created Date',
modifiedDate: 'Modified Date',
},
cardHoverEffect: {
Expand Down
4 changes: 3 additions & 1 deletion libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ export const getConfig = async (originalState, strs = {}) => {
&& state.targetActivity ? `/${encodeURIComponent(state.targetActivity)}.json` : '';
const flatFile = targetActivity ? '&flatFile=false' : '';
const localesQueryParam = locales ? `&locales=${locales}` : '';
const debug = state.showIds && document.location.pathname.includes('/tools/caas') ? '&debug=true' : '';
const debug = (state.showIds && document.location.pathname.includes('/tools/caas'))
|| state.container === 'categories'
? '&debug=true' : '';
const collectionTags = state.includeTags ? state.includeTags.join(',') : '';
const excludeContentWithTags = state.excludeTags ? state.excludeTags.join(',') : '';

Expand Down
38 changes: 19 additions & 19 deletions libs/blocks/editorial-card/editorial-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
min-width: initial;
}

.editorial-card.has-footer {
.editorial-card.equal-height {
height: 100%;
}

Expand All @@ -79,27 +79,29 @@
}

.editorial-card .foreground,
.editorial-card .footer {
.editorial-card .card-footer {
padding: var(--spacing-xs);
}

.editorial-card .extra-row {
padding: 0 var(--spacing-xs);
}

.editorial-card .footer {
.editorial-card .card-footer {
padding-top: 0;
margin-top: auto;
}

.editorial-card .footer > div {
.editorial-card .card-footer > div {
display: flex;
flex-direction: column;
text-align: end;
justify-content: end;
row-gap: var(--spacing-xxs);
}

.editorial-card .card-footer.empty { padding: 0; }

.editorial-card.no-bg.no-border .foreground {
padding: var(--spacing-s) 0;
}
Expand All @@ -109,7 +111,7 @@
}

.editorial-card.no-bg.no-border .static,
.editorial-card.no-bg.no-border .footer {
.editorial-card.no-bg.no-border .card-footer {
padding-inline: 0;
}

Expand All @@ -127,8 +129,8 @@
line-height: 0;
}

.editorial-card.footer-align-left .footer > div { text-align: start; }
.editorial-card.footer-align-center .footer > div { text-align: center; }
.editorial-card.footer-align-left .card-footer > div { text-align: start; }
.editorial-card.footer-align-center .card-footer > div { text-align: center; }

.editorial-card.no-bg.no-border .foreground > div {
row-gap: var(--spacing-xs);
Expand All @@ -154,11 +156,11 @@
}

.editorial-card .action-area,
.editorial-card .footer > .action-area {
.editorial-card .card-footer > .action-area {
display: flex;
align-items: center;
justify-content: right;
gap: var(--spacing-xxs);
gap: var(--spacing-xs) var(--spacing-s);
flex-flow: wrap;
flex-direction: row;
}
Expand All @@ -171,16 +173,13 @@
justify-content: center;
}

.editorial-card.right .action-area {
justify-content: right;
}

.editorial-card hr {
background-color: currentcolor;
border: none;
height: 1px;
width: 100%;
margin: var(--spacing-xs) 0;
margin: var(--spacing-xxs) 0;
}

.editorial-card .background {
Expand All @@ -204,6 +203,11 @@
position: relative;
}

.editorial-card:is(.media-square, .media-wide, .media-standard, .media-tall) .media-area .milo-video {
height: auto;
padding: 0;
}

/* Aspect Ratio */
.editorial-card.media-square .media-area img,
.editorial-card.media-square .media-area video {
Expand All @@ -224,7 +228,8 @@
}

.editorial-card.media-tall .media-area img,
.editorial-card.media-tall .media-area video {
.editorial-card.media-tall .media-area video,
.editorial-card.media-tall .media-area .milo-video {
aspect-ratio: var(--aspect-ratio-tall);
max-height: unset;
}
Expand All @@ -241,10 +246,5 @@
justify-items: center;
}

.editorial-card.right {
text-align: end;
justify-items: end;
}

.editorial-card.footer-align-left .action-area { justify-content: start; }
.editorial-card.footer-align-center .action-area { justify-content: center; }
7 changes: 4 additions & 3 deletions libs/blocks/editorial-card/editorial-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const decorateForeground = async (el, rows) => {
row.classList.add('foreground');
await decorateLockupFromContent(row);
} else if (i === (rows.length - 1)) {
row.classList.add('footer');
row.classList.add('card-footer');
if (!row.textContent.trim()) row.classList.add('empty');
} else {
row.classList.add('extra-row');
}
Expand Down Expand Up @@ -86,12 +87,12 @@ const init = async (el) => {
if (![...el.classList].some((c) => c.endsWith('-lockup'))) el.classList.add('m-lockup');
let rows = el.querySelectorAll(':scope > div');
const [head, middle, ...tail] = rows;
if (rows.length === 4) el.classList.add('has-footer');
if (rows.length === 4) el.classList.add('equal-height');
if (rows.length >= 1) {
const count = rows.length >= 3 ? 'three-plus' : rows.length;
switch (count) {
case 'three-plus':
// 3+ rows (0:bg, 1:media, 2:copy, ...3:static, last:footer)
// 3+ rows (0:bg, 1:media, 2:copy, ...3:static, last:card-footer)
decorateBgRow(el, head);
rows = tail;
await decorateForeground(el, rows);
Expand Down
19 changes: 4 additions & 15 deletions libs/blocks/fragment/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ const updateFragMap = (fragment, a, href) => {
}
};

const setManifestIdOnChildren = (sections, manifestId) => {
[...sections[0].children].forEach(
(child) => (child.dataset.manifestId = manifestId),
);
};

const insertInlineFrag = (sections, a, relHref) => {
// Inline fragments only support one section, other sections are ignored
const fragChildren = [...sections[0].children];
Expand Down Expand Up @@ -79,7 +73,7 @@ export default async function init(a) {
}

const path = new URL(a.href).pathname;
if (mep?.fragments?.[path] && mep) {
if (mep?.fragments?.[path]) {
relHref = mep.handleFragmentCommand(mep?.fragments[path], a);
if (!relHref) return;
}
Expand Down Expand Up @@ -122,15 +116,10 @@ export default async function init(a) {
}

updateFragMap(fragment, a, relHref);

if (a.dataset.manifestId) {
if (inline) {
setManifestIdOnChildren(sections, a.dataset.manifestId);
} else {
fragment.dataset.manifestId = a.dataset.manifestId;
}
if (a.dataset.manifestId || a.dataset.adobeTargetTestid) {
const { updateFragDataProps } = await import('../../features/personalization/personalization.js');
updateFragDataProps(a, inline, sections, fragment);
}

if (inline) {
insertInlineFrag(sections, a, relHref);
} else {
Expand Down
28 changes: 15 additions & 13 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
toFragment,
trigger,
yieldToMain,
addMepHighlight,
addMepHighlightAndTargetId,
} from './utilities/utilities.js';

import { replaceKey, replaceKeyArray } from '../../features/placeholders.js';
Expand Down Expand Up @@ -405,13 +405,15 @@ class Gnav {
try {
this.block.removeEventListener('click', this.loadDelayed);
this.block.removeEventListener('keydown', this.loadDelayed);
const [
Search,
] = await Promise.all([
loadBlock('../features/search/gnav-search.js'),
loadStyles(rootPath('features/search/gnav-search.css')),
]);
this.Search = Search;
if (this.searchPresent()) {
const [
Search,
] = await Promise.all([
loadBlock('../features/search/gnav-search.js'),
loadStyles(rootPath('features/search/gnav-search.css')),
]);
this.Search = Search;
}

if (!this.useUniversalNav) {
const [ProfileDropdown] = await Promise.all([
Expand Down Expand Up @@ -919,14 +921,14 @@ class Gnav {
observer.observe(dropdownTrigger, { attributeFilter: ['aria-expanded'] });

delayDropdownDecoration({ template: triggerTemplate });
return addMepHighlight(triggerTemplate, item);
return addMepHighlightAndTargetId(triggerTemplate, item);
}
case 'primaryCta':
case 'secondaryCta':
// Remove its 'em' or 'strong' wrapper
item.parentElement.replaceWith(item);

return addMepHighlight(toFragment`<div class="feds-navItem feds-navItem--centered">
return addMepHighlightAndTargetId(toFragment`<div class="feds-navItem feds-navItem--centered">
${decorateCta({ elem: item, type: itemType, index: index + 1 })}
</div>`, item);
case 'link': {
Expand All @@ -945,15 +947,15 @@ class Gnav {
<div class="feds-navItem${activeModifier}">
${linkElem}
</div>`;
return addMepHighlight(linkTemplate, item);
return addMepHighlightAndTargetId(linkTemplate, item);
}
case 'text':
return addMepHighlight(toFragment`<div class="feds-navItem feds-navItem--centered">
return addMepHighlightAndTargetId(toFragment`<div class="feds-navItem feds-navItem--centered">
${item.textContent}
</div>`, item);
default:
/* c8 ignore next 3 */
return addMepHighlight(toFragment`<div class="feds-navItem feds-navItem--centered">
return addMepHighlightAndTargetId(toFragment`<div class="feds-navItem feds-navItem--centered">
${item}
</div>`, item);
}
Expand Down
4 changes: 2 additions & 2 deletions libs/blocks/global-navigation/utilities/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
toFragment,
trigger,
yieldToMain,
addMepHighlight,
addMepHighlightAndTargetId,
} from '../utilities.js';

const decorateHeadline = (elem, index) => {
Expand Down Expand Up @@ -317,7 +317,7 @@ const decorateMenu = (config) => logErrorFor(async () => {
${menuContent}
</div>
</div>`;
addMepHighlight(menuTemplate, content);
addMepHighlightAndTargetId(menuTemplate, content);

decorateCrossCloudMenu(menuTemplate);

Expand Down
12 changes: 6 additions & 6 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ export const logErrorFor = async (fn, message, tags) => {
}
};

export function addMepHighlight(el, source) {
let { manifestId } = source.dataset;
if (!manifestId) {
const closestManifestId = source?.closest('[data-manifest-id]');
if (closestManifestId) manifestId = closestManifestId.dataset.manifestId;
}
export function addMepHighlightAndTargetId(el, source) {
let { manifestId, targetManifestId } = source.dataset;
manifestId ??= source?.closest('[data-manifest-id]')?.dataset?.manifestId;
targetManifestId ??= source?.closest('[data-adobe-target-testid]')?.dataset?.adobeTargetTestid;
if (manifestId) el.dataset.manifestId = manifestId;
if (targetManifestId) el.dataset.adobeTargetTestid = targetManifestId;
return el;
}

Expand Down Expand Up @@ -310,6 +309,7 @@ export async function fetchAndProcessPlainHtml({ url, shouldDecorateLinks = true
const text = await res.text();
const { body } = new DOMParser().parseFromString(text, 'text/html');
if (mepFragment?.manifestId) body.dataset.manifestId = mepFragment.manifestId;
if (mepFragment?.targetManifestId) body.dataset.adobeTargetTestid = mepFragment.targetManifestId;
const commands = mepGnav?.commands;
if (commands?.length) {
const { handleCommands, deleteMarkedEls } = await import('../../../features/personalization/personalization.js');
Expand Down
Loading

0 comments on commit a0f2795

Please sign in to comment.