@nuskin/ns-product-lib 2.6.1-cx24-3607.2 → 2.6.1-cx24-3607.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.6.1-cx24-3607.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.3...v2.6.1-cx24-3607.4) (2023-03-16)
2
+
3
+
4
+ ### Fix
5
+
6
+ * The variant drop down label ([3e6b9f5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3e6b9f5e422b71c3e5f73d5a62f0491343ed7afb))
7
+
8
+ ## [2.6.1-cx24-3607.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.2...v2.6.1-cx24-3607.3) (2023-03-16)
9
+
10
+
11
+ ### Fix
12
+
13
+ * check for imageURL ([5d56bae](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/5d56baeb4c148cc667cc3c9321fb72e87216c921))
14
+
1
15
  ## [2.6.1-cx24-3607.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.1...v2.6.1-cx24-3607.2) (2023-03-16)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.6.1-cx24-3607.2",
3
+ "version": "2.6.1-cx24-3607.4",
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": {
@@ -129,15 +129,9 @@ const ProductData = {
129
129
  */
130
130
  eqProductVariantMapper: function (eqVariant) {
131
131
 
132
- let imageURL = eqVariant.properties.imageURL;
133
- const regex = /\d+\.\d+/
134
- let thumbnailImage = ''
132
+ let imageURL = eqVariant.properties.imageURL ? eqVariant.properties.imageURL : '';
133
+ let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
135
134
 
136
- if (imageURL.includes('contentstack')) {
137
- thumbnailImage = imageURL + '?width=40'
138
- } else {
139
- thumbnailImage = imageURL.replace(regex, '40.40')
140
- }
141
135
 
142
136
  const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
143
137
  const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
@@ -283,9 +277,9 @@ const ProductData = {
283
277
  "shade": "",
284
278
  "status": this.switchStatusFromEquinox(eqVariant.properties.status),
285
279
  "variantType": "Other",
286
- "variantDropdownLabel": eqVariant.properties.variantSelectLabel || "",
280
+ "variantDropdownLabel": eqVariant.properties.variantLabel || "",
287
281
  "variantDropdownPlaceholder": "Select Type",
288
- "variantsLabel": eqVariant.properties.variantSelectLabel || "",
282
+ "variantsLabel": eqVariant.properties.variantLabel || "",
289
283
  "groupOffer": false,
290
284
  "personalOffer": false,
291
285
  "savedEventName": eventName,
@@ -351,15 +345,9 @@ const ProductData = {
351
345
  for (const productData of productDataResponse) {
352
346
  try {
353
347
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
354
- let imageURL = product.properties.imageURL;
355
- const regex = /\d+\.\d+/
356
- let thumbnailImage = ''
357
-
358
- if (imageURL.includes('contentstack')) {
359
- thumbnailImage = imageURL + '?width=40'
360
- } else {
361
- thumbnailImage = imageURL.replace(regex, '40.40')
362
- }
348
+ let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
349
+ let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
350
+
363
351
 
364
352
  if (productData.sku && productData.sku.length > 1) {
365
353
  // exclude base product from variants