MWPW-159257 refactor mas enablement
- move of wcms-commerce -> mas-commerce-service
- move of some public functions to mas-commerce-service,
- remove mas.js code for initialization, everything needs to go through the component,
- split of settings code with locale settings, make milo locale settings an explicit function,
- unit tests,
- updates of docs, especially mas.js.html with that component
Resolves: MWPW-159257
Test URLs:
- Before: https://main--milo--adobecom.hlx.page/libs/features/mas/docs/mas.js.html
- After: https://MWPW-159257--milo--npeltier.hlx.page/libs/features/mas/docs/mas.js.html
| Page | Scores | Audits | ||
|---|---|---|---|---|
| :iphone: | /libs/features/mas/docs/mas.js.html | |||
| :desktop_computer: | /libs/features/mas/docs/mas.js.html |
Codecov Report
Attention: Patch coverage is 99.91817% with 1 line in your changes missing coverage. Please review.
Project coverage is 96.42%. Comparing base (
332c3a5) to head (d0c0d92). Report is 5 commits behind head on stage.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| libs/features/mas/commerce/src/inline-price.js | 99.24% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## stage #3012 +/- ##
==========================================
+ Coverage 96.40% 96.42% +0.01%
==========================================
Files 243 245 +2
Lines 55415 55648 +233
==========================================
+ Hits 53425 53659 +234
+ Misses 1990 1989 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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.
@npeltier can you also rename events from wcms:placeholder:* to mas:* ?
@npeltier Your changes are breaking commerce in UK locale (the prices have promo code).
With your changes, the old price is rendered only as a regular price, and optical price has a different value
- https://mwpw-159257--milo--npeltier.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders
It should be:
- https://main--milo--adobecom.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders
@npeltier Your changes are breaking commerce in UK locale (the prices have promo code).
With your changes, the old price is rendered only as a regular price, and optical price has a different value
* https://mwpw-159257--milo--npeltier.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders![]()
It should be:
* https://main--milo--adobecom.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders![]()
thanks, @afmicka, requests are the same, only difference is my PR does the request on stage for a reason i need to understand :)
@yesil @3ch023 (cc @afmicka )
so basically milo's getConfig() on Mili's page returns
env = {
name: 'stage',
ims: 'stg1',
adobeIO: 'cc-collab-stage.adobe.io',
adminconsole: 'stage.adminconsole.adobe.com',
account: 'stage.account.adobe.com',
…
}
i guess here env.name=stage is bound to IMS, not commerce. we agree the only way to put commerce stage should be commerce.env, right?
we agree the only way to put commerce stage should be
commerce.env, right?
right. ?commerce.env=stage should result in https://www.stage.adobe.com/web_commerce_artifact_stage ?env=stage should result in https://www.adobe.com/web_commerce_artifact
ok @3ch023 for commerce.env, but env=stage, here it's IMS, not commerce. Typically if you look at https://main--milo--adobecom.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders env=stage but it's just prod & prod uri
ok @3ch023 for commerce.env, but env=stage, here it's IMS, not commerce. Typically if you look at https://main--milo--adobecom.hlx.live/uk/drafts/nala/features/commerce/promo-placeholders env=stage but it's just prod & prod uri
yes, I had a typo, sorry. confirming once again ?env=stage has no effect on Commerce. It should go to prod + prod uri. ?env=stage should result in https://www.adobe.com/web_commerce_artifact
@yesil wrt to checkout & inline price, i find it confusing to have file names not corresponding to the classes, nor the "is". That's why i just kept those two names, and reused them all over (before you had the registered class & the placeholder element with two different names which i found really confusing, now you have that class + MasElement sub item) i'm fine renaming as you wish though, i'm passed the will to do any discussion :)
@npeltier for instance checkout link element inherits from the native HTMLAnchorElement.
I find AnchorElement is a good suffix what all custom elements inheriting from it should be using.
That way, when you look at the stack trace, not only you know it is CheckoutLinkAnchorElement, but also you know it is a custom element that is a link that renders content.
Since we already have npm modules(hopefully we can combine commerce & web-components) and folders to organise files, I think giving long file names is not necessary.
@npeltier
-
commerce.env=stageis making requests to www.adobe.com instead of www.stage.adobe.com https://mwpw-159257--milo--npeltier.hlx.page/drafts/nala/features/commerce/promo-placeholders?commerce.env=stage
-
commerce.landscapedoes not work (has effect) on your branch, https://mwpw-159257--milo--npeltier.hlx.page/drafts/nala/features/commerce/promo-placeholders?commerce.landscape=draft
on main branch: https://main--milo--adobecom.hlx.page/drafts/nala/features/commerce/promo-placeholders?commerce.landscape=draft
the rest of the regression looks OK but after fixing this, it needs another round. @Roycethan could you follow-up after the fix? I will be away starting this afternoon until Thursday morning.
Regressions covered for this branch - Once above mentioned issues get fixed let me know @npeltier @3ch023 @yesil
Reported issues fixed and - regressions covered