-
Notifications
You must be signed in to change notification settings - Fork 169
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
MWPW-135160: Mnemonics inside merch card #2024
Conversation
|
libs/blocks/merch-card/merch-card.js
Outdated
const mnemonicList = el.querySelector('.mnemonic-list'); | ||
if (mnemonicList) { | ||
bodySlot.append(mnemonicList); | ||
await decorateMnemonicList(bodySlot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether bodySlot
already has some content here. If so, we should limit the scope of decoration to mnemonicList
.
suggestion:
await decorateMnemonicList(mnemonicList);
bodySlot.append(mnemonicList);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Mnemonics need to be inserted after paragraph content, so first decoration happens then insertion into body slot. LMK if this looks okay, otherwise I can make the foreach async and do all at once.
libs/blocks/merch-card/merch-card.js
Outdated
]; | ||
const parseContent = async (el, merchCard) => { | ||
const allElements = el.querySelectorAll('h2, h3, h4, h5, p, ul, em'); | ||
const innerElements = Array.from(allElements).filter((element) => !element.closest('.mnemonic-list')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is getting complicated.
Let's first process mnemonic, then you would not need to change this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. |
libs/blocks/marquee/marquee.js
Outdated
@@ -3,7 +3,8 @@ | |||
*/ | |||
|
|||
import { decorateButtons, getBlockSize, decorateBlockBg } from '../../utils/decorate.js'; | |||
import { createTag, getConfig, loadStyle } from '../../utils/utils.js'; | |||
import { createTag } from '../../utils/utils.js'; | |||
import { decorateMnemonicList } from '../mnemonic-list/mnemonic-list.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if mnemonic-list
is not needed for all marquees on adobe.com, it should be imported dynamically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed. It is now dynamically imported.
libs/blocks/marquee/marquee.js
Outdated
@@ -64,20 +65,6 @@ const decorateImage = (media) => { | |||
} | |||
}; | |||
|
|||
export async function loadMnemonicList(foreground) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
libs/blocks/merch-card/merch-card.js
Outdated
@@ -3,12 +3,15 @@ import { getConfig, createTag } from '../../utils/utils.js'; | |||
import { getMetadata } from '../section-metadata/section-metadata.js'; | |||
import { processTrackingLabels } from '../../martech/attributes.js'; | |||
import { replaceKey } from '../../features/placeholders.js'; | |||
import { decorateMnemonicList } from '../mnemonic-list/mnemonic-list.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decorateMnemonicList
is not needed for majority of the cards, hence should be loaded dynamically and conditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, now dynamically imported.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stage #2024 +/- ##
==========================================
+ Coverage 96.36% 96.39% +0.02%
==========================================
Files 166 166
Lines 42531 43486 +955
==========================================
+ Hits 40986 41918 +932
- Misses 1545 1568 +23 ☔ View full report in Codecov by Sentry. |
@Roycethan this is ready for verification. Thanks. |
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR. |
libs/blocks/marquee/marquee.js
Outdated
@@ -78,6 +78,7 @@ export async function loadMnemonicList(foreground) { | |||
} | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Axelcureno can you fix this eslint issue. Looks like this file shouldn't even be in the change list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Axelcureno
https://main--cc--adobecom.hlx.page/drafts/axel/defects/mwpw-135160?milolibs=MWPW-135160--milo--axelcureno
1)In Ipad viewport the card left/right borders are touching the viewport:
I didn't push any changes and I see it displaying properly in tablet. Probably got fixed in a different PR. Please check @Roycethan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Axelcureno So the example where i can repro this is on 3 col width card as mentioned earlier:
https://main--cc--adobecom.hlx.page/drafts/axel/defects/mwpw-135160?milolibs=MWPW-135160--milo--axelcureno#
@Roycethan thanks, I was able to reproduce this time. I have pushed the fix, please check once more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Axelcureno Fixed now
* MWPW-135160: Mnemonics inside merch card * Update merch-card.js --------- Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Resolves: MWPW-135160
Test URLs: