@nuskin/product-components 3.2.2 → 3.3.0-cx15-5382.1

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/.releaserc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branches": [
3
- "master"
3
+ "master", {"name":"CX15-5382", "channel":"prerelease", "prerelease":"cx15-5382"}
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/npm",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.3.0-cx15-5382.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.3...v3.3.0-cx15-5382.1) (2023-03-15)
2
+
3
+
4
+ ### New
5
+
6
+ * integrated with new QualificationService (#CX15-5382) ([62a735b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/62a735b17df002e93857ce622c191772bd538afe)), closes [#CX15-5382](https://code.tls.nuskin.io/ns-am/ux/product-components/issues/CX15-5382)
7
+
8
+ ## [3.2.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.2...v3.2.3) (2023-03-14)
9
+
10
+
11
+ ### Fix
12
+
13
+ * Add to subscription for equinox market ([fd225e1](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/fd225e19d2540043f767c6ec214e19c8fed80393))
14
+
1
15
  ## [3.2.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.1...v3.2.2) (2023-03-11)
2
16
 
3
17
 
@@ -17,10 +17,11 @@ import {
17
17
  AdrService,
18
18
  FavoritesService,
19
19
  ProductStatus,
20
- QualificationService,
20
+ QualificationService as OldQualificationService,
21
21
  Product as ShopProduct,
22
22
  EquinoxCartService
23
23
  } from "@nuskin/ns-shop";
24
+ import { default as NewQualificationService } from "@nuskin/exclusive-offer-sdk";
24
25
  import webLoyalty from "@nuskin/ns-loyalty-web";
25
26
  import { getProp, getFullUrl } from "@nuskin/ns-common-lib";
26
27
  import { PriceType } from "@nuskin/ns-product-lib";
@@ -30,6 +31,10 @@ import { ProductDataService } from "@nuskin/ns-product";
30
31
  const PENDING_FAVORITE = "pendingFavorite";
31
32
  const KEY_BREADCRUMB_BACK = "breadcrumbBack";
32
33
 
34
+ const QualificationService = equinoxLocalStorage.isEquinoxEnabled()
35
+ ? NewQualificationService
36
+ : OldQualificationService;
37
+
33
38
  /**
34
39
  * NsProductMixin
35
40
  *
@@ -940,6 +945,7 @@ const NsProductMixin = {
940
945
  console.log(`ProductDataService.getProductData: `, error);
941
946
  });
942
947
  } else {
948
+ options.product = this.product;
943
949
  CartService.addProductToCart(options)
944
950
  .then(() => {
945
951
  this.maxQuantity -= options.qty;
@@ -962,24 +968,49 @@ const NsProductMixin = {
962
968
  */
963
969
  handleAddToAdr() {
964
970
  if (!this.disableAddToAdr) {
965
- let options = {
966
- sku: this.activeSku,
967
- qty: this.selectedQuantity,
968
- adr: !AdrService.isAdrOverride(),
969
- product: this.product,
970
- referrer: this.referrer
971
- };
972
- CartService.addProductToCart(options)
973
- .then(() => {
974
- this.maxQuantity -= options.qty;
975
- this.setStatus();
976
- events.publish(events.shop.ADD_TO_CART, options);
977
- events.publish(events.shop.SHOW_ADD_TO_BAG, options);
978
- this.$emit("added-to-adr", options);
979
- })
980
- .catch(error => {
981
- console.error("Failed to add to ADR.", error);
982
- });
971
+ getConfiguration(["Equinox_Markets"]).then(config => {
972
+ let options = {
973
+ sku: this.activeSku,
974
+ qty: this.selectedQuantity,
975
+ adr: !AdrService.isAdrOverride(),
976
+ referrer: this.referrer
977
+ };
978
+ if (
979
+ config.Equinox_Markets.active &&
980
+ equinoxLocalStorage.isEquinoxEnabled()
981
+ ) {
982
+ ProductDataService.getProductData(this.activeSku).then(
983
+ productData => {
984
+ options.product = new ShopProduct(productData.products[0]);
985
+
986
+ EquinoxCartService.addProductToEquinoxCart(options)
987
+ .then(() => {
988
+ this.maxQuantity -= options.qty;
989
+ this.setStatus();
990
+ events.publish(events.shop.ADD_TO_CART, options);
991
+ events.publish(events.shop.SHOW_ADD_TO_BAG, options);
992
+ this.$emit("added-to-adr", options);
993
+ })
994
+ .catch(error => {
995
+ console.error("Failed to add to ADR.", error);
996
+ });
997
+ }
998
+ );
999
+ } else {
1000
+ options.product = this.product;
1001
+ CartService.addProductToCart(options)
1002
+ .then(() => {
1003
+ this.maxQuantity -= options.qty;
1004
+ this.setStatus();
1005
+ events.publish(events.shop.ADD_TO_CART, options);
1006
+ events.publish(events.shop.SHOW_ADD_TO_BAG, options);
1007
+ this.$emit("added-to-adr", options);
1008
+ })
1009
+ .catch(error => {
1010
+ console.error("Failed to add to ADR.", error);
1011
+ });
1012
+ }
1013
+ });
983
1014
  }
984
1015
  },
985
1016
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.2.2",
3
+ "version": "3.3.0-cx15-5382.1",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "@nuskin/ns-common-lib": "1.4.5",
28
28
  "@nuskin/ns-core-styles": "2.11.2",
29
29
  "@nuskin/ns-loyalty-web": "1.5.6",
30
- "@nuskin/ns-product-lib": "2.5.1",
30
+ "@nuskin/ns-product-lib": "2.6.0",
31
31
  "@nuskin/product-recommendation": "2.0.1",
32
32
  "axios": "^0.19.2",
33
33
  "lodash": "^4.17.15",
@@ -42,6 +42,7 @@
42
42
  "fibers": "^4.0.1"
43
43
  },
44
44
  "peerDependencies": {
45
+ "@nuskin/exclusive-offer-sdk": "1.x",
45
46
  "@nuskin/ns-account": "5.x",
46
47
  "@nuskin/ns-checkout-common": "3.x",
47
48
  "@nuskin/ns-feature-flags": "1.x",
@@ -200,7 +200,15 @@
200
200
  </template>
201
201
 
202
202
  <script>
203
- import { QualificationService, CartService } from "@nuskin/ns-shop";
203
+ import {
204
+ QualificationService as OldQualificationService,
205
+ CartService
206
+ } from "@nuskin/ns-shop";
207
+ import { default as NewQualificationService } from "@nuskin/exclusive-offer-sdk";
208
+ import { equinoxLocalStorage } from "@nuskin/ns-util";
209
+ const QualificationService = equinoxLocalStorage.isEquinoxEnabled()
210
+ ? NewQualificationService
211
+ : OldQualificationService;
204
212
 
205
213
  import NsProductMixin from "../mixins/NsProductMixin";
206
214
  import "@nuskin/ns-core-styles/src/dist/main.css";