@nuskin/product-components 3.3.4 → 3.3.5-cx16-8616.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/.releaserc +1 -1
- package/CHANGELOG.md +26 -0
- package/mixins/NsProductMixin.js +2 -21
- package/package.json +1 -1
- package/services/NsProductAppService.js +2 -0
- package/services/NsProductDataService.js +2 -0
- package/services/configHelper.js +31 -0
package/.releaserc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## [3.3.5-cx16-8616.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx16-8616.1...v3.3.5-cx16-8616.2) (2023-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Fix
|
|
5
|
+
|
|
6
|
+
* added comment for new prerelease #CX16-8616 ([eede258](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/eede258b1c40b5ad357ac6a0fc8fb756d2180f4e)), closes [#CX16-8616](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8616)
|
|
7
|
+
|
|
8
|
+
## [3.3.5-cx16-8616.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.4...v3.3.5-cx16-8616.1) (2023-03-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Fix
|
|
12
|
+
|
|
13
|
+
* comment #CX16-8616 ([166d464](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/166d464f24c4d121e1e2e39fe23d7bd44a22cfaf)), closes [#CX16-8616](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8616)
|
|
14
|
+
* wait for config. #CX16-8616 ([c6c4147](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/c6c4147612aa54a5815b6614c06f2bffdd77d448)), closes [#CX16-8616](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8616)
|
|
15
|
+
|
|
16
|
+
### Release
|
|
17
|
+
|
|
18
|
+
* Automated changes by GitLab pipeline [skip ci] ([2355bd7](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/2355bd73c1cf7c2a8110f85d72bebdb66a286cfc))
|
|
19
|
+
|
|
20
|
+
## [3.3.5-cx16-8616.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.4...v3.3.5-cx16-8616.1) (2023-03-25)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Fix
|
|
24
|
+
|
|
25
|
+
* wait for config. #CX16-8616 ([c6c4147](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/c6c4147612aa54a5815b6614c06f2bffdd77d448)), closes [#CX16-8616](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8616)
|
|
26
|
+
|
|
1
27
|
## [3.3.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.3...v3.3.4) (2023-03-24)
|
|
2
28
|
|
|
3
29
|
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -25,24 +25,12 @@ import webLoyalty from "@nuskin/ns-loyalty-web";
|
|
|
25
25
|
import { getProp, getFullUrl } from "@nuskin/ns-common-lib";
|
|
26
26
|
import { PriceType } from "@nuskin/ns-product-lib";
|
|
27
27
|
import { ProductDataService } from "@nuskin/ns-product";
|
|
28
|
+
import { waitForConfig } from "../services/configHelper";
|
|
28
29
|
|
|
29
30
|
//const PRODUCT_SMALL_VARIANT = "product-card.selected-variant";
|
|
30
31
|
const PENDING_FAVORITE = "pendingFavorite";
|
|
31
32
|
const KEY_BREADCRUMB_BACK = "breadcrumbBack";
|
|
32
33
|
|
|
33
|
-
const configMapsToLoad = [
|
|
34
|
-
"Url",
|
|
35
|
-
"Basic",
|
|
36
|
-
"Shopping",
|
|
37
|
-
"ADP",
|
|
38
|
-
"Cart",
|
|
39
|
-
"Loyalty",
|
|
40
|
-
"Checkout"
|
|
41
|
-
];
|
|
42
|
-
getConfiguration(configMapsToLoad).then(() =>
|
|
43
|
-
console.log("ns-shop config loaded")
|
|
44
|
-
);
|
|
45
|
-
|
|
46
34
|
/**
|
|
47
35
|
* NsProductMixin
|
|
48
36
|
*
|
|
@@ -337,14 +325,7 @@ const NsProductMixin = {
|
|
|
337
325
|
}
|
|
338
326
|
},
|
|
339
327
|
async mounted() {
|
|
340
|
-
await
|
|
341
|
-
"Cart",
|
|
342
|
-
"Basic",
|
|
343
|
-
"Url",
|
|
344
|
-
"Shopping",
|
|
345
|
-
"ADP",
|
|
346
|
-
"Equinox_Markets"
|
|
347
|
-
]);
|
|
328
|
+
await waitForConfig();
|
|
348
329
|
await this.init();
|
|
349
330
|
this.addListeners();
|
|
350
331
|
},
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
|
|
3
|
+
import { waitForConfig } from "./configHelper";
|
|
3
4
|
import {
|
|
4
5
|
RunConfigService,
|
|
5
6
|
ConfigService,
|
|
@@ -44,6 +45,7 @@ if (!NsProductAppService) {
|
|
|
44
45
|
},
|
|
45
46
|
async mounted() {
|
|
46
47
|
await this.setConfig();
|
|
48
|
+
await waitForConfig();
|
|
47
49
|
|
|
48
50
|
this.runConfigInterval = setInterval(async () => {
|
|
49
51
|
if (this.runConfigTries <= 0) {
|
|
@@ -9,6 +9,7 @@ import { isNullOrEmpty } from "@nuskin/ns-common-lib";
|
|
|
9
9
|
import { ProductDataService } from "@nuskin/ns-product";
|
|
10
10
|
import { Product, PriceType } from "@nuskin/ns-product-lib";
|
|
11
11
|
import { equinoxLocalStorage } from "@nuskin/ns-util";
|
|
12
|
+
import { waitForConfig } from "./configHelper";
|
|
12
13
|
|
|
13
14
|
class ProductDataBatch {
|
|
14
15
|
constructor(id, skus) {
|
|
@@ -116,6 +117,7 @@ if (!NsProductDataService) {
|
|
|
116
117
|
}
|
|
117
118
|
},
|
|
118
119
|
async mounted() {
|
|
120
|
+
await waitForConfig();
|
|
119
121
|
this.addListeners();
|
|
120
122
|
this.setProductDataFromSession();
|
|
121
123
|
},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { events } from "@nuskin/ns-util";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helper to wait for certain config maps to be loaded that are used
|
|
5
|
+
* in dependent nuskin packages.
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise}
|
|
8
|
+
*/
|
|
9
|
+
const waitForConfig = async () => {
|
|
10
|
+
const promise = new Promise(resolve => {
|
|
11
|
+
// Wait for this maps to be loaded.
|
|
12
|
+
const neededMaps = ["Url", "Basic", "Shopping", "ADP", "Cart", "Loyalty", "Checkout"]; // eslint-disable-line
|
|
13
|
+
|
|
14
|
+
const isSubset = (array1, array2) => {
|
|
15
|
+
return array2.every(element => array1.includes(element));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const configCallback = configs => {
|
|
19
|
+
if (configs && isSubset(configs, neededMaps)) {
|
|
20
|
+
events.unsubscribe(events.global.CS_CONFIG_SET, configCallback);
|
|
21
|
+
resolve();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
events.getValue(events.global.CS_CONFIG_SET, configCallback, true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return promise;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { waitForConfig };
|