rerobe-js-orm 3.0.20 → 3.0.21
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/lib/helpers/Utilities.js
CHANGED
package/lib/models/Product.d.ts
CHANGED
|
@@ -30,6 +30,10 @@ export default class Product extends Base {
|
|
|
30
30
|
})[];
|
|
31
31
|
name: string;
|
|
32
32
|
};
|
|
33
|
+
getAttributesOptions(): {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
33
37
|
private materialCompTagsArrayForShopify;
|
|
34
38
|
private materialCompJoinedString;
|
|
35
39
|
private measurementsJoinedString;
|
package/lib/models/Product.js
CHANGED
|
@@ -797,6 +797,18 @@ class Product extends Base_1.default {
|
|
|
797
797
|
name,
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
|
+
getAttributesOptions() {
|
|
801
|
+
const attributeKeys = Object.keys(this.attributes);
|
|
802
|
+
const filterAttributeKeys = Object.keys(this.filterAttributes);
|
|
803
|
+
const consignmentAttributeKeys = Object.keys(this.consignmentAttributes);
|
|
804
|
+
const timestampAttributeKeys = Object.keys(this.timestampAttributes);
|
|
805
|
+
const allKeys = [...attributeKeys, ...filterAttributeKeys, ...consignmentAttributeKeys, ...timestampAttributeKeys];
|
|
806
|
+
const options = allKeys.map((key) => ({
|
|
807
|
+
label: this.utilities.humanize(key),
|
|
808
|
+
value: key,
|
|
809
|
+
}));
|
|
810
|
+
return options;
|
|
811
|
+
}
|
|
800
812
|
materialCompTagsArrayForShopify() {
|
|
801
813
|
return Object.keys(this.filterAttributes.materialComposition).reduce((acc, cur, idx) => {
|
|
802
814
|
acc.push(`${cur} ${Object.values(this.filterAttributes.materialComposition)[idx]}`);
|