@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 +1 -1
- package/CHANGELOG.md +4 -18
- package/mixins/NsProductMixin.js +15 -45
- package/package.json +1 -1
package/.releaserc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
## [3.5.2
|
|
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
|
-
*
|
|
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-
|
|
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
|
-
*
|
|
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
|
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -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
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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
|
-
|
|
731
|
+
);
|
|
732
|
+
cartQuantity = (cartItem || {}).qty || 0;
|
|
738
733
|
} else {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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);
|