@nuskin/product-components 3.17.12-cx24-7022.4 → 3.17.13-brw-4218.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", {"name":"CX24-7022", "channel":"prerelease", "prerelease":"cx24-7022"}
3
+ "master", {"name":"BRW-4218", "channel":"prerelease", "prerelease":"brw-4218"}
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/release-notes-generator",
package/docs/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- ## [3.17.12-cx24-7022.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.12-cx24-7022.3...v3.17.12-cx24-7022.4) (2024-09-02)
1
+ ## [3.17.13-brw-4218.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.12...v3.17.13-brw-4218.1) (2024-09-03)
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "bomFormat": "CycloneDX",
3
3
  "specVersion": "1.4",
4
- "serialNumber": "urn:uuid:78ce82b6-792d-40c9-973f-5a41ea064e31",
4
+ "serialNumber": "urn:uuid:ce4d63cf-0e6a-4d8b-b264-5e2a9ca28233",
5
5
  "version": 1,
6
6
  "metadata": {
7
- "timestamp": "2024-09-02T08:02:46Z",
7
+ "timestamp": "2024-09-03T16:02:59Z",
8
8
  "tools": [
9
9
  {
10
10
  "vendor": "GitLab",
@@ -246,7 +246,11 @@ const NsProductMixin = {
246
246
  return this.$NsProductUserService.isPreferredCustomer;
247
247
  },
248
248
  isWholesale() {
249
- return this.$NsProductUserService.isWholesale;
249
+ if (this.$NsProductUserService.isLoggedIn) {
250
+ return this.$NsProductUserService.isUserWholesale;
251
+ } else {
252
+ return this.$NsProductUserService.isWholesale;
253
+ }
250
254
  },
251
255
  loyaltyStatusAndLinks() {
252
256
  return this.marketConfig.loyalty || {};
@@ -657,11 +661,11 @@ const NsProductMixin = {
657
661
  // WARNING: this.product is volatile here. re-check is using this.product.
658
662
  this.maxQuantity = Math.min(
659
663
  shopProduct.maxQuantity,
660
- shopProduct.availableQuantity,
661
664
  productQuantity
662
665
  );
663
666
  })
664
667
  .catch(error => {
668
+ this.maxQuantity = shopProduct.maxQuantity;
665
669
  console.error("Failed to retrieve add to cart quantity.", error);
666
670
  })
667
671
  .finally(() => {
@@ -706,9 +710,14 @@ const NsProductMixin = {
706
710
  let backOrderDate = new Date(this.product.backOrderDate);
707
711
  let today = new Date();
708
712
  if (backOrderDate < today) {
709
- this.statusMessage = this.localTranslations.outOfStock;
710
- this.statusMessageKey = "outOfStock";
711
- this.disable();
713
+ if (this.product.availableQuantity > 0) {
714
+ this.statusMessage = "";
715
+ this.statusMessageKey = "releasedForSale";
716
+ } else {
717
+ this.statusMessage = this.localTranslations.outOfStock;
718
+ this.statusMessageKey = "outOfStock";
719
+ this.disable();
720
+ }
712
721
  }
713
722
  }
714
723
  } else {
@@ -1118,6 +1127,14 @@ const NsProductMixin = {
1118
1127
  productToAdd.equinoxProductId = productIdentifier;
1119
1128
  //productToAdd.properties = productData.products[0].properties
1120
1129
  }
1130
+ if (
1131
+ productToAdd.backOrderDate &&
1132
+ new Date(productToAdd.backOrderDate) > new Date()
1133
+ ) {
1134
+ productToAdd.inventory = "BACKORDER";
1135
+ productToAdd.properties.isBackOrdered = true;
1136
+ productToAdd.properties.inventoryStatus = "BACKORDER";
1137
+ }
1121
1138
  options.product = new ShopProduct(productToAdd);
1122
1139
  options.add = {
1123
1140
  item: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.17.12-cx24-7022.4",
3
+ "version": "3.17.13-brw-4218.1",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {