@nuskin/ns-product-lib 2.6.2-cx24-3563.2 → 2.6.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/CHANGELOG.md +11 -5
- package/package.json +2 -2
- package/src/equinox-helpers/availableQuantity.js +2 -2
- package/src/product.js +0 -6
- package/src/productData.js +2 -4
package/CHANGELOG.md
CHANGED
@@ -1,17 +1,23 @@
|
|
1
|
-
## [2.6.2
|
1
|
+
## [2.6.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.6.2) (2023-03-24)
|
2
2
|
|
3
3
|
|
4
4
|
### Fix
|
5
5
|
|
6
|
-
*
|
7
|
-
* Discounted PV CV are not displayed in MySite admin and home pages ([b1684da](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b1684dada7851f910548e29ec1e2463cca55c738))
|
6
|
+
* Fix drop down variants Cx24 3377 ([262328e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/262328e617b87d6dbf44b1393fdffaa10d8de13d))
|
8
7
|
|
9
|
-
|
8
|
+
# [2.7.0-cx24-337703.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.2-cx24-337703.1...v2.7.0-cx24-337703.1) (2023-03-22)
|
9
|
+
|
10
|
+
|
11
|
+
### Update
|
12
|
+
|
13
|
+
* Merge CX24-3563 changes to CX24-337703 ([9e6ca40](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9e6ca40c35252c24394351275a234e9847f70bfc))
|
14
|
+
|
15
|
+
## [2.6.2-cx24-337703.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.6.2-cx24-337703.1) (2023-03-22)
|
10
16
|
|
11
17
|
|
12
18
|
### Fix
|
13
19
|
|
14
|
-
*
|
20
|
+
* Show dropdown for variants ([85cdf69](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/85cdf69cc2bbf6700ec5c9bcacc7222cf2ddf674))
|
15
21
|
|
16
22
|
## [2.6.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1) (2023-03-16)
|
17
23
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.6.2
|
3
|
+
"version": "2.6.2",
|
4
4
|
"description": "This project contains shared Product models and code between the backend and frontend.",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"scripts": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"dependencies": {
|
34
34
|
"@nuskin/configuration-sdk": "2.2.3",
|
35
35
|
"@nuskin/ns-common-lib": "1.4.5",
|
36
|
-
"@nuskin/ns-util": "4.2.
|
36
|
+
"@nuskin/ns-util": "4.2.7",
|
37
37
|
"axios": "0.27.2",
|
38
38
|
"qs": "6.11.0"
|
39
39
|
},
|
@@ -8,8 +8,8 @@ function availableQuantity(product) {
|
|
8
8
|
return product.inventoryProperties.atpQty;
|
9
9
|
}
|
10
10
|
|
11
|
-
if (product.
|
12
|
-
const quantities = product.
|
11
|
+
if (product.childSkus && product.childSkus.length > 0) {
|
12
|
+
const quantities = product.childSkus
|
13
13
|
.filter(cs => cs.inventory !== undefined)
|
14
14
|
.map(cs => cs.inventory.atpQty);
|
15
15
|
|
package/src/product.js
CHANGED
@@ -76,7 +76,6 @@ const Product = function(productData) {
|
|
76
76
|
//@example "IN STOCK"
|
77
77
|
this.inventory = "";
|
78
78
|
this.equinoxProductId = "";
|
79
|
-
this.equinoxChildSkus = [];
|
80
79
|
|
81
80
|
this.setMarketAttributes = function(productStatus) {
|
82
81
|
if (productStatus.marketAttributes) {
|
@@ -505,7 +504,6 @@ const Product = function(productData) {
|
|
505
504
|
retData.pvMap = this.pvMap;
|
506
505
|
retData.orderTypes = this.orderTypes;
|
507
506
|
retData.childSkus = this.childSkus;
|
508
|
-
retData.equinoxChildSkus = this.equinoxChildSkus;
|
509
507
|
retData.custTypes = this.custTypes;
|
510
508
|
retData.division = this.division;
|
511
509
|
retData.backOrderDate = this.backOrderDate;
|
@@ -677,10 +675,6 @@ const Product = function(productData) {
|
|
677
675
|
}
|
678
676
|
|
679
677
|
this.equinoxProductId = data.equinoxProductId;
|
680
|
-
|
681
|
-
if(data.equinoxChildSkus) {
|
682
|
-
this.equinoxChildSkus = data.equinoxChildSkus;
|
683
|
-
}
|
684
678
|
}
|
685
679
|
};
|
686
680
|
|
package/src/productData.js
CHANGED
@@ -66,7 +66,6 @@ const ProductData = {
|
|
66
66
|
}
|
67
67
|
|
68
68
|
const filter = skuFilter.join(" OR ")
|
69
|
-
//axios.defaults.withCredentials = true;
|
70
69
|
|
71
70
|
const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
|
72
71
|
const href = `${url}?filter='\\\\''${encodeURI(filter)}'\\''`;
|
@@ -353,11 +352,11 @@ const ProductData = {
|
|
353
352
|
|
354
353
|
eqProductMapper: async function (productDataResponse, skus) {
|
355
354
|
let count = 0;
|
356
|
-
let variants = {};
|
357
355
|
const products = [];
|
358
356
|
|
359
357
|
for (const productData of productDataResponse) {
|
360
358
|
try {
|
359
|
+
let variants = {};
|
361
360
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
362
361
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
363
362
|
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
@@ -384,7 +383,7 @@ const ProductData = {
|
|
384
383
|
const productCVPrice = eventName ? CVPrice : product.priceFacets.CV;
|
385
384
|
const productPVPrice = eventName ? PVPrice : product.priceFacets.PV;
|
386
385
|
|
387
|
-
product.
|
386
|
+
product.childSkus = await this.fetchChildSkus(product);
|
388
387
|
product.availableQuantity = mapAvailableQuantity(product);
|
389
388
|
product = {
|
390
389
|
...product,
|
@@ -445,7 +444,6 @@ const ProductData = {
|
|
445
444
|
"WHL": productPVPrice
|
446
445
|
},
|
447
446
|
"orderTypes": this._setOrderType(product.properties),
|
448
|
-
"childSkus": [],
|
449
447
|
"custTypes": this.switchCustType(product.properties.customerTypes),
|
450
448
|
"division": productData.properties.division,
|
451
449
|
"backOrderDate": null,
|