rerobe-js-orm 3.7.6 → 3.7.7

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.
@@ -84,6 +84,7 @@ class ProductFromFormState extends ProductFactory_1.default {
84
84
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
85
85
  majorDefects: props.fields.majorDefects.selectedValues || [],
86
86
  minorDefects: props.fields.minorDefects.selectedValues || [],
87
+ careInstructions: props.fields.careInstructions.inputValue || '',
87
88
  };
88
89
  const timestampAttributes = {
89
90
  createdAtTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.createdAtTimestamp,
@@ -34,18 +34,19 @@ class ProductFormState extends FormState_1.default {
34
34
  this.fields.size = this.fieldFactory('singleSelect', 'size', options_1.clothingSizeOptions);
35
35
  this.fields.color = this.fieldFactory('singleSelect', 'color', options_1.colors);
36
36
  this.fields.condition = this.fieldFactory('singleSelect', 'condition', options_1.conditions);
37
- this.fields.majorDefects = this.fieldFactory('multiSelect', 'majorDefects', options_1.majorDefectOptions);
38
- this.fields.minorDefects = this.fieldFactory('multiSelect', 'minorDefects', options_1.minorDefectOptions);
39
37
  this.fields.gender = this.fieldFactory('singleSelect', 'gender', options_1.genderOptions);
40
38
  this.fields.materialComposition = this.fieldFactory('singleSelect', 'materialComposition', options_1.clothingMaterials);
41
39
  this.fields.priceRange = this.fieldFactory('textInput', 'priceRange');
42
40
  this.fields.productCategory = this.fieldFactory('singleSelect', 'productCategory', options_1.productCategories);
43
41
  this.fields.productType = this.fieldFactory('singleSelect', 'productType');
44
42
  this.fields.productStyle = this.fieldFactory('multiSelect', 'productStyle');
43
+ this.fields.careInstructions = this.fieldFactory('textInput', 'careInstructions');
45
44
  // Deprecated soon
46
45
  this.fields.clothingSize = this.fieldFactory('multiSelect', 'clothingSize', options_1.clothingSizeOptions);
47
46
  this.fields.shoeSize = this.fieldFactory('singleSelect', 'shoeSize', options_1.shoeSizes);
48
47
  this.fields.jeanSize = this.fieldFactory('singleSelect', 'jeanSize', options_1.jeanSizes);
48
+ this.fields.majorDefects = this.fieldFactory('multiSelect', 'majorDefects', options_1.majorDefectOptions);
49
+ this.fields.minorDefects = this.fieldFactory('multiSelect', 'minorDefects', options_1.minorDefectOptions);
49
50
  // ProductConsignmentAttributesFormFields
50
51
  this.fields.publishType = this.fieldFactory('singleSelect', 'publishType', options_1.publishTypeOptions);
51
52
  this.fields.conditionRemarks = this.fieldFactory('textInput', 'conditionRemarks');
@@ -740,6 +741,7 @@ class ProductFormState extends FormState_1.default {
740
741
  }
741
742
  hidden = this.props.productCategory !== 'Clothing' || this.props.productType === 'Jeans';
742
743
  }
744
+ // ToDo: Deprecate
743
745
  if (fieldKey === 'majorDefects') {
744
746
  let selectedMajorDefectsOptions = [];
745
747
  if (this.props.majorDefects && Array.isArray(this.props.majorDefects) && this.props.majorDefects.length > 0) {
@@ -751,6 +753,7 @@ class ProductFormState extends FormState_1.default {
751
753
  }
752
754
  options = this.utilities.uniqObjArray([...selectedMajorDefectsOptions, ...majorDefectsOptions], 'value');
753
755
  }
756
+ // ToDo: Deprecate
754
757
  if (fieldKey === 'minorDefects') {
755
758
  let selectedMinorDefectsOptions = [];
756
759
  if (this.props.minorDefects && Array.isArray(this.props.minorDefects) && this.props.minorDefects.length > 0) {
@@ -86,6 +86,7 @@ class Product extends Base_1.default {
86
86
  inventoryLocations: this.validateInventoryLocation(props === null || props === void 0 ? void 0 : props.inventoryLocations) || [],
87
87
  majorDefects: (props === null || props === void 0 ? void 0 : props.majorDefects) || [],
88
88
  minorDefects: (props === null || props === void 0 ? void 0 : props.minorDefects) || [],
89
+ careInstructions: (props === null || props === void 0 ? void 0 : props.careInstructions) || '',
89
90
  };
90
91
  this.timestampAttributes = {
91
92
  createdAtTimestamp: (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.createdAtTimestamp) : null,
@@ -469,13 +470,11 @@ class Product extends Base_1.default {
469
470
  var _a;
470
471
  const { compareAtPrice } = this.attributes;
471
472
  const { color, productCategory, productType, productStyle, condition, gender, size } = this.filterAttributes;
472
- const { productRemarks, conditionRemarks, purchasePrice, yearPurchased, sizeComment, majorDefects, minorDefects } = this.consignmentAttributes;
473
+ const { productRemarks, conditionRemarks, purchasePrice, yearPurchased, sizeComment, careInstructions } = this.consignmentAttributes;
473
474
  const measurements = this.measurementsJoinedString(this.filterAttributes.measurements);
474
475
  const materials = this.materialCompJoinedString();
475
476
  const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
476
477
  const joinedProductStyle = productStyle.join(', ');
477
- const joinedMajorDefects = majorDefects.join(', ');
478
- const joinedMinorDefects = minorDefects.join(', ');
479
478
  const numberFormatter = new Intl.NumberFormat(locale, {
480
479
  style: 'currency',
481
480
  currency,
@@ -527,8 +526,7 @@ class Product extends Base_1.default {
527
526
  title: 'Additional Remarks',
528
527
  attributes: [
529
528
  productRemarks && `${t('Remarks')}: ${t(productRemarks)}`,
530
- majorDefects.length > 0 && `${t('Major Defects')}: ${t(joinedMajorDefects)}`,
531
- minorDefects.length > 0 && `${t('Minor Defects')}: ${t(joinedMinorDefects)}`,
529
+ careInstructions && `${t('Care instrutions')}: ${t(careInstructions)}`,
532
530
  ].filter(Boolean),
533
531
  },
534
532
  ];
@@ -77,6 +77,7 @@ type ProductConsignmentAttributes = {
77
77
  inventoryLocations: InventoryLocation[];
78
78
  majorDefects: string[];
79
79
  minorDefects: string[];
80
+ careInstructions: string;
80
81
  };
81
82
  type ProductTimestampAttributes = {
82
83
  createdAtTimestamp: number | null;
@@ -211,6 +212,7 @@ type ProductConsignmentAttributesFormFields = {
211
212
  inventoryLocations: MultiSelectFormField<InventoryLocation>;
212
213
  majorDefects: MultiSelectFormField<string>;
213
214
  minorDefects: MultiSelectFormField<string>;
215
+ careInstructions: TextInputFormField<string>;
214
216
  };
215
217
  type ProductFormFields = ProductAttributesFormFields & ProductFilterAttributesFormFields & ProductConsignmentAttributesFormFields;
216
218
  interface ParamsForBuildProductInputObjForShopify {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.7.6",
3
+ "version": "3.7.7",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",