@nuskin/product-components 3.18.0-td-341.1 → 3.18.0-td-341.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mixins/NsProductMixin.js
CHANGED
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
Product as ShopProduct,
|
|
26
26
|
EquinoxCartService
|
|
27
27
|
} from "@nuskin/ns-shop";
|
|
28
|
-
import { isEnabled } from "@nuskin/ns-feature-flags";
|
|
29
28
|
import QualificationService from "@nuskin/exclusive-offer-sdk";
|
|
30
29
|
import webLoyalty from "@nuskin/ns-loyalty-web";
|
|
31
30
|
import { getProp, getFullUrl } from "@nuskin/ns-common-lib";
|
|
@@ -489,20 +488,8 @@ const NsProductMixin = {
|
|
|
489
488
|
];
|
|
490
489
|
|
|
491
490
|
try {
|
|
492
|
-
const configs = await getConfiguration(["Mysite"]);
|
|
493
|
-
let useCSResources = false;
|
|
494
|
-
if (
|
|
495
|
-
configs &&
|
|
496
|
-
configs.Mysite &&
|
|
497
|
-
configs.Mysite.useCSResources &&
|
|
498
|
-
Array.isArray(configs.Mysite.useCSResources)
|
|
499
|
-
) {
|
|
500
|
-
useCSResources = configs.Mysite.useCSResources.includes(
|
|
501
|
-
this.runConfig.country
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
491
|
let loyalityStringsContent = {};
|
|
505
|
-
if (useCSResources
|
|
492
|
+
if (this.$NsProductAppService.useCSResources) {
|
|
506
493
|
loyalityStringsContent = await csStringService.getStrings(
|
|
507
494
|
commonStringKeys
|
|
508
495
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/product-components",
|
|
3
|
-
"version": "3.18.0-td-341.
|
|
3
|
+
"version": "3.18.0-td-341.2",
|
|
4
4
|
"description": "Nu Skin Product Components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@nuskin/ns-core-styles": "2.11.2",
|
|
30
30
|
"@nuskin/ns-icon": "^2.12.0",
|
|
31
31
|
"@nuskin/ns-loyalty-web": "1.5.6",
|
|
32
|
-
"@nuskin/ns-product-lib": "2.19.
|
|
33
|
-
"@nuskin/ns-shop": "7.
|
|
32
|
+
"@nuskin/ns-product-lib": "2.19.2",
|
|
33
|
+
"@nuskin/ns-shop": "7.1.3",
|
|
34
34
|
"@nuskin/product-recommendation": "2.0.1",
|
|
35
35
|
"axios": "1.6.7",
|
|
36
36
|
"lodash": "4.17.21",
|
|
@@ -37,7 +37,8 @@ if (!NsProductAppService) {
|
|
|
37
37
|
showWholeSalePricing: false,
|
|
38
38
|
loadingConfig: true,
|
|
39
39
|
translations: {},
|
|
40
|
-
loadingTranslations: true
|
|
40
|
+
loadingTranslations: true,
|
|
41
|
+
useCSResources: false
|
|
41
42
|
};
|
|
42
43
|
},
|
|
43
44
|
computed: {
|
|
@@ -180,21 +181,27 @@ if (!NsProductAppService) {
|
|
|
180
181
|
];
|
|
181
182
|
|
|
182
183
|
try {
|
|
183
|
-
const configs = await getConfiguration(["
|
|
184
|
+
const configs = await getConfiguration(["Mysite_Product_Offer"]);
|
|
185
|
+
let url = window.location.href;
|
|
186
|
+
let isStaticApp = url.match(/\/static\//) !== null;
|
|
184
187
|
let useCSResources = false;
|
|
185
188
|
if (
|
|
186
189
|
configs &&
|
|
187
|
-
configs.
|
|
188
|
-
configs.
|
|
189
|
-
Array.isArray(configs.
|
|
190
|
+
configs.Mysite_Product_Offer &&
|
|
191
|
+
configs.Mysite_Product_Offer.useCSResources &&
|
|
192
|
+
Array.isArray(configs.Mysite_Product_Offer.useCSResources)
|
|
190
193
|
) {
|
|
191
|
-
useCSResources = configs.
|
|
194
|
+
useCSResources = configs.Mysite_Product_Offer.useCSResources.includes(
|
|
192
195
|
this.runConfig.country
|
|
193
196
|
);
|
|
194
197
|
}
|
|
195
|
-
|
|
198
|
+
// For static apps by default use CS resources
|
|
199
|
+
// For AEM apps use CS resources only if the feature flag is enabled
|
|
200
|
+
this.useCSResources =
|
|
201
|
+
useCSResources &&
|
|
202
|
+
(isStaticApp || (!isStaticApp && isEnabled("td_341")));
|
|
196
203
|
let commonStrings = {};
|
|
197
|
-
if (useCSResources
|
|
204
|
+
if (this.useCSResources) {
|
|
198
205
|
commonStrings = await csStringService.getStrings(
|
|
199
206
|
commonStringKeys,
|
|
200
207
|
this.locale
|
|
@@ -94,14 +94,14 @@ function getProductGraphqlUrl() {
|
|
|
94
94
|
|
|
95
95
|
switch (env) {
|
|
96
96
|
case "dev":
|
|
97
|
-
return "https://
|
|
97
|
+
return "https://product.api.dev.nuskin.com/graphql";
|
|
98
98
|
case "stage":
|
|
99
99
|
case "test":
|
|
100
|
-
return "https://test.nuskin.com/
|
|
100
|
+
return "https://product.api.test.nuskin.com/graphql";
|
|
101
101
|
case "unknown":
|
|
102
102
|
case "prod":
|
|
103
103
|
default:
|
|
104
|
-
return "https://
|
|
104
|
+
return "https://product.api.nuskin.com/graphql";
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|