@nuskin/product-components 3.3.7-cx16-8633.3 → 3.3.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branches": [
3
- "master", {"name":"CX16-8633", "channel":"prerelease", "prerelease":"cx16-8633"}
3
+ "master"
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/npm",
package/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
+ ## [3.3.8](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.7...v3.3.8) (2023-04-06)
2
+
3
+
4
+ ### Fix
5
+
6
+ * added waitForConfig in NsPrductMixin #CX16-8633 ([53813b0](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/53813b05400128f0de8e350cd545345684dc8917)), closes [#CX16-8633](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8633)
7
+
1
8
  ## [3.3.7-cx16-8633.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.7-cx16-8633.2...v3.3.7-cx16-8633.3) (2023-04-05)
9
+ ## [3.3.7](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.6...v3.3.7) (2023-04-05)
2
10
 
3
11
 
4
12
  ### Fix
@@ -6,6 +14,9 @@
6
14
  * added wait in NsProductMixin #CX16-8633 ([b802a9b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/b802a9b188ef90c4e5568e47031f41ab5ca67efa)), closes [#CX16-8633](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8633)
7
15
 
8
16
  ## [3.3.7-cx16-8633.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.7-cx16-8633.1...v3.3.7-cx16-8633.2) (2023-04-04)
17
+ * CX24 Batch 2 Fixes ([5eaec1e](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/5eaec1e9bb7c7d7979f4da14dcf3732a43c3ed2c))
18
+
19
+ # [3.4.0-cx24-3706.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.4.0-cx24-3706.3...v3.4.0-cx24-3706.4) (2023-04-04)
9
20
 
10
21
 
11
22
  ### Fix
@@ -14,11 +25,107 @@
14
25
  * trying wait in different place #CX16-8633 ([4c9eb00](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/4c9eb00b16974e5ac93104a1ca30db4503d08e36)), closes [#CX16-8633](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8633)
15
26
 
16
27
  ## [3.3.7-cx16-8633.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.6...v3.3.7-cx16-8633.1) (2023-04-03)
28
+ * Add to Bag in product offer ([3212ce0](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/3212ce049979b7f2f3c26c5e64ef8a98eb669e9b))
29
+
30
+ # [3.4.0-cx24-3706.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.4.0-cx24-3706.2...v3.4.0-cx24-3706.3) (2023-04-04)
17
31
 
18
32
 
19
33
  ### Fix
20
34
 
21
35
  * unit tests and wait in NsProductMixin #CX16-8633 ([868234a](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/868234a9cf5803efc389a966274ba66a5be87b4d)), closes [#CX16-8633](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-8633)
