@nuskin/product-components 3.5.2-cx15-7285.4 → 3.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branches": [
3
- "master", {"name":"CX15-7285", "channel":"prerelease", "prerelease":"cx15-7285"}
3
+ "master"
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/npm",
package/CHANGELOG.md CHANGED
@@ -1,30 +1,16 @@
1
- ## [3.5.2-cx15-7285.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.2-cx15-7285.3...v3.5.2-cx15-7285.4) (2023-05-16)
1
+ ## [3.5.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.1...v3.5.2) (2023-05-18)
2
2
 
3
3
 
4
4
  ### Fix
5
5
 
6
- * Problem in the equinox config(#CX15-7285) ([e6e4812](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/e6e48123bb88ec2bbb05f5443e57d0bec6833d9f)), closes [#CX15-7285](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-7285)
6
+ * init listeners sooner. #CX16-9034 ([cd90336](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/cd903361112d0674f7d1621cc80c44e72c294509)), closes [#CX16-9034](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-9034)
7
7
 
8
- ## [3.5.2-cx15-7285.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.2-cx15-7285.2...v3.5.2-cx15-7285.3) (2023-05-15)
8
+ ## [3.5.2-cx16-9034.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.1...v3.5.2-cx16-9034.1) (2023-05-17)
9
9
 
10
10
 
11
11
  ### Fix
12
12
 
13
- * removing unneeded code (#CX15-7285) ([dc01f18](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/dc01f18cf66e953c0b2f0dbd589b5b2919017a14)), closes [#CX15-7285](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-7285)
14
-
15
- ## [3.5.2-cx15-7285.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.2-cx15-7285.1...v3.5.2-cx15-7285.2) (2023-05-12)
16
-
17
-
18
- ### Fix
19
-
20
- * remove console log (#CX15-7285) ([bec7cb5](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/bec7cb589f96df16ba82aa205b3d0d106a313d46)), closes [#CX15-7285](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-7285)
21
-
22
- ## [3.5.2-cx15-7285.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.1...v3.5.2-cx15-7285.1) (2023-05-12)
23
-
24
-
25
- ### Fix
26
-
27
- * Keep selector up to date (#CX15-7285) ([362da67](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/362da67e7d1fc024a59173ec6d0c2ef6c169b72b)), closes [#CX15-7285](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-7285)
13
+ * changed order of calls in mount() #CX16-9034 ([824c945](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/824c945e20e7884cc4f8ff10f1d07f6ddec4466c)), closes [#CX16-9034](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX16-9034)
28
14
 
29
15
  ## [3.5.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.5.0...v3.5.1) (2023-05-03)
30
16
 
@@ -355,8 +355,8 @@ const NsProductMixin = {
355
355
  }
356
356
  },
357
357
  async mounted() {
358
- await this.init();
359
358
  this.addListeners();
359
+ await this.init();
360
360
  },
361
361
  destroyed() {
362
362
  this.removeListeners();
@@ -722,47 +722,22 @@ const NsProductMixin = {
722
722
  ).getQualification(this.activeSku);
723
723
 
724
724
  let cartQuantity;
725
-
726
- if (
727
- (await getConfiguration(["Equinox_Markets"])).Equinox_Markets.active
728
- ) {
729
- let cartItems = await EquinoxCartService.getEquinoxCart();
730
- cartQuantity = cartItems.data.items.reduce((cq, item) => {
731
- const sku = item.skus.find(s => s.productId === this.activeSku);
732
- if (sku) {
733
- return cq + item.quantity;
734
- } else {
735
- return cq;
725
+ if (!this.baseSku) {
726
+ const cartItem = await CartService.getFirstItemBySku(
727
+ this.activeSku,
728
+ {
729
+ cartOrderItems: true
736
730
  }
737
- }, 0);
731
+ );
732
+ cartQuantity = (cartItem || {}).qty || 0;
738
733
  } else {
739
- if (!this.baseSku) {
740
- const cartItem = await CartService.getFirstItemBySku(
741
- this.activeSku,
742
- {
743
- cartOrderItems: true
744
- }
745
- );
746
- cartQuantity = (cartItem || {}).qty || 0;
747
- } else {
748
- const cartData =
749
- (await (
750
- await getQualificationService()
751
- ).convertCartDataToBaseSkus(CartService.getItemData(), true)) ||
752
- {};
753
- const cartItem = cartData[this.baseSku] || {};
754
- cartQuantity = cartItem.qty || 0;
755
- }
756
- }
757
-
758
- if (cartQuantity > 0) {
759
- this.maxQuantity =
760
- productQualification.quantity - cartQuantity > 0
761
- ? productQualification.quantity - cartQuantity
762
- : 0;
763
- }
764
- if (this.maxQuantity == 0) {
765
- this.disable();
734
+ const cartData =
735
+ (await (
736
+ await getQualificationService()
737
+ ).convertCartDataToBaseSkus(CartService.getItemData(), true)) ||
738
+ {};
739
+ const cartItem = cartData[this.baseSku] || {};
740
+ cartQuantity = cartItem.qty || 0;
766
741
  }
767
742
 
768
743
  if (!productQualification) {
@@ -1047,10 +1022,6 @@ const NsProductMixin = {
1047
1022
  qty: options.qty
1048
1023
  }
1049
1024
  };
1050
- this.maxQuantity =
1051
- this.maxQuantity - options.qty > 0
1052
- ? this.maxQuantity - options.qty
1053
- : 0;
1054
1025
 
1055
1026
  EquinoxCartService.addProductToEquinoxCart(options)
1056
1027
  .then(() => {
@@ -1060,7 +1031,6 @@ const NsProductMixin = {
1060
1031
  // TODO
1061
1032
  console.error(err);
1062
1033
  });
1063
- this.setStatus();
1064
1034
  })
1065
1035
  .catch(error => {
1066
1036
  console.log(`ProductDataService.getProductData: `, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.5.2-cx15-7285.4",
3
+ "version": "3.5.2",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {