@nuskin/ns-product-lib 2.6.1-cx24-337701.9 → 2.6.1-cx24-337701.10

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [2.6.1-cx24-337701.10](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-337701.9...v2.6.1-cx24-337701.10) (2023-03-20)
2
+
3
+
4
+ ### Fix
5
+
6
+ * The variant drop down label ([a93900f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a93900f43e880b52383ea22df8d496f97be21535))
7
+ * The variant drop down label ([20bc315](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/20bc315ba14213d5e18101c9016d3d07da14843a))
8
+ * The variant drop down label ([8bb8f1c](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8bb8f1c11626645d2cd4ca1a4db29f75b99dff7b))
9
+
1
10
  ## [2.6.1-cx24-337701.9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-337701.8...v2.6.1-cx24-337701.9) (2023-03-20)
2
11
 
3
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.6.1-cx24-337701.9",
3
+ "version": "2.6.1-cx24-337701.10",
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": {
@@ -356,6 +356,7 @@ const ProductData = {
356
356
 
357
357
  for (const productData of productDataResponse) {
358
358
  let variants = {};
359
+
359
360
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
360
361
  let imageURL = product.properties.imageURL;
361
362
  const regex = /\d+\.\d+/
@@ -367,13 +368,16 @@ const ProductData = {
367
368
  thumbnailImage = imageURL.replace(regex, '40.40')
368
369
  }
369
370
 
370
- if (product.sku && product.sku.length > 1) {
371
+ if (productData.sku && productData.sku.length > 1) {
371
372
  // exclude base product from variants
372
- product.sku.filter(v => v.identifier.substring(2, 4) !== "55").map(variant => {
373
+ productData.sku.filter(v => v.identifier.substring(2, 4) !== "55").map(variant => {
373
374
  variants[variant.identifier] = this.eqProductVariantMapper(variant);
374
375
  return variant;
375
376
  });
376
377
 
378
+ let defaultKey = productData.sku.map(e => e.default).indexOf(true)
379
+ if (defaultKey && productData.sku.length > 1)
380
+ variants = this.moveArray(Object.values(variants), defaultKey, 0);
377
381
  }
378
382
 
379
383