@antscorp/antsomi-ui 1.3.5-beta.103 → 1.3.5-beta.104

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.
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  // Libraries
13
2
  import { useCallback, useMemo, useState } from 'react';
14
3
  import { useGetTemplateCategoryList, useGetObjectTemplateList, } from '@antscorp/antsomi-ui/es/queries/TemplateListing';
@@ -79,10 +68,7 @@ export const useTemplateSave = (options) => {
79
68
  const templateItems = useMemo(() => {
80
69
  if (infiniteObjectTemplate) {
81
70
  const { pages } = infiniteObjectTemplate;
82
- return pages.flatMap(({ entities }) => entities.flatMap((_a) => {
83
- var { model } = _a, restOfEntity = __rest(_a, ["model"]);
84
- return restOfEntity;
85
- }));
71
+ return pages.flatMap(({ entities }) => entities.flatMap(entity => (Object.assign(Object.assign({}, entity.toJson()), { label: entity.name }))));
86
72
  }
87
73
  return [];
88
74
  }, [infiniteObjectTemplate]);
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  // Libraries
13
2
  import { useCallback, useMemo, useState } from 'react';
14
3
  import { App } from 'antd';
@@ -161,10 +150,7 @@ export const useTemplateListing = (options) => {
161
150
  const templateItems = useMemo(() => {
162
151
  if (infiniteObjectTemplate) {
163
152
  const { pages } = infiniteObjectTemplate;
164
- return pages.flatMap(({ entities }) => entities.flatMap((_a) => {
165
- var { model } = _a, restOfEntity = __rest(_a, ["model"]);
166
- return restOfEntity;
167
- }));
153
+ return pages.flatMap(({ entities }) => entities.flatMap(entity => entity.toJson()));
168
154
  }
169
155
  return [];
170
156
  }, [infiniteObjectTemplate]);
@@ -55,4 +55,30 @@ export declare class ObjectTemplate extends Model<TObjectTemplate> {
55
55
  get goal(): number[] | undefined;
56
56
  get channel(): number | undefined;
57
57
  get shareAccess(): TShareAccess | undefined;
58
+ toJson(): {
59
+ id: string | number;
60
+ name: string;
61
+ type: number;
62
+ typeLabel: string;
63
+ description: string;
64
+ templateSettings: Record<string, any>;
65
+ settings: Record<string, any>;
66
+ status: string | TTemplateStatus;
67
+ userId: string | number;
68
+ createdAt: string | dayjs.Dayjs;
69
+ updatedAt: string | dayjs.Dayjs;
70
+ objectiveTypes: number[];
71
+ networkId: number | undefined;
72
+ thumbnail: string;
73
+ objectType: number | undefined;
74
+ config: Record<string, any> | undefined;
75
+ configObject: Record<string, any> | undefined;
76
+ seasonality: number[] | undefined;
77
+ industry: number[] | undefined;
78
+ lifecycleStage: number[] | undefined;
79
+ journeyType: number[] | undefined;
80
+ goal: number[] | undefined;
81
+ channel: number | undefined;
82
+ shareAccess: TShareAccess | undefined;
83
+ };
58
84
  }
@@ -82,4 +82,32 @@ export class ObjectTemplate extends Model {
82
82
  get shareAccess() {
83
83
  return this.model.share_access;
84
84
  }
85
+ toJson() {
86
+ return {
87
+ id: this.id,
88
+ name: this.name,
89
+ type: this.type,
90
+ typeLabel: this.typeLabel,
91
+ description: this.description,
92
+ templateSettings: this.templateSettings,
93
+ settings: this.settings,
94
+ status: this.status,
95
+ userId: this.userId,
96
+ createdAt: this.createdAt,
97
+ updatedAt: this.updatedAt,
98
+ objectiveTypes: this.objectiveTypes,
99
+ networkId: this.networkId,
100
+ thumbnail: this.thumbnail,
101
+ objectType: this.objectType,
102
+ config: this.config,
103
+ configObject: this.configObject,
104
+ seasonality: this.seasonality,
105
+ industry: this.industry,
106
+ lifecycleStage: this.lifecycleStage,
107
+ journeyType: this.journeyType,
108
+ goal: this.goal,
109
+ channel: this.channel,
110
+ shareAccess: this.shareAccess,
111
+ };
112
+ }
85
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.103",
3
+ "version": "1.3.5-beta.104",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",