rerobe-js-orm 3.4.1 → 3.4.3

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.
@@ -695,7 +695,7 @@ class ProductFormState extends FormState_1.default {
695
695
  let onChangeHandler = (val) => this.multiSelectChangeHandler(fieldKey, val);
696
696
  if (fieldKey === 'productStyle') {
697
697
  options = this.setProductStylesFromPassedOptions(this.props.productCategory, this.props.productType);
698
- if (this.props.productStyle && this.props.productStyle.length > 0) {
698
+ if (this.props.productStyle && Array.isArray(this.props.productStyle) && this.props.productStyle.length > 0) {
699
699
  this.props.productStyle.forEach((productStyle) => {
700
700
  if (!options.map((o) => o.value).includes(productStyle)) {
701
701
  options.splice(0, 0, { label: productStyle, value: productStyle });
@@ -921,12 +921,38 @@ class Product extends Base_1.default {
921
921
  const attributeKeys = Object.keys(this.attributes);
922
922
  const filterAttributeKeys = Object.keys(this.filterAttributes);
923
923
  const consignmentAttributeKeys = Object.keys(this.consignmentAttributes);
924
- const timestampAttributeKeys = Object.keys(this.timestampAttributes);
925
- const allKeys = [...attributeKeys, ...filterAttributeKeys, ...consignmentAttributeKeys, ...timestampAttributeKeys];
926
- const options = allKeys.map((key) => ({
927
- label: this.utilities.humanize(key),
928
- value: key,
929
- }));
924
+ // const timestampAttributeKeys = Object.keys(this.timestampAttributes);
925
+ const allKeys = [...attributeKeys, ...filterAttributeKeys, ...consignmentAttributeKeys];
926
+ const restrictedKeys = ['documentId', 'merchantId', 'merchants'];
927
+ const systemManagedKeys = ['reservedBy', 'sellRequestId', 'rfidTag'];
928
+ const configurableAfterCreationKeys = ['editorAuthorizations', 'featuredCollections'];
929
+ const obsoleteKeys = ['clothingSize', 'jeanSize', 'shoeSize'];
930
+ const options = allKeys
931
+ .map((key) => {
932
+ if (key === 'reRobeCommission') {
933
+ return {
934
+ label: this.utilities.humanize('commission'),
935
+ value: key,
936
+ };
937
+ }
938
+ if (key === 'gender') {
939
+ return {
940
+ label: this.utilities.humanize('primarySegment'),
941
+ value: key,
942
+ };
943
+ }
944
+ if (key === 'compareAtPrice') {
945
+ return {
946
+ label: this.utilities.humanize('priceNew'),
947
+ value: key,
948
+ };
949
+ }
950
+ return {
951
+ label: this.utilities.humanize(key),
952
+ value: key,
953
+ };
954
+ })
955
+ .filter((obj) => ![...restrictedKeys, ...systemManagedKeys, ...configurableAfterCreationKeys, ...obsoleteKeys].includes(obj.value));
930
956
  return options;
931
957
  }
932
958
  materialCompTagsArrayForShopify() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",