MWPW-206315: {{plan-type-text}} system placeholder (plan-type-only legal price, card-scoped) - #1202
Conversation
…ch-card and mas-field
…tions inject per card)
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
|
SNOW Change Request Transaction ID [IO]: 0000019c1ef37582-20bacbe0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1202 +/- ##
==========================================
+ Coverage 90.76% 90.79% +0.02%
==========================================
Files 318 319 +1
Lines 101712 101830 +118
==========================================
+ Hits 92317 92454 +137
+ Misses 9395 9376 -19
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…g; add data-legal-case to marker
… inline-price inline-block)
…ns-variant legal display:block
…inject marker styles for mas-field-only pages
…merch-card) so locale plan-type labels render
Axelcureno
left a comment
There was a problem hiding this comment.
planTypeTextOptionsProvider sets displayPlanType = true, but ten other providers set it unconditionally for data-template="legal", which the marker is: mas-field.js:110 plus the nine variant layouts via merch-card.js:79. providers.price is a Set and both hosts register in connectedCallback, so whichever connects second runs last.
Repro'd both ways: card first breaks the mas-field's marker, field first the card's. Single-host pages always order right, so the tests pass.
price.js:54 applies placeholder.dataset after every provider, so data-display-plan-type="true" in the emitted markup fixes it.
Andrei4226
left a comment
There was a problem hiding this comment.
The bundles in dist/ are unminified, unlike on main (+55,110)
I think the fix is to run the production build (with minify on) and re-commit dist/.
…ard prices, skips cancel-context), block-ancestor casing, test cleanup + rename
…text), block-ancestor casing, afterEach cleanup
|
Thanks @Axelcureno — great catches, all addressed:
|
Axelcureno
left a comment
There was a problem hiding this comment.
All six addressed. Recreated the pre-fix state locally and the ordering test fails, so it's a real guard. The three flags on the marker are exactly what legalTemplate reads, so nothing's missing.
# Conflicts: # web-components/dist/commerce.js # web-components/dist/mas.js # web-components/dist/merch-card-collection.js
|
@Andrei4226 good catch — synced with main and re-ran the production (minified) build, re-committed |
Resolves https://jira.corp.adobe.com/browse/MWPW-206315
QA Checklist: https://wiki.corp.adobe.com/display/adobedotcom/M@S+Engineering+QA+Use+Cases
Introduces a
{{plan-type-text}}system placeholder that renders the plan-type label only (via the inline-price legal template), sourcing the offer from the surrounding card/field.How it works
{{plan-type-text}}is a generic system placeholder: aSYSTEM_PLACEHOLDERSmap merged into the dictionary inreplace, so it resolves on any fragment to<span is="inline-price" data-template="legal" data-placeholder="plan-type-text">. System keys are spread last, so an Odin dictionary entry of the same key can't shadow them.merch-cardandmas-field(registered by both hosts) backfills the OSI from a newosigetter (promo → regular → fragmentosifield), forces plan-type-only (all other display optionsfalse), and applies sentence-boundary casing inprice/legal.js.mas-fieldalso merges the fragment'spriceLiterals(parity withmerch-card) so locale plan-type labels render. The marker's CSS (inline display + visibility over the consumer's hide-until-resolved rule) self-injects from the feature module, so it works on mas-field-only pages too. No changes toinline-price.js/hydrate.js.Notes
Casing follows sentence boundaries (
.!?/ start → uppercase; else lowercase). Case-less scripts (e.g. Hebrew) are natural no-ops.Accepted limitation: during a total Odin dictionary outage,
{{plan-type-text}}is left raw like any placeholder (system placeholders merge into the dictionary only when it resolves).Coverage: io/www 100%; web-components suite green. NALA E2E recommended (marker on a real card and a mas-field).
C1. Cover code with Unit Tests
C2. Add a Nala test (double check with #fishbags if nala test is needed)
C3. Verify all Checks are green (unit tests, nala tests)
C4. PR description contains working Test Page link where the feature can be tested
C5: you are ready to do a demo from Test Page in PR
C.6 read your Jira one more time to validate that you've addressed all AC's and nothing is missing
Test URLs:
Screenshots