36
+ * Add to Bag in product offer ([b6fb956](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/b6fb9561044911f58ac680e497a74661c5c14894))
37
+
38
+ # [3.4.0-cx24-3706.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.4.0-cx24-3706.1...v3.4.0-cx24-3706.2) (2023-04-03)
39
+
40
+
41
+ ### Fix
42
+
43
+ * Add to cart only getting first variant ([8e1aed7](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/8e1aed790edd5874c90678985f7a5df70cce951c))
44
+ * Add to cart only getting first variant ([6783f95](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/6783f95a957973de6be6d8b03c1fc4aefd833b8d))
45
+ * Add to cart only getting first variant ([408848e](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/408848eec01b1a2fdc462fb05f0b01af64b1f4ff))
46
+ * Add to cart only getting first variant ([718cf0b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/718cf0b3cc6f3c565fc7e7a65ab19b4b1800ed59))
47
+ * Add to cart only getting first variant ([f29ce7c](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/f29ce7c3667992a7d53586aa868e3293ced34d24))
48
+ * Add to cart only getting first variant ([b85028e](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/b85028eb2e1c63b6bf6789c70788b2f9c8345740))
49
+ * Add to cart only getting first variant ([f170ed4](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/f170ed4d8435493dde2600eede269679b7bd161b))
50
+ * Add to cart only getting first variant ([8c9c742](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/8c9c7424302c58de1ed64c470ee8c7274ed0b90d))
51
+
52
+ ### Release
53
+
54
+ * Automated changes by GitLab pipeline [skip ci] ([8a64e86](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/8a64e869d499e316029cf14b1249a38eebad50b6))
55
+ * Automated changes by GitLab pipeline [skip ci] ([98f99a7](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/98f99a76a56103cbf5da646af672ae5e5595234e))
56
+ * Automated changes by GitLab pipeline [skip ci] ([041ae4a](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/041ae4ad5d64b36d8c93a6addc4561fd89ce3c11))
57
+ * Automated changes by GitLab pipeline [skip ci] ([0bbb3e5](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/0bbb3e5d8f13aa6edd1b412e4ddd80e9f9cf1215))
58
+ * Automated changes by GitLab pipeline [skip ci] ([2bb503b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/2bb503b83005d3ce9d875d7bdb0853916a3bf821))
59
+ * Automated changes by GitLab pipeline [skip ci] ([b39ba6f](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/b39ba6f6a0ebe36552838467b6d1ec199a64b77c))
60
+ * Automated changes by GitLab pipeline [skip ci] ([e52fd76](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/e52fd760e31424807f48c2622749f506aeb67173))
61
+ * Automated changes by GitLab pipeline [skip ci] ([f7be37d](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/f7be37d15bc0fdd5ee0e8eb205255cecfb807347))
62
+
63
+ ### Update
64
+
65
+ * Merge CX24-3702 changes ([c49a7c4](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/c49a7c4de483e4aab77b0c148ec03e69f4bbf329))
66
+
67
+ ## [3.3.5-cx24-3702.8](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.7...v3.3.5-cx24-3702.8) (2023-03-29)
68
+
69
+
70
+ ### Fix
71
+
72
+ * Add to cart only getting first variant ([8e1aed7](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/8e1aed790edd5874c90678985f7a5df70cce951c))
73
+
74
+ ## [3.3.5-cx24-3702.7](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.6...v3.3.5-cx24-3702.7) (2023-03-29)
75
+
76
+
77
+ ### Fix
78
+
79
+ * Add to cart only getting first variant ([6783f95](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/6783f95a957973de6be6d8b03c1fc4aefd833b8d))
80
+
81
+ ## [3.3.5-cx24-3702.6](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.5...v3.3.5-cx24-3702.6) (2023-03-29)
82
+
83
+
84
+ ### Fix
85
+
86
+ * Add to cart only getting first variant ([408848e](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/408848eec01b1a2fdc462fb05f0b01af64b1f4ff))
87
+
88
+ ## [3.3.5-cx24-3702.5](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.4...v3.3.5-cx24-3702.5) (2023-03-29)
89
+
90
+
91
+ ### Fix
92
+
93
+ * Add to cart only getting first variant ([718cf0b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/718cf0b3cc6f3c565fc7e7a65ab19b4b1800ed59))
94
+
95
+ ## [3.3.5-cx24-3702.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.3...v3.3.5-cx24-3702.4) (2023-03-29)
96
+
97
+
98
+ ### Fix
99
+
100
+ * Add to cart only getting first variant ([f29ce7c](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/f29ce7c3667992a7d53586aa868e3293ced34d24))
101
+
102
+ ## [3.3.5-cx24-3702.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.2...v3.3.5-cx24-3702.3) (2023-03-29)
103
+
104
+
105
+ ### Fix
106
+
107
+ * Add to cart only getting first variant ([b85028e](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/b85028eb2e1c63b6bf6789c70788b2f9c8345740))
108
+
109
+ ## [3.3.5-cx24-3702.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5-cx24-3702.1...v3.3.5-cx24-3702.2) (2023-03-25)
110
+
111
+
112
+ ### Fix
113
+
114
+ * Add to cart only getting first variant ([f170ed4](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/f170ed4d8435493dde2600eede269679b7bd161b))
115
+
116
+ ## [3.3.5-cx24-3702.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.4...v3.3.5-cx24-3702.1) (2023-03-25)
117
+
118
+
119
+ ### Fix
120
+
121
+ * Add to cart only getting first variant ([8c9c742](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/8c9c7424302c58de1ed64c470ee8c7274ed0b90d))
122
+
123
+ # [3.4.0-cx24-3706.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.6...v3.4.0-cx24-3706.1) (2023-04-01)
124
+
125
+
126
+ ### Update
127
+
128
+ * added active check to equinox flags ([43c6770](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/43c6770d9080db3de15db197016b3335550c94f3))
22
129
 
