-
Notifications
You must be signed in to change notification settings - Fork 181
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-159257 refactor mas enablement #3012
Conversation
- 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
@npeltier for instance checkout link element inherits from the native HTMLAnchorElement. |
not documenting it as i'm not sure it's needed by consumers
libs/blocks/merch/merch.js
Outdated
@@ -3,7 +3,7 @@ import { | |||
} from '../../utils/utils.js'; | |||
import { replaceKey } from '../../features/placeholders.js'; | |||
|
|||
export const CHECKOUT_LINK_CONFIG_PATH = '/commerce/checkout-link.json'; // relative to libs. | |||
export const CHECKOUT_LINK_CONFIG_PATH = '/commerce/checkout-link-anchor-element.json'; // relative to libs. |
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.
@npeltier this is an excel file, I don't think we should rename it, especially now.
}); | ||
//commerce parameters | ||
['checkoutWorkflowStep', 'forceTaxExclusive', 'checkoutClientId'].forEach((attribute) => { | ||
const value = this.getAttribute(attribute); |
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 think we should adopt html friendly attribute names: checkout-workflow-step
, force-tax-exclusive
checkout-client-id
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 be a unintentional commit, let's remove this.
@@ -25,6 +24,8 @@ styles.innerHTML = ` | |||
--consonant-merch-card-cta-font-size: 15px; | |||
|
|||
/* headings */ | |||
--merch-card-heading-xxs-font-size: 16px; |
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.
these changes that are supposed to be shipped as part of @Axelcureno's PRs, if shipped earlier, might cause regression.
I recommend to met his PRs first.
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.
the other way around i would say
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.
rename to mas-commerce-service-element
?
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 would rather not, a web component is an element, we know it
cis_ru: 'AZ_ru', | ||
sea: 'SG_en', | ||
th_en: 'TH_en', | ||
th_th: 'TH_th', |
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 see there are missing locales here, is this intentional?
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 the locales we are living with at the moment, i just moved them to a different place. Do you have an example?
libs/blocks/merch/merch.js
Outdated
document.head.append(service); | ||
await service.readyPromise; | ||
service.imsSignedInPromise?.then((isSignedIn) => { | ||
if (isSignedIn) { |
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 (isSignedIn) { | |
if (isSignedIn) fetchEntitlements(); |
also, we might not need to wrap the outside function
'MY_ms', | ||
'NZ_en', | ||
'TH_en', | ||
'TH_th', |
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.
Locales missing
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.
these are locales where tax is displayed for all segments by default, not all of them
![]()
![]() 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. |
Milo only consumes WCS prod. However with this PR, on local and stage environments, `allow-override` parameter will be added to `mas-commerce-service` allowing to override the commerce env/landscape via query parameters.
Reported issues fixed and - regressions covered |
Resolves: MWPW-159257
Test URLs: