@antscorp/antsomi-ui 1.3.5-beta.102 → 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.
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +1 -0
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.js +1 -5
- package/es/components/organism/PreviewTemplateModal/types.d.ts +2 -2
- package/es/components/template/TemplateListing/hooks/useTemplateListing.js +1 -5
- package/es/components/template/TemplateListing/types/TemplateListing.d.ts +1 -0
- package/es/models/ObjectTemplate.d.ts +26 -0
- package/es/models/ObjectTemplate.js +28 -0
- package/package.json +1 -1
|
@@ -68,11 +68,7 @@ export const useTemplateSave = (options) => {
|
|
|
68
68
|
const templateItems = useMemo(() => {
|
|
69
69
|
if (infiniteObjectTemplate) {
|
|
70
70
|
const { pages } = infiniteObjectTemplate;
|
|
71
|
-
return pages.flatMap(({ entities }) => entities.flatMap(({
|
|
72
|
-
id,
|
|
73
|
-
label: name,
|
|
74
|
-
thumbnail,
|
|
75
|
-
})));
|
|
71
|
+
return pages.flatMap(({ entities }) => entities.flatMap(entity => (Object.assign(Object.assign({}, entity.toJson()), { label: entity.name }))));
|
|
76
72
|
}
|
|
77
73
|
return [];
|
|
78
74
|
}, [infiniteObjectTemplate]);
|
|
@@ -17,14 +17,14 @@ export interface BannerProps {
|
|
|
17
17
|
showSkeleton?: boolean;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
export type ThumbnailProps = Omit<ThumbnailCardProps,
|
|
20
|
+
export type ThumbnailProps = Omit<ThumbnailCardProps, 'id' | 'name' | 'thumbnail' | 'onClickWrapper'> & {
|
|
21
21
|
thumbnails?: TThumbnail[];
|
|
22
22
|
onClickThumbnail?: (value: TThumbnail) => void;
|
|
23
23
|
};
|
|
24
24
|
export interface SimilarTemplateProps {
|
|
25
25
|
show?: boolean;
|
|
26
26
|
similarTemplates?: TTemplateItem[];
|
|
27
|
-
similarCardProps?: Omit<ThumbnailCardProps,
|
|
27
|
+
similarCardProps?: Omit<ThumbnailCardProps, 'id' | 'name' | 'thumbnail'>;
|
|
28
28
|
}
|
|
29
29
|
export interface InformationProps {
|
|
30
30
|
deviceType: string;
|
|
@@ -150,11 +150,7 @@ export const useTemplateListing = (options) => {
|
|
|
150
150
|
const templateItems = useMemo(() => {
|
|
151
151
|
if (infiniteObjectTemplate) {
|
|
152
152
|
const { pages } = infiniteObjectTemplate;
|
|
153
|
-
return pages.flatMap(({ entities }) => entities.flatMap(
|
|
154
|
-
id,
|
|
155
|
-
name,
|
|
156
|
-
thumbnail,
|
|
157
|
-
})));
|
|
153
|
+
return pages.flatMap(({ entities }) => entities.flatMap(entity => entity.toJson()));
|
|
158
154
|
}
|
|
159
155
|
return [];
|
|
160
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
|
}
|