@nuskin/ns-product-lib 2.4.0-cx24-2467.2.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +49 -2
- package/package.json +1 -1
- package/src/product.js +6 -0
- package/src/productData.js +15 -13
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
-
# [2.4.0
|
1
|
+
# [2.4.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.3.0...v2.4.0) (2022-10-26)
|
2
2
|
|
3
3
|
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* To make multiple products work (#CX24-2444) ([ce4c483](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ce4c483b7fbb0527e60045d8174fd503a67e63fa)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
7
|
+
|
4
8
|
### New
|
5
9
|
|
6
|
-
*
|
10
|
+
* added support for inventory label (#CX24-2186) ([3e27481](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3e2748106cd6098086dbd6b738964deabacc875d)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
|
11
|
+
|
12
|
+
### Release
|
13
|
+
|
14
|
+
* Automated changes by GitLab pipeline [skip ci] ([8f75316](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8f75316b692ddccda5b7bea830ee6dc625b942c7))
|
15
|
+
* Automated changes by GitLab pipeline [skip ci] ([36dca5b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/36dca5b92285ae6d8ae96345256df92102efad8e))
|
16
|
+
|
17
|
+
### Update
|
18
|
+
|
19
|
+
* added support for variant and price (#CX24-2186) ([e0bf8f2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e0bf8f280a838dfa4cc613e5bc34d254dbdc8e1a)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
|
20
|
+
* added variant label (#CX24-2186) ([4c223b3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4c223b34438ed73cb824716cacb93482486f8195)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
|
7
21
|
|
8
22
|
# [2.3.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.2.0...v2.3.0) (2022-10-14)
|
9
23
|
|
@@ -41,6 +55,39 @@
|
|
41
55
|
|
42
56
|
* replace runConfig and marketConfig parameters of getProductData with locale and market (CX24-2382) ([b7b8ac7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b7b8ac7fa946df0b3690f700d00f5acfb0073bcf))
|
43
57
|
|
58
|
+
### Fix
|
59
|
+
|
60
|
+
* To make multiple products work (#CX24-2444) ([1cbe500](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1cbe5000d2649157de3bdb6456d601fdeecbd3b6)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
61
|
+
* To make multiple products work (#CX24-2444) ([b4c2218](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b4c221853dca33f2c0b06a06d6ead7fc50e9f0c6)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
62
|
+
|
63
|
+
### Release
|
64
|
+
|
65
|
+
* Automated changes by GitLab pipeline [skip ci] ([a974a24](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a974a244a85ee42eca3540b88429d16edcbf57ce))
|
66
|
+
* Automated changes by GitLab pipeline [skip ci] ([aa21d8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/aa21d8dcbed15a1c0798f882b4667bcc2bc071dc))
|
67
|
+
|
68
|
+
### Update
|
69
|
+
|
70
|
+
* updating the product data map (#CX24-2103) ([ea914a4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ea914a4079c2472adcd449fac09be85f22671493)), closes [#CX24-2103](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2103)
|
71
|
+
|
72
|
+
# [2.0.0-cx24-21035.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.0.0-cx24-21035.1...v2.0.0-cx24-21035.2) (2022-09-22)
|
73
|
+
|
74
|
+
|
75
|
+
### Fix
|
76
|
+
|
77
|
+
* To make multiple products work (#CX24-2444) ([1cbe500](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1cbe5000d2649157de3bdb6456d601fdeecbd3b6)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
78
|
+
* To make multiple products work (#CX24-2444) ([b4c2218](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b4c221853dca33f2c0b06a06d6ead7fc50e9f0c6)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
79
|
+
|
80
|
+
### Release
|
81
|
+
|
82
|
+
* Automated changes by GitLab pipeline [skip ci] ([aa21d8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/aa21d8dcbed15a1c0798f882b4667bcc2bc071dc))
|
83
|
+
|
84
|
+
### Update
|
85
|
+
|
86
|
+
* updating the product data map (#CX24-2103) ([ea914a4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ea914a4079c2472adcd449fac09be85f22671493)), closes [#CX24-2103](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2103)
|
87
|
+
|
88
|
+
# [2.0.0-cx24-21035.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.0.0-cx24-21035.1...v2.0.0-cx24-21035.2) (2022-09-22)
|
89
|
+
|
90
|
+
|
44
91
|
### Fix
|
45
92
|
|
46
93
|
* To make multiple products work (#CX24-2444) ([b4c2218](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b4c221853dca33f2c0b06a06d6ead7fc50e9f0c6)), closes [#CX24-2444](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2444)
|
package/package.json
CHANGED
package/src/product.js
CHANGED
@@ -72,6 +72,10 @@ const Product = function(productData) {
|
|
72
72
|
// agelocme stuff
|
73
73
|
this.agelocme = null; // object containing agelocme information (like code, label, name)
|
74
74
|
|
75
|
+
//equinox inventory / stock label
|
76
|
+
//@example "IN STOCK"
|
77
|
+
this.inventory = "";
|
78
|
+
|
75
79
|
this.setMarketAttributes = function(productStatus) {
|
76
80
|
if (productStatus.marketAttributes) {
|
77
81
|
this.marketAttributes = productStatus.marketAttributes;
|
@@ -518,6 +522,7 @@ const Product = function(productData) {
|
|
518
522
|
retData.marketAttributes = this.marketAttributes;
|
519
523
|
retData.restrictedMarkets = this.restrictedMarkets;
|
520
524
|
retData.addOns = this.addOns;
|
525
|
+
retData.inventory = this.inventory;
|
521
526
|
|
522
527
|
return retData;
|
523
528
|
};
|
@@ -626,6 +631,7 @@ const Product = function(productData) {
|
|
626
631
|
this.marketAttributes = productData.marketAttributes;
|
627
632
|
this.addOns = productData.addOns || [];
|
628
633
|
this.restrictedMarkets = productData.restrictedMarkets || [];
|
634
|
+
this.inventory = productData.inventory || "";
|
629
635
|
|
630
636
|
if (data.priceType) {
|
631
637
|
this.addPricing(data.priceType, data.price);
|
package/src/productData.js
CHANGED
@@ -140,7 +140,7 @@ const ProductData = {
|
|
140
140
|
}
|
141
141
|
],
|
142
142
|
"scanQualified": eqVariant.properties.scanQualifiedCount,
|
143
|
-
"availableQuantity":
|
143
|
+
"availableQuantity": eqVariant.inventoryProperties.atpQty,
|
144
144
|
"maxQuantity": 999,
|
145
145
|
"points": "",
|
146
146
|
"cv": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
|
@@ -152,9 +152,9 @@ const ProductData = {
|
|
152
152
|
"WADW-WRTL": eqVariant.priceFacets["Regular Price"],
|
153
153
|
"WADR": 9999.01,
|
154
154
|
"RTL": eqVariant.priceFacets["Regular Price"],
|
155
|
-
"WWHL":
|
155
|
+
"WWHL": eqVariant.priceFacets["Wholesale Price"],
|
156
156
|
"WADW": 9998.01,
|
157
|
-
"WHL":
|
157
|
+
"WHL": eqVariant.priceFacets["Wholesale Price"]
|
158
158
|
},
|
159
159
|
"cvMap": {
|
160
160
|
"WWHL": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
|
@@ -189,9 +189,9 @@ const ProductData = {
|
|
189
189
|
"shade": "",
|
190
190
|
"status": this.switchStatusFromEquinox(eqVariant.properties.status),
|
191
191
|
"variantType": "Other",
|
192
|
-
"variantDropdownLabel": "
|
192
|
+
"variantDropdownLabel": eqVariant.properties.variantLabel || "",
|
193
193
|
"variantDropdownPlaceholder": "Select Type",
|
194
|
-
"variantsLabel": "
|
194
|
+
"variantsLabel": eqVariant.properties.variantLabel || "",
|
195
195
|
"groupOffer": false,
|
196
196
|
"personalOffer": false,
|
197
197
|
"savedEventName": null,
|
@@ -214,7 +214,7 @@ const ProductData = {
|
|
214
214
|
eqProductMapper: function (productDataResponse) {
|
215
215
|
let prod = [];
|
216
216
|
let count = 0;
|
217
|
-
|
217
|
+
let variants = {};
|
218
218
|
|
219
219
|
let prodArr = productDataResponse.map((data) => {
|
220
220
|
let imageURL = data.sku[count].properties.imageURL;
|
@@ -262,11 +262,11 @@ const ProductData = {
|
|
262
262
|
"salesEventText": "",
|
263
263
|
"contentSection": [
|
264
264
|
{
|
265
|
-
"sectionContent": "<div class=\"contentSections\"
|
265
|
+
"sectionContent": "<div class=\"contentSections\"></div>\n"
|
266
266
|
}
|
267
267
|
],
|
268
268
|
"scanQualified": data.properties.scanQualifiedCount,
|
269
|
-
"availableQuantity":
|
269
|
+
"availableQuantity": data.sku[count].inventoryProperties.atpQty,
|
270
270
|
"maxQuantity": 999,
|
271
271
|
"points": "",
|
272
272
|
"cv": (data.sku[count].priceFacets.CV) ? data.sku[count].priceFacets.CV : '',
|
@@ -278,9 +278,9 @@ const ProductData = {
|
|
278
278
|
"WADW-WRTL": data.sku[count].priceFacets["Regular Price"],
|
279
279
|
"WADR": 9999.01,
|
280
280
|
"RTL": data.sku[count].priceFacets["Regular Price"],
|
281
|
-
"WWHL": data.sku[count].priceFacets["Regular Price"],
|
282
281
|
"WADW": 9998.01,
|
283
|
-
"WHL":
|
282
|
+
"WHL": data.sku[count].priceFacets["Wholesale Price"],
|
283
|
+
"WWHL": data.sku[count].priceFacets["Wholesale Price"]
|
284
284
|
},
|
285
285
|
"cvMap": {
|
286
286
|
"WWHL": (data.sku[count].priceFacets.CV) ? data.sku[count].priceFacets.CV : '',
|
@@ -317,9 +317,9 @@ const ProductData = {
|
|
317
317
|
"shade": "",
|
318
318
|
"status": this.switchStatusFromEquinox(data.sku[count].properties.productStatus),
|
319
319
|
"variantType": "Other",
|
320
|
-
"variantDropdownLabel": "
|
320
|
+
"variantDropdownLabel": data.sku[count].properties.variantLabel || "",
|
321
321
|
"variantDropdownPlaceholder": "Select Type",
|
322
|
-
"variantsLabel": "
|
322
|
+
"variantsLabel": data.sku[count].properties.variantLabel || "",
|
323
323
|
"groupOffer": false,
|
324
324
|
"personalOffer": false,
|
325
325
|
"savedEventName": null,
|
@@ -336,7 +336,9 @@ const ProductData = {
|
|
336
336
|
"earn": true
|
337
337
|
},
|
338
338
|
"restrictedMarkets": [],
|
339
|
-
"addOns": []
|
339
|
+
"addOns": [],
|
340
|
+
"inventory": data.sku[count].inventory || "" //inventory label
|
341
|
+
|
340
342
|
};
|
341
343
|
let newProduct = new Product(prod);
|
342
344
|
return newProduct
|