-
Notifications
You must be signed in to change notification settings - Fork 8
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-152283: add acom wcs endpoint #12
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -576,6 +576,7 @@ declare global { | |
wcsBufferDelay: number; | ||
wcsBufferLimit: number; | ||
wcsEnv: Environment; | ||
domainSwitch: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really need to introduce a new parameter with a confusing name: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just to verify options request will be gone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yesil we need both domains to work so we can compare stuff from same domain |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,6 +180,7 @@ function getSettings(config = {}) { | |
Defaults.entitlement | ||
); | ||
const modal = toBoolean(getParameter('modal', commerce), Defaults.modal); | ||
const upgrade = toBoolean(getParameter('upgrade', commerce), Defaults.upgrade); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please don't mix things up |
||
const forceTaxExclusive = toBoolean( | ||
getParameter('forceTaxExclusive', commerce), | ||
Defaults.forceTaxExclusive | ||
|
@@ -204,6 +205,7 @@ function getSettings(config = {}) { | |
getParameter('wcsBufferLimit', commerce), | ||
Defaults.wcsBufferLimit | ||
); | ||
const domainSwitch = toBoolean(getParameter('domain.switch', commerce), false); | ||
|
||
return { | ||
...getLocaleSettings({ locale }), | ||
|
@@ -217,6 +219,7 @@ function getSettings(config = {}) { | |
entitlement, | ||
extraOptions: Defaults.extraOptions, | ||
modal, | ||
upgrade, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please don't mix things up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okie, will revert |
||
env, | ||
forceTaxExclusive, | ||
priceLiteralsURL: commerce.priceLiteralsURL, | ||
|
@@ -228,6 +231,7 @@ function getSettings(config = {}) { | |
wcsBufferLimit, | ||
wcsEnv: env === Env.STAGE ? WcsEnv.STAGE : WcsEnv.PRODUCTION, | ||
landscape, | ||
domainSwitch, | ||
}; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import { Log } from './log.js'; | |
const WcsBaseUrl = { | ||
[Env.PRODUCTION]: 'https://wcs.adobe.com', | ||
[Env.STAGE]: 'https://wcs.stage.adobe.com', | ||
['STAGE_ACOM']: 'https://www.stage.adobe.com', | ||
}; | ||
|
||
/** | ||
|
@@ -32,12 +33,12 @@ const WcsBaseUrl = { | |
*/ | ||
export function Wcs({ settings }) { | ||
const log = Log.module('wcs'); | ||
const { env, wcsApiKey: apiKey } = settings; | ||
|
||
const { env, domainSwitch, wcsApiKey: apiKey } = settings; | ||
const baseUrl = domainSwitch ? WcsBaseUrl['STAGE_ACOM'] : WcsBaseUrl[env]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is problematic in case you are domainSwitch on and env production, no? i guess we won't have both normally, but still looks weird There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i added acom prod too |
||
// Create @pandora Wcs client. | ||
const fetchOptions = { | ||
apiKey, | ||
baseUrl: WcsBaseUrl[env], | ||
baseUrl, | ||
fetch: window.fetch.bind(window), | ||
}; | ||
const getWcsOffers = webCommerceArtifact(fetchOptions); | ||
|
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.
please don't mix things up