rerobe-js-orm 2.4.88 → 2.4.89
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/factories/Merchant/MerchantFromFormState.js +5 -4
- package/lib/form-states/Product/ProductFormState.d.ts +1 -0
- package/lib/form-states/Product/ProductFormState.js +7 -5
- package/lib/models/Merchant.d.ts +1 -0
- package/lib/models/Merchant.js +2 -0
- package/lib/models/Product.js +2 -2
- package/lib/types/merchant-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ const MerchantFactory_1 = require("./MerchantFactory");
|
|
|
4
4
|
const Merchant_1 = require("../../models/Merchant");
|
|
5
5
|
class MerchantFromFormState extends MerchantFactory_1.default {
|
|
6
6
|
createMerchant(fs) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
8
8
|
const merchantAttributes = {
|
|
9
9
|
id: ((_a = fs.props) === null || _a === void 0 ? void 0 : _a.id) || '',
|
|
10
10
|
name: fs.fields.name.inputValue,
|
|
@@ -27,10 +27,11 @@ class MerchantFromFormState extends MerchantFactory_1.default {
|
|
|
27
27
|
numOrders: (_f = fs.props) === null || _f === void 0 ? void 0 : _f.numOrders,
|
|
28
28
|
numProducts: (_g = fs.props) === null || _g === void 0 ? void 0 : _g.numProducts,
|
|
29
29
|
orderTags: (_h = fs.props) === null || _h === void 0 ? void 0 : _h.orderTags,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
productTags: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.productTags,
|
|
31
|
+
theme: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.theme,
|
|
32
|
+
webshopTenantId: (_l = fs.props) === null || _l === void 0 ? void 0 : _l.webshopTenantId,
|
|
32
33
|
webhooks: fs.fields.webhooks.selectedValues,
|
|
33
|
-
sharedSecret: (
|
|
34
|
+
sharedSecret: (_m = fs.props) === null || _m === void 0 ? void 0 : _m.sharedSecret,
|
|
34
35
|
};
|
|
35
36
|
return new Merchant_1.default(Object.assign({}, merchantAttributes));
|
|
36
37
|
}
|
|
@@ -531,13 +531,15 @@ class ProductFormState extends FormState_1.default {
|
|
|
531
531
|
hidden = this.props.productStyle.length < 1;
|
|
532
532
|
}
|
|
533
533
|
if (fieldKey === 'tags') {
|
|
534
|
+
let selectedTagOptions = [];
|
|
534
535
|
if (this.props.tags && Array.isArray(this.props.tags) && this.props.tags.length > 0) {
|
|
535
|
-
this.props.tags.
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
});
|
|
536
|
+
selectedTagOptions = this.props.tags.map((t) => ({ label: t, value: t }));
|
|
537
|
+
}
|
|
538
|
+
let tagOptions = [];
|
|
539
|
+
if (this.opts && this.opts.tags && this.opts.tags.length > 0) {
|
|
540
|
+
tagOptions = this.opts.tags.map((t) => ({ label: t, value: t }));
|
|
540
541
|
}
|
|
542
|
+
options = this.utilities.uniqObjArray([...selectedTagOptions, ...tagOptions], 'value');
|
|
541
543
|
hidden = Boolean(this.props.tags && Array.isArray(this.props.tags) && this.props.tags.length < 1);
|
|
542
544
|
}
|
|
543
545
|
if (fieldKey === 'featuredCollections') {
|
package/lib/models/Merchant.d.ts
CHANGED
package/lib/models/Merchant.js
CHANGED
|
@@ -34,6 +34,7 @@ class Merchant extends Base_1.default {
|
|
|
34
34
|
this.numOrders = (props === null || props === void 0 ? void 0 : props.numOrders) || 0;
|
|
35
35
|
this.numProducts = (props === null || props === void 0 ? void 0 : props.numProducts) || 0;
|
|
36
36
|
this.orderTags = (props === null || props === void 0 ? void 0 : props.orderTags) || [];
|
|
37
|
+
this.productTags = (props === null || props === void 0 ? void 0 : props.productTags) || [];
|
|
37
38
|
this.theme = (props === null || props === void 0 ? void 0 : props.theme) || {
|
|
38
39
|
layoutType: 'StandardNavLayout',
|
|
39
40
|
bgColor: '#fff',
|
|
@@ -74,6 +75,7 @@ class Merchant extends Base_1.default {
|
|
|
74
75
|
numOrders: this.numOrders,
|
|
75
76
|
numProducts: this.numProducts,
|
|
76
77
|
orderTags: this.orderTags,
|
|
78
|
+
productTags: this.productTags,
|
|
77
79
|
theme: this.theme,
|
|
78
80
|
webshopTenantId: this.webshopTenantId,
|
|
79
81
|
webhooks: this.webhooks,
|
package/lib/models/Product.js
CHANGED
|
@@ -563,12 +563,12 @@ class Product extends Base_1.default {
|
|
|
563
563
|
type: 'int32',
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
|
-
facet:
|
|
566
|
+
facet: true,
|
|
567
567
|
name: 'availableForSale',
|
|
568
568
|
type: 'bool',
|
|
569
569
|
},
|
|
570
570
|
{
|
|
571
|
-
facet:
|
|
571
|
+
facet: true,
|
|
572
572
|
name: 'selectedForClearance',
|
|
573
573
|
type: 'string',
|
|
574
574
|
},
|