-
Notifications
You must be signed in to change notification settings - Fork 211
MWPW-185519 [MEP][Lingo] Fix clickable fragments and fragment badges #5281
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
Conversation
…onality Primary Fix: - Prevent fragment badges from being clickable when preview mode is off in non-prod envd - Fix data-fragment-default incorrectly added to programmatically generated elements using .fragment class (e.g., georouting-wrapper) by checking for data-path attribute Additional Improvements: - Fix badge clickability for display:contents elements (tabs, accordions) - Fix inline Lingo fragments missing badges by copying attributes to children - Add Lingo badge visibility when mepFragments checkbox is enabled - Fix badge overlap in zero-height sections - Rename addLingoFragmentClickHandlers to addFragmentBadgeClickHandlers for clarity
|
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. |
| || placeholders) { | ||
| const { updateFragDataProps, handleCommands, replacePlaceholders } = await import('../../features/personalization/personalization.js'); | ||
| if (a.dataset.manifestId || a.dataset.adobeTargetTestid) { | ||
| const hasManifestId = a.dataset.manifestId || a.dataset.adobeTargetTestid; |
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.
you could probably declare these a little earlier and use them directly in the if condition to make the condition a little more readable and save on bytes.
| const section = document.querySelector('.mep-lingo-fallback-section'); | ||
| const frag = section.querySelector('.fragment'); | ||
| expect(frag).to.exist; | ||
| // TODO: Add fallback attribute test coverage in separate PR |
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.
Might make sense to already create a ticket where this work is described, so this doesn't get forgotten and so we can just remove these lines of code.
|
Reminder to set the |
|
Validation done on the pr on the below url |



Summary
Fixes issue with fragments being clickable outside preview mode in non-prod environments and improves fragment badge functionality. Also ensures data-fragment-default is not added to the georouting-wrapper, or other simlilar
Changes
Primary Fix
addFragmentBadgeClickHandlersto only activate whenmepHighlightormepFragmentsis enabledBadge Improvements
display:contentselements (tabs, accordions) by checking clicks relative to visible children::beforepseudo-element widthopenFragment()helper to reduce code duplication--badge-top-offsetCSS variablePreview Badge Visibility
data-mep-lingo-roc/data-mep-lingo-fallbackto children inpersonalization.jsSteps to QA:
expected outcome(after): nothing happens
actual outcome (before): the fragment opens in a separate window, which is the expected behavior of the fragment badge.
image of gray fragment badges:
Resolves: MWPW-185513
Test URLs: