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.
@@ -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
- theme: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.theme,
31
- webshopTenantId: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.webshopTenantId,
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: (_l = fs.props) === null || _l === void 0 ? void 0 : _l.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
  }
@@ -8,6 +8,7 @@ export default class ProductFormState extends FormState {
8
8
  label: string;
9
9
  value: string;
10
10
  }[];
11
+ tags: string[];
11
12
  };
12
13
  constructor(props?: any, opts?: any);
13
14
  autoCreateTitle(): string;
@@ -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.forEach((tag) => {
536
- if (!options.map((o) => o.value).includes(tag)) {
537
- options.splice(0, 0, { label: tag, value: tag });
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') {
@@ -57,6 +57,7 @@ export default class Merchant extends Base {
57
57
  numOrders: number;
58
58
  numProducts: number;
59
59
  orderTags: string[];
60
+ productTags: string[];
60
61
  theme: MerchantTheme;
61
62
  webshopTenantId: string;
62
63
  webhooks: MerchantWebHook[];
@@ -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,
@@ -563,12 +563,12 @@ class Product extends Base_1.default {
563
563
  type: 'int32',
564
564
  },
565
565
  {
566
- facet: false,
566
+ facet: true,
567
567
  name: 'availableForSale',
568
568
  type: 'bool',
569
569
  },
570
570
  {
571
- facet: false,
571
+ facet: true,
572
572
  name: 'selectedForClearance',
573
573
  type: 'string',
574
574
  },
@@ -20,6 +20,7 @@ declare type MerchantObj = {
20
20
  numOrders: number;
21
21
  numProducts: number;
22
22
  orderTags: string[];
23
+ productTags: string[];
23
24
  theme: MerchantTheme;
24
25
  webhooks: MerchantWebHook[];
25
26
  webshopTenantId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.4.88",
3
+ "version": "2.4.89",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",