@nuskin/product-components 3.4.0 → 3.5.0
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/CHANGELOG.md +7 -0
- package/mixins/NsProductMixin.js +21 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.5.0](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.4.0...v3.5.0) (2023-05-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### New
|
|
5
|
+
|
|
6
|
+
* added a feature flag to allow us to turn on the new exclusive offer api for testing (#CX15-7412) ([73da3e8](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/73da3e857e99f0a8d1a1671e922de6efc9b14f38)), closes [#CX15-7412](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-7412)
|
|
7
|
+
|
|
1
8
|
# [3.4.0](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.11...v3.4.0) (2023-05-02)
|
|
2
9
|
|
|
3
10
|
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
EquinoxCartService
|
|
26
26
|
} from "@nuskin/ns-shop";
|
|
27
27
|
import { default as NewQualificationService } from "@nuskin/exclusive-offer-sdk";
|
|
28
|
+
import { retrieveTogglesBasedOnEnvironment } from "@nuskin/ns-feature-flags";
|
|
28
29
|
import webLoyalty from "@nuskin/ns-loyalty-web";
|
|
29
30
|
import { getProp, getFullUrl } from "@nuskin/ns-common-lib";
|
|
30
31
|
import { PriceType } from "@nuskin/ns-product-lib";
|
|
@@ -34,29 +35,29 @@ import { waitForConfig } from "../services/configHelper";
|
|
|
34
35
|
const PENDING_FAVORITE = "pendingFavorite";
|
|
35
36
|
const KEY_BREADCRUMB_BACK = "breadcrumbBack";
|
|
36
37
|
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
let flagsPromise = null;
|
|
39
|
+
let featureFlags = false;
|
|
40
|
+
const checkFlag = async flag => {
|
|
41
|
+
if (!featureFlags && !flagsPromise) {
|
|
42
|
+
flagsPromise = retrieveTogglesBasedOnEnvironment().then(
|
|
43
|
+
flagsFromServer => (featureFlags = flagsFromServer)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!featureFlags) {
|
|
48
|
+
await flagsPromise;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return featureFlags.has(flag);
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
const getQualificationService = async () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return OldQualificationService;
|
|
55
|
+
const equinoxMarket = (await getConfiguration(["Equinox_Markets"]))
|
|
56
|
+
.Equinox_Markets;
|
|
57
|
+
return equinoxMarket.active ||
|
|
58
|
+
(await checkFlag("cx15_use_new_exclusive_offer_api"))
|
|
59
|
+
? NewQualificationService
|
|
60
|
+
: OldQualificationService;
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
/**
|