@nuskin/ns-product-lib 2.7.0-cx24-3682.18 → 2.7.0-cx24-3682.20

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.7.0-cx24-3682.20](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.19...v2.7.0-cx24-3682.20) (2023-03-28)
2
+
3
+
4
+ ### New
5
+
6
+ * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([d008a2e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d008a2e625131f66f7f2ea5ed428c0ec4cb28e8b)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
7
+
8
+ # [2.7.0-cx24-3682.19](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.18...v2.7.0-cx24-3682.19) (2023-03-28)
9
+
10
+
11
+ ### New
12
+
13
+ * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([3adb17f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3adb17f779126224b3d1264738b128bbbd1428aa)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
14
+
1
15
  # [2.7.0-cx24-3682.18](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.17...v2.7.0-cx24-3682.18) (2023-03-28)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.0-cx24-3682.18",
3
+ "version": "2.7.0-cx24-3682.20",
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": {
@@ -9,21 +9,24 @@ const { mapIdentifier, mapProperties, mapVariant } = require('../mappers');
9
9
  function productNotFound(product, market) {
10
10
  /** @type {import('../').EquinoxNormalProduct} */
11
11
  const model = {};
12
- model.identifier = mapIdentifier(product.identifier.slice(1));
12
+ model.identifier = mapIdentifier(` ${product.identifier}`);
13
13
  model.properties = mapProperties();
14
14
  model.sku = [mapVariant({
15
- identifier: product.identifier.slice(1),
15
+ // adding a whitespace allows us to display an SKU with 55
16
+ // without initializing the variant selector of ns-product-small
17
+ identifier: ` ${product.identifier}`,
16
18
  properties: {
17
19
  availableChannels: 'subscription,arsPhone,kiosk,mobile,web',
18
20
  customerTypes: 'BrandAffiliate,Preferred,Retail',
21
+ description: 'not-found',
19
22
  imageURL: 'https://nuskin.com/content/dam/global/images/products/01102730-nu-skin-tri-phasic-white-essence.png',
20
23
  isExclusive: 'false',
21
24
  market,
22
- name: product.identifier,
25
+ name: ` ${product.identifier}`,
23
26
  productStatus: 'Sellable',
24
27
  scanQualifiedCount: '0',
25
28
  status: 'active',
26
- title: product.identifier
29
+ title: ` ${product.identifier}`
27
30
  }
28
31
  })];
29
32
 
package/src/product.js CHANGED
@@ -75,7 +75,14 @@ const Product = function(productData) {
75
75
  //equinox inventory / stock label
76
76
  //@example "IN STOCK"
77
77
  this.inventory = "";
78
+
79
+ // equinox specific properties
78
80
  this.equinoxProductId = "";
81
+ this.equinox = {
82
+ sku: {
83
+ exists: null
84
+ }
85
+ };
79
86
 
80
87
  this.setMarketAttributes = function(productStatus) {
81
88
  if (productStatus.marketAttributes) {
@@ -534,6 +541,11 @@ const Product = function(productData) {
534
541
  retData.addOns = this.addOns;
535
542
  retData.inventory = this.inventory;
536
543
  retData.equinoxProductId = this.equinoxProductId;
544
+ retData.equinox = {
545
+ sku: {
546
+ exists: this.equinox.sku.exists
547
+ }
548
+ };
537
549
 
538
550
  return retData;
539
551
  };
@@ -675,6 +687,14 @@ const Product = function(productData) {
675
687
  }
676
688
 
677
689
  this.equinoxProductId = data.equinoxProductId;
690
+
691
+ if (data.equinox && data.equinox.sku) {
692
+ this.equinox = {
693
+ sku: {
694
+ exists: data.equinox.sku.exists
695
+ }
696
+ };
697
+ }
678
698
  }
679
699
  };
680
700
 
@@ -462,7 +462,12 @@ const ProductData = {
462
462
  "restrictedMarkets": [],
463
463
  "addOns": [],
464
464
  "inventory": product.inventory || "", //inventory label
465
- "equinoxProductId": productData.identifier
465
+ "equinoxProductId": productData.identifier,
466
+ equinox: {
467
+ sku: {
468
+ exists: productData.exists ? productData.exists : false
469
+ }
470
+ }
466
471
  };
467
472
 
468
473
  products.push(new Product(product));