23
130
  ## [3.3.6](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.5...v3.3.6) (2023-03-31)
24
131
 
@@ -27,7 +27,6 @@ import { PriceType } from "@nuskin/ns-product-lib";
27
27
  import { ProductDataService } from "@nuskin/ns-product";
28
28
  import { waitForConfig } from "../services/configHelper";
29
29
 
30
- //const PRODUCT_SMALL_VARIANT = "product-card.selected-variant";
31
30
  const PENDING_FAVORITE = "pendingFavorite";
32
31
  const KEY_BREADCRUMB_BACK = "breadcrumbBack";
33
32
 
@@ -741,13 +740,18 @@ const NsProductMixin = {
741
740
  * Sets sales event pricing if there is an active event for this sku, or normal pricing if not
742
741
  */
743
742
  setProductPricing() {
744
- this.product.setPriceAndPvFromType(
745
- this.getPriceType(),
746
- this.activeSalesEvents,
747
- {
748
- isEqPromotion: equinoxLocalStorage.isEquinoxEnabled()
749
- }
750
- );
743
+ const mixin = this;
744
+ getConfiguration(["Equinox_Markets"]).then(config => {
745
+ mixin.product.setPriceAndPvFromType(
746
+ mixin.getPriceType(),
747
+ mixin.activeSalesEvents,
748
+ {
749
+ isEqPromotion:
750
+ equinoxLocalStorage.isEquinoxEnabled() &&
751
+ config.Equinox_Markets.active
752
+ }
753
+ );
754
+ });
751
755
 
752
756
  // set adr price
753
757
  this.adrPriceType = this.isWholesale
@@ -944,11 +948,20 @@ const NsProductMixin = {
944
948
  const countryCode = config.Equinox_Markets.country_code;
945
949
  if (
946
950
  countryCode === country &&
947
- equinoxLocalStorage.isEquinoxEnabled()
951
+ equinoxLocalStorage.isEquinoxEnabled() &&
952
+ config.Equinox_Markets.active
948
953
  ) {
949
954
  ProductDataService.getProductData(options.sku)
950
955
  .then(productData => {
951
- options.product = new ShopProduct(productData.products[0]);
956
+ let productToAdd = productData.products[0];
957
+ const productIdentifier =
958
+ productData.products[0].equinoxProductId;
959
+ if (Object.keys(productToAdd.variants).length > 1) {
960
+ productToAdd = productData.products[0].variants[options.sku];
961
+ productToAdd.equinoxProductId = productIdentifier;
962
+ //productToAdd.properties = productData.products[0].properties
963
+ }
964
+ options.product = new ShopProduct(productToAdd);
952
965
  options.add = {
953
966
  item: {
954
967
  qty: options.qty
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.3.7-cx16-8633.3",
3
+ "version": "3.3.8",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 { getConfiguration } from "@nuskin/configuration-sdk";
12
13
 
13
14
  class ProductDataBatch {
14
15
  constructor(id, skus) {
@@ -263,6 +264,10 @@ if (!NsProductDataService) {
263
264
  return;
264
265
  }
265
266
 
267
+ const equinoxMarketConfig = (
268
+ await getConfiguration(["Equinox_Markets"])
269
+ ).Equinox_Markets;
270
+
266
271
  // product data response has products
267
272
  if (productData.count && productData.products.length) {
268
273
  const productsToSaveToSession = [];
@@ -270,7 +275,9 @@ if (!NsProductDataService) {
270
275
  // do a last quick check to make sure we don't add duplicate products
271
276
  if (!this.findProduct(product.sku)) {
272
277
  product.setPriceAndPvFromType(this.getPriceType(), null, {
273
- isEqPromotion: equinoxLocalStorage.isEquinoxEnabled()
278
+ isEqPromotion:
279
+ equinoxLocalStorage.isEquinoxEnabled() &&
280
+ equinoxMarketConfig.active
274
281
  });
275
282
  this.products.push(product);
276
283
  this.$emit("product-changed", product);
@@ -285,14 +292,18 @@ if (!NsProductDataService) {
285
292
  * Updates product pricing
286
293
  */
287
294
  updateProductPricing() {
288
- for (const product of this.products) {
289
- product.setPriceAndPvFromType(
290
- this.getPriceType(),
291
- null,
292
- equinoxLocalStorage.isEquinoxEnabled()
293
- );
294
- this.$emit("product-changed", product);
295
- }
295
+ const service = this;
296
+ getConfiguration(["Equinox_Markets"]).then(config => {
297
+ for (const product of service.products) {
298
+ product.setPriceAndPvFromType(
299
+ service.getPriceType(),
300
+ null,
301
+ equinoxLocalStorage.isEquinoxEnabled() &&
302
+ config.Equinox_Markets.active
303
+ );
304
+ service.$emit("product-changed", product);
305
+ }
306
+ });
296
307
  },
297
308
 
298
309
  /**
@@ -356,28 +367,38 @@ if (!NsProductDataService) {
356
367
  */
357
368
  handleProductStatus(productStatusResults) {
358
369
  const productsToSaveToSession = [];
359
- for (const productStatus of productStatusResults) {
360
- const product = this.findProduct(productStatus.SKU);
361
- if (product) {
362
- if (product.isBase() && productStatus.SKU !== product.sku) {
363
- const variant = product.getVariant(productStatus.SKU);
364
- if (variant) {
365
- variant.availableQuantity = productStatus.availableQuantity;
366
- variant.setMarketAttributes(productStatus);
370
+ const service = this;
371
+
372
+ getConfiguration(["Equinox_Markets"]).then(config => {
373
+ for (const productStatus of productStatusResults) {
374
+ const product = service.findProduct(productStatus.SKU);
375
+ if (product) {
376
+ if (product.isBase() && productStatus.SKU !== product.sku) {
377
+ const variant = product.getVariant(productStatus.SKU);
378
+ if (variant) {
379
+ variant.availableQuantity = productStatus.availableQuantity;
380
+ variant.setMarketAttributes(productStatus);
381
+ }
382
+ } else {
383
+ product.availableQuantity = productStatus.availableQuantity;
384
+ product.setMarketAttributes(productStatus);
367
385
  }
368
- } else {
369
- product.availableQuantity = productStatus.availableQuantity;
370
- product.setMarketAttributes(productStatus);
371
- }
372
386
 
373
- product.addPricingFromStatus(productStatus, this.getPriceType(), {
374
- isEqPromotion: equinoxLocalStorage.isEquinoxEnabled()
375
- });
376
- this.$emit("product-changed", product);
377
- productsToSaveToSession.push(product);
387
+ product.addPricingFromStatus(
388
+ productStatus,
389
+ service.getPriceType(),
390
+ {
391
+ isEqPromotion:
392
+ equinoxLocalStorage.isEquinoxEnabled() &&
393
+ config.Equinox_Markets.active
394
+ }
395
+ );
396
+ service.$emit("product-changed", product);
397
+ productsToSaveToSession.push(product);
398
+ }
378
399
  }
379
- }
380
- this.saveProductsToSession(productsToSaveToSession);
400
+ service.saveProductsToSession(productsToSaveToSession);
401
+ });
381
402
  },
382
403
 
383
404
  /**