rerobe-js-orm 3.0.24 → 3.0.26

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.
@@ -37,7 +37,7 @@ class ProductFromFormState extends ProductFactory_1.default {
37
37
  const productFilterAttributes = {
38
38
  documentId: (_o = props.props) === null || _o === void 0 ? void 0 : _o.documentId,
39
39
  brand: props.fields.brand.selectedValue,
40
- sizeCategory: props.fields.sizeCategory.selectedValue,
40
+ measurementCategory: props.fields.measurementCategory.selectedValue,
41
41
  size: props.fields.size.selectedValue,
42
42
  clothingSize: props.fields.clothingSize.selectedValues,
43
43
  jeanSize: props.fields.jeanSize.selectedValue,
@@ -29,7 +29,7 @@ class ProductFormState extends FormState_1.default {
29
29
  this.fields.measurements = this.fieldFactory('singleSelect', 'measurements');
30
30
  // ProductFilterAttributesFormFields
31
31
  this.fields.brand = this.fieldFactory('singleSelect', 'brand', options_1.brands);
32
- this.fields.sizeCategory = this.fieldFactory('singleSelect', 'sizeCategory', options_1.sizeCategoryOptions);
32
+ this.fields.measurementCategory = this.fieldFactory('singleSelect', 'measurementCategory', options_1.measurementCategoryOptions);
33
33
  this.fields.size = this.fieldFactory('singleSelect', 'size', options_1.clothingSizeOptions);
34
34
  this.fields.color = this.fieldFactory('singleSelect', 'color', options_1.colors);
35
35
  this.fields.condition = this.fieldFactory('singleSelect', 'condition', options_1.conditions);
@@ -606,11 +606,11 @@ class ProductFormState extends FormState_1.default {
606
606
  }
607
607
  }
608
608
  }
609
- if (fieldKey === 'sizeCategory') {
609
+ if (fieldKey === 'measurementCategory') {
610
610
  let selectedOptions = [];
611
- if (this.props.sizeCategory) {
612
- selectedOptions = [{ label: this.props.sizeCategory, value: this.props.sizeCategory }];
613
- if (!options.map((o) => o.value).includes(this.props.sizeCategory)) {
611
+ if (this.props.measurementCategory) {
612
+ selectedOptions = [{ label: this.props.measurementCategory, value: this.props.measurementCategory }];
613
+ if (!options.map((o) => o.value).includes(this.props.measurementCategory)) {
614
614
  options.splice(0, 0, ...selectedOptions);
615
615
  }
616
616
  }
@@ -188,7 +188,7 @@ export const minorDefectOptions: {
188
188
  label: string;
189
189
  value: string;
190
190
  }[];
191
- export const sizeCategoryOptions: {
191
+ export const measurementCategoryOptions: {
192
192
  label: string;
193
193
  value: string;
194
194
  measurementFields: string[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sizeCategoryOptions = exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.weightUnits = exports.productWeightRanges = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.manClothingSizeOptions = exports.womanClothingSizeOptions = exports.clothingSizeOptions = exports.sizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
3
+ exports.measurementCategoryOptions = exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.weightUnits = exports.productWeightRanges = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.manClothingSizeOptions = exports.womanClothingSizeOptions = exports.clothingSizeOptions = exports.sizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
4
4
  const product_constants_1 = require("../../constants/product-constants");
5
5
  const lodash_1 = require("lodash");
6
6
  const availableForSaleOptions = [
@@ -34,7 +34,7 @@ const statusOptions = Object.values(product_constants_1.PRODUCT_STATES).map((val
34
34
  value: val,
35
35
  }));
36
36
  exports.statusOptions = statusOptions;
37
- const sizeCategoryOptions = [
37
+ const measurementCategoryOptions = [
38
38
  {
39
39
  label: 'Suits & Blazers',
40
40
  value: 'Suits & Blazers',
@@ -98,7 +98,7 @@ const sizeCategoryOptions = [
98
98
  measurementFields: ['width', 'height', 'depth'],
99
99
  },
100
100
  ];
101
- exports.sizeCategoryOptions = sizeCategoryOptions;
101
+ exports.measurementCategoryOptions = measurementCategoryOptions;
102
102
  const sizeOptions = [
103
103
  {
104
104
  label: 'No Size',
@@ -44,7 +44,7 @@ class Product extends Base_1.default {
44
44
  jeanSize: (props === null || props === void 0 ? void 0 : props.jeanSize) || '',
45
45
  shoeSize: (props === null || props === void 0 ? void 0 : props.shoeSize) || '',
46
46
  size: (props === null || props === void 0 ? void 0 : props.size) || '',
47
- sizeCategory: (props === null || props === void 0 ? void 0 : props.sizeCategory) || '',
47
+ measurementCategory: (props === null || props === void 0 ? void 0 : props.measurementCategory) || '',
48
48
  productCategory: (props === null || props === void 0 ? void 0 : props.productCategory) || '',
49
49
  productType: (props === null || props === void 0 ? void 0 : props.productType) || '',
50
50
  productStyle: (props === null || props === void 0 ? void 0 : props.productStyle) || [],
@@ -72,7 +72,7 @@ class Product extends Base_1.default {
72
72
  purchasePrice: (props === null || props === void 0 ? void 0 : props.purchasePrice) || '',
73
73
  yearPurchased: (props === null || props === void 0 ? void 0 : props.yearPurchased) || '',
74
74
  salesChannel: (props === null || props === void 0 ? void 0 : props.salesChannel) || [],
75
- sizeComment: (props === null || props === void 0 ? void 0 : props.sizeComment) || 'TRUE_TO_SIZE',
75
+ sizeComment: (props === null || props === void 0 ? void 0 : props.sizeComment) || '',
76
76
  salePrice: (props === null || props === void 0 ? void 0 : props.salePrice) || '',
77
77
  isOnSale: (props === null || props === void 0 ? void 0 : props.isOnSale) || '',
78
78
  discountType: (props === null || props === void 0 ? void 0 : props.discountType) || '',
@@ -285,7 +285,7 @@ class Product extends Base_1.default {
285
285
  compareAtPrice: this.utilities.sanitizeNumber(this.attributes.compareAtPrice),
286
286
  costPerItem: this.utilities.sanitizeNumber(this.attributes.costPerItem),
287
287
  priceRange: this.utilities.sanitizeString(this.filterAttributes.priceRange),
288
- sizeCategory: this.utilities.sanitizeString(this.filterAttributes.sizeCategory),
288
+ measurementCategory: this.utilities.sanitizeString(this.filterAttributes.measurementCategory),
289
289
  productCategory: this.utilities.sanitizeString(this.filterAttributes.productCategory),
290
290
  productType: this.utilities.sanitizeString(this.filterAttributes.productType),
291
291
  productStyle: this.utilities.sanitzeStringArr(this.filterAttributes.productStyle),
@@ -432,6 +432,7 @@ class Product extends Base_1.default {
432
432
  return this.utilities.capitalizeString(result).trim();
433
433
  }
434
434
  autoCreateDescriptionHTML() {
435
+ var _a;
435
436
  const customHeading = false; // ToDo: Add as an attribute;
436
437
  const color = this.filterAttributes.color;
437
438
  const productStyle = this.filterAttributes.productStyle.join(', ');
@@ -442,7 +443,7 @@ class Product extends Base_1.default {
442
443
  const materials = this.materialCompJoinedString();
443
444
  const sizeComment = this.consignmentAttributes.sizeComment;
444
445
  const measurements = this.measurementsJoinedString(this.filterAttributes.measurements);
445
- const fit = options_1.sizeCommentOptions.filter((option) => option.value === sizeComment)[0].label;
446
+ const fit = ((_a = options_1.sizeCommentOptions.filter((option) => option.value === sizeComment)[0]) === null || _a === void 0 ? void 0 : _a.label) || '';
446
447
  const descriptionObj = {
447
448
  title: customHeading ? `<p>${customHeading}</p>\n` : 'REMOVE_ME',
448
449
  line1: `<ul>\n`,
@@ -566,7 +567,7 @@ class Product extends Base_1.default {
566
567
  {
567
568
  facet: true,
568
569
  optional: true,
569
- name: 'sizeCategory',
570
+ name: 'measurementCategory',
570
571
  type: 'string',
571
572
  },
572
573
  {
@@ -39,7 +39,7 @@ declare type ProductFilterAttributes = {
39
39
  gender: string;
40
40
  materialComposition: MaterialComposition;
41
41
  priceRange: string;
42
- sizeCategory: string;
42
+ measurementCategory: string;
43
43
  productCategory: string;
44
44
  productType: string;
45
45
  productStyle: string[];
@@ -170,7 +170,7 @@ declare type ProductFilterAttributesFormFields = {
170
170
  gender: SingleSelectFormField<string>;
171
171
  materialComposition: SingleSelectFormField<MaterialComposition>;
172
172
  priceRange: TextInputFormField<string>;
173
- sizeCategory: SingleSelectFormField<string>;
173
+ measurementCategory: SingleSelectFormField<string>;
174
174
  productCategory: SingleSelectFormField<string>;
175
175
  productType: SingleSelectFormField<string>;
176
176
  productStyle: MultiSelectFormField<string>;
@@ -259,7 +259,7 @@ declare type TypesenseProductObj = {
259
259
  compareAtPrice: number;
260
260
  costPerItem: number;
261
261
  priceRange: string;
262
- sizeCategory: string;
262
+ measurementCategory: string;
263
263
  productCategory: string;
264
264
  productType: string;
265
265
  productStyle: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.24",
3
+ "version": "3.0.26",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",