impaktapps-ui-builder 0.0.410 → 0.0.412
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/dist/impaktapps-ui-builder.es.js +697 -872
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +14 -14
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.d.ts +4 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildDate.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildInputSlider.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildTreeMap.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +19 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.d.ts +19 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +2 -4
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +5 -3
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +9 -5
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +8 -5
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +9 -7
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.ts +9 -5
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +11 -15
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +11 -1
- package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +46 -0
- package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +8 -6
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +6 -0
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +22 -23
- package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +9 -2
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +58 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +54 -49
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +16 -11
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +34 -8
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +19 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +20 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +1 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +2 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +32 -17
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +19 -213
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +8 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +67 -274
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +2 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -104
- package/src/impaktapps-ui-builder/builder/services/component.ts +59 -74
- package/src/impaktapps-ui-builder/builder/services/event.ts +15 -13
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +17 -26
- package/src/impaktapps-ui-builder/builder/services/utils.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +141 -95
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +2 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +85 -47
|
@@ -228,7 +228,7 @@ export const EventUiSchema: any = {
|
|
|
228
228
|
icon: "RejectIcon",
|
|
229
229
|
color: "error",
|
|
230
230
|
tooltipMessage: "Reject This Record",
|
|
231
|
-
onClick: "
|
|
231
|
+
onClick: "deleteEvent",
|
|
232
232
|
},
|
|
233
233
|
},
|
|
234
234
|
},
|
|
@@ -238,109 +238,6 @@ export const EventUiSchema: any = {
|
|
|
238
238
|
}
|
|
239
239
|
],
|
|
240
240
|
},
|
|
241
|
-
{
|
|
242
|
-
type: "Control",
|
|
243
|
-
scope: "#/properties/popUpEvent",
|
|
244
|
-
options: {
|
|
245
|
-
widget: "PopUp"
|
|
246
|
-
},
|
|
247
|
-
config: {
|
|
248
|
-
layout: {
|
|
249
|
-
xs: 12,
|
|
250
|
-
sm: 12,
|
|
251
|
-
md: 12,
|
|
252
|
-
lg: 12,
|
|
253
|
-
},
|
|
254
|
-
style:{
|
|
255
|
-
width: "32%",
|
|
256
|
-
margin: "auto"
|
|
257
|
-
},
|
|
258
|
-
main: {
|
|
259
|
-
title: "Delete Content"
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
elements:
|
|
263
|
-
[
|
|
264
|
-
{
|
|
265
|
-
type: "Control",
|
|
266
|
-
scope: "#/properties/label",
|
|
267
|
-
options: {
|
|
268
|
-
widget: "Box",
|
|
269
|
-
},
|
|
270
|
-
config: {
|
|
271
|
-
layout: 12,
|
|
272
|
-
main: {
|
|
273
|
-
heading: "Are you sure you want to delete ?",
|
|
274
|
-
},
|
|
275
|
-
style:{
|
|
276
|
-
marginTop: "-25px",
|
|
277
|
-
marginLeft: "11px"
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
type: "Control",
|
|
283
|
-
scope: "#/properties/EmptyBox",
|
|
284
|
-
options: {
|
|
285
|
-
widget: "EmptyBox",
|
|
286
|
-
},
|
|
287
|
-
config: {
|
|
288
|
-
main:{},
|
|
289
|
-
layout: { xs: 11, sm: 5.5, md: 4.5, lg: 4.5 },
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
type: "Control",
|
|
294
|
-
scope: "#/properties/ConfirmDeleteEventButton",
|
|
295
|
-
options: {
|
|
296
|
-
widget: "Button",
|
|
297
|
-
},
|
|
298
|
-
config: {
|
|
299
|
-
layout: 3,
|
|
300
|
-
main: {
|
|
301
|
-
name: "Yes",
|
|
302
|
-
endIcon: "DeleteIcon",
|
|
303
|
-
variant: "contained",
|
|
304
|
-
color: "info",
|
|
305
|
-
type: "text",
|
|
306
|
-
onClick: "deleteEvent",
|
|
307
|
-
size: "small",
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
type: "Control",
|
|
313
|
-
scope: "#/properties/CancelDeleteEventButton",
|
|
314
|
-
options: {
|
|
315
|
-
widget: "Button",
|
|
316
|
-
},
|
|
317
|
-
config: {
|
|
318
|
-
layout: 3,
|
|
319
|
-
main: {
|
|
320
|
-
name: "No",
|
|
321
|
-
endIcon: "CloseIcon",
|
|
322
|
-
variant: "contained",
|
|
323
|
-
color: "info",
|
|
324
|
-
type: "text",
|
|
325
|
-
onClick: "deletePopUpEvent",
|
|
326
|
-
size: "small",
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
type: "Control",
|
|
332
|
-
scope: "#/properties/EmptyBox",
|
|
333
|
-
options: {
|
|
334
|
-
widget: "EmptyBox",
|
|
335
|
-
},
|
|
336
|
-
config: {
|
|
337
|
-
main:{},
|
|
338
|
-
layout: 0.5,
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
|
|
344
241
|
{
|
|
345
242
|
type: "Control",
|
|
346
243
|
scope: "#/properties/proc",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
|
-
import { ComponentSchema } from "../elements/UiSchema/Component/schema";
|
|
2
|
+
import { ComponentSchema } from "../elements/UiSchema/Component/schema";
|
|
3
3
|
import { componentBasicUiSchema } from "../elements/UiSchema/Component/uiSchema";
|
|
4
4
|
import { CoreSection } from "../build/uischema/coreSection";
|
|
5
5
|
import { EventSection } from "../build/uischema/eventSection";
|
|
@@ -10,55 +10,58 @@ import { ValueTab } from "../build/uischema/valueTab";
|
|
|
10
10
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
11
11
|
import { getFormdataFromLocalStorage, okHandler, saveFormdataInLocalStorage, saveHandler } from "./utils";
|
|
12
12
|
const sectionLabels = {
|
|
13
|
-
Select: ["Core", "Properties","Value", "
|
|
14
|
-
MultipleSelect: ["Core", "Properties","Value", "
|
|
15
|
-
Table: ["Core", "Components",
|
|
16
|
-
LeaderBoard: ["Core", "Components", "Properties", "
|
|
17
|
-
WrapperSection: ["Core", "Components","Properties", "
|
|
18
|
-
TabSection: ["Core", "Components", "Properties", "
|
|
19
|
-
SpeedoMeter:["Core", "Properties", "
|
|
20
|
-
card:["Core", "Properties", "
|
|
21
|
-
UploadFile:["Core",
|
|
22
|
-
Graph:["Core", "Properties", "
|
|
23
|
-
DownloadFile:["Core",
|
|
24
|
-
Box: ["Core", "
|
|
25
|
-
Properties: ["Core", "Properties", "
|
|
26
|
-
ProgressBarCard: ["Core", "Properties", "
|
|
27
|
-
RankCard: ["Core", "Properties", "
|
|
28
|
-
Slider: ["Core", "Components", "
|
|
29
|
-
Timer: ["Core", "
|
|
30
|
-
Rank: ["Core","
|
|
31
|
-
Button: ["Core", "Properties", "
|
|
32
|
-
Array:["Core","Components","Validation"],
|
|
33
|
-
Radio:["Core", "Properties", "
|
|
34
|
-
Text:["Core","Properties","
|
|
35
|
-
TextArea:["Core","Properties","
|
|
36
|
-
PopUp: ["Core", "Components","Properties", "
|
|
37
|
-
Stepper: ["Core", "Components","Properties","Event", "
|
|
38
|
-
DataGrid: ["Core", "Components","Properties","Event", "
|
|
13
|
+
Select: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
14
|
+
MultipleSelect: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
15
|
+
Table: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
|
|
16
|
+
LeaderBoard: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
|
|
17
|
+
WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
18
|
+
TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
19
|
+
SpeedoMeter: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
20
|
+
card: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
21
|
+
UploadFile: ["Core", "Event", "Style", "Validation"],
|
|
22
|
+
Graph: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
23
|
+
DownloadFile: ["Core", "Event", "Style", "Validation"],
|
|
24
|
+
Box: ["Core", "Event", "Style", "Validation"],
|
|
25
|
+
Properties: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
26
|
+
ProgressBarCard: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
27
|
+
RankCard: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
28
|
+
Slider: ["Core", "Components", "Event", "Style", "Validation"],
|
|
29
|
+
Timer: ["Core", "Event", "Style", "Validation"],
|
|
30
|
+
Rank: ["Core", "Event", "Style", "Validation"],
|
|
31
|
+
Button: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
32
|
+
Array: ["Core", "Components", "Validation"],
|
|
33
|
+
Radio: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
34
|
+
Text: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
35
|
+
TextArea: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
36
|
+
PopUp: ["Core", "Components", "Properties", "Style"],
|
|
37
|
+
Stepper: ["Core", "Components", "Properties", "Event", "Style"],
|
|
38
|
+
DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
|
|
39
|
+
InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
40
|
+
TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
|
|
41
|
+
ColumnGroup: ["Core", "Components"]
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
|
|
42
45
|
|
|
43
|
-
export const refreshPage = (type:string,store:any) => {
|
|
46
|
+
export const refreshPage = (type: string, store: any) => {
|
|
44
47
|
const UiSchema = _.cloneDeep(componentBasicUiSchema)
|
|
45
|
-
if(type){
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
if (type) {
|
|
49
|
+
const sectionUiSchema = {
|
|
50
|
+
Core: CoreSection,
|
|
51
|
+
Value: ValueTab,
|
|
52
|
+
Style: StyleSection,
|
|
53
|
+
Event: EventSection,
|
|
54
|
+
Components: TableSection,
|
|
55
|
+
Properties: buildPropertiesSection(type),
|
|
56
|
+
Validation: ValidationSection
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
|
|
60
|
+
UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
|
|
61
|
+
UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
|
|
62
|
+
|
|
55
63
|
}
|
|
56
|
-
|
|
57
|
-
UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style","Event","Validation"];
|
|
58
|
-
UiSchema.elements[1].elements = elements || [CoreSection, StyleSection,EventSection,ValidationSection];
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
store.setUiSchema(UiSchema);
|
|
64
|
+
store.setUiSchema(UiSchema);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export default (store: any, dynamicData: any, submitHandler: any, service: any) => {
|
|
@@ -67,26 +70,26 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
67
70
|
const formdata = await this.getFormdata();
|
|
68
71
|
store.setFormdata(formdata);
|
|
69
72
|
const schema = this.getSchema();
|
|
70
|
-
store.setSchema(schema);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
store.setSchema(schema);
|
|
74
|
+
this.refreshPage(formdata?.type, store);
|
|
75
|
+
|
|
73
76
|
},
|
|
74
|
-
refreshPage:refreshPage,
|
|
77
|
+
refreshPage: refreshPage,
|
|
75
78
|
getFormdata: function () {
|
|
76
79
|
const path = store.searchParams?.get("path");
|
|
77
|
-
return getFormdataFromLocalStorage(path)
|
|
80
|
+
return getFormdataFromLocalStorage(path)
|
|
78
81
|
},
|
|
79
82
|
getSchema: function () {
|
|
80
83
|
return ComponentSchema;
|
|
81
84
|
},
|
|
82
|
-
okHandler:()=>okHandler(store),
|
|
83
|
-
saveHandler: async ()=> await saveHandler(store,service,submitHandler,"PageMaster"),
|
|
85
|
+
okHandler: () => okHandler(store),
|
|
86
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
84
87
|
onChange: function () {
|
|
85
88
|
if (
|
|
86
89
|
store?.formData?.type !== store?.newData?.type &&
|
|
87
90
|
store?.newData?.type !== undefined
|
|
88
91
|
) {
|
|
89
|
-
this.refreshPage(store?.newData?.type,store);
|
|
92
|
+
this.refreshPage(store?.newData?.type, store);
|
|
90
93
|
}
|
|
91
94
|
},
|
|
92
95
|
editComponents: function () {
|
|
@@ -104,28 +107,20 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
104
107
|
store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
|
|
105
108
|
}
|
|
106
109
|
},
|
|
107
|
-
deleteComponents: function (
|
|
110
|
+
deleteComponents: function () {
|
|
108
111
|
const path = store.searchParams?.get("path");
|
|
109
|
-
const rowId =
|
|
112
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
110
113
|
store.formData.elements.splice(rowId, 1);
|
|
111
114
|
const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
112
115
|
const data = path ? _.get(response, path) : response;
|
|
113
116
|
store.setFormdata(data);
|
|
114
|
-
if(shouldUpdateDialog){
|
|
115
|
-
store.updateDialog("popUpComponentSection");
|
|
116
|
-
}
|
|
117
|
-
localStorage.removeItem('rowId');
|
|
118
117
|
},
|
|
119
|
-
deleteEvent: function (
|
|
118
|
+
deleteEvent: function () {
|
|
120
119
|
const path = store.searchParams?.get("path");
|
|
121
|
-
const rowId =
|
|
120
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
122
121
|
store.formData.events.splice(rowId, 1);
|
|
123
122
|
const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
124
123
|
store.setFormdata(_.get(response, path));
|
|
125
|
-
if(shouldUpdateDialog){
|
|
126
|
-
store.updateDialog("popUpEventSection")
|
|
127
|
-
}
|
|
128
|
-
localStorage.removeItem('rowId');
|
|
129
124
|
},
|
|
130
125
|
widgetAddClickHandler: function () {
|
|
131
126
|
if (!Array.isArray(store.formData.elements)) {
|
|
@@ -160,16 +155,6 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
160
155
|
backHandler: function () {
|
|
161
156
|
store.navigate(-1)
|
|
162
157
|
},
|
|
163
|
-
deletePopUpComponent: function(){
|
|
164
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
165
|
-
localStorage.setItem('rowId',rowId);
|
|
166
|
-
store.updateDialog("popUpComponentSection");
|
|
167
|
-
},
|
|
168
|
-
deletePopUpEvent: function(){
|
|
169
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
170
|
-
localStorage.setItem('rowId',rowId);
|
|
171
|
-
store.updateDialog("popUpEventSection");
|
|
172
|
-
},
|
|
173
158
|
}
|
|
174
159
|
};
|
|
175
160
|
|
|
@@ -3,15 +3,17 @@ import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
|
|
|
3
3
|
import Component from "./component";
|
|
4
4
|
import { okHandler, saveFormdataInLocalStorage, saveHandler } from "./utils";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
6
|
+
import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
7
7
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
8
8
|
import _ from "lodash";
|
|
9
|
+
import emptyBox from "../build/uischema/emptyBox";
|
|
9
10
|
|
|
10
11
|
export default (
|
|
11
12
|
store: any,
|
|
12
13
|
dynamicData: any,
|
|
13
14
|
submitHandler: any,
|
|
14
|
-
service: any
|
|
15
|
+
service: any,
|
|
16
|
+
functionsName?: { const: string, title: string }[]
|
|
15
17
|
) => {
|
|
16
18
|
return {
|
|
17
19
|
setPage: async function () {
|
|
@@ -26,7 +28,9 @@ export default (
|
|
|
26
28
|
const schema: any = _.cloneDeep(EventSchema)
|
|
27
29
|
if (handlerType) {
|
|
28
30
|
if (handlerType === "custom") {
|
|
29
|
-
uiSchema.elements[1].elements[0].elements[2] =
|
|
31
|
+
uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
|
|
32
|
+
uiSchema.elements[1].elements[0].elements[3] = emptyBox;
|
|
33
|
+
uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
|
|
30
34
|
schema.required = ["eventType", "Handler", "eventCode"]
|
|
31
35
|
|
|
32
36
|
} else if (handlerType === "api") {
|
|
@@ -47,6 +51,12 @@ export default (
|
|
|
47
51
|
schema.required = ["eventType", "Handler", "refreshElements"]
|
|
48
52
|
}
|
|
49
53
|
}
|
|
54
|
+
if (functionsName) {
|
|
55
|
+
schema.properties.inBuiltFunctionType.oneOf = [
|
|
56
|
+
...schema.properties.inBuiltFunctionType.oneOf,
|
|
57
|
+
...functionsName
|
|
58
|
+
]
|
|
59
|
+
}
|
|
50
60
|
store.setSchema(schema)
|
|
51
61
|
store.setUiSchema(uiSchema)
|
|
52
62
|
},
|
|
@@ -59,7 +69,7 @@ export default (
|
|
|
59
69
|
return EventSchema;
|
|
60
70
|
},
|
|
61
71
|
okHandler: () => okHandler(store),
|
|
62
|
-
saveHandler: async () => await saveHandler(store, service, submitHandler,"PageMaster"),
|
|
72
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
63
73
|
onChange: function () {
|
|
64
74
|
if (
|
|
65
75
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
@@ -89,17 +99,9 @@ export default (
|
|
|
89
99
|
this.setPage()
|
|
90
100
|
|
|
91
101
|
},
|
|
92
|
-
deleteEvent:
|
|
93
|
-
await Component(store, dynamicData, submitHandler, service).deleteEvent(false);
|
|
94
|
-
store.updateDialog("popUpEvent");
|
|
95
|
-
},
|
|
102
|
+
deleteEvent: Component(store, dynamicData, submitHandler, service).deleteEvent,
|
|
96
103
|
backHandler: function () {
|
|
97
104
|
store.navigate(-1)
|
|
98
105
|
},
|
|
99
|
-
deletePopUpEvent: function(){
|
|
100
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
101
|
-
localStorage.setItem('rowId',rowId);
|
|
102
|
-
store.updateDialog("popUpEvent");
|
|
103
|
-
}
|
|
104
106
|
}
|
|
105
107
|
};
|
|
@@ -8,13 +8,12 @@ import { getFormdataFromLocalStorage, saveFormdataInLocalStorage, saveHandler }
|
|
|
8
8
|
interface funcParamsProps {
|
|
9
9
|
store: any,
|
|
10
10
|
dynamicData: any,
|
|
11
|
-
|
|
11
|
+
pageConfigProvider: any,
|
|
12
12
|
submitHandler: any,
|
|
13
13
|
service: any
|
|
14
|
-
config?: any
|
|
15
14
|
}
|
|
16
15
|
export default (funcParams: funcParamsProps) => {
|
|
17
|
-
const { store, dynamicData,
|
|
16
|
+
const { store, dynamicData, submitHandler, service } = funcParams
|
|
18
17
|
return {
|
|
19
18
|
setPage: async function () {
|
|
20
19
|
const formdata = await this.getFormdata();
|
|
@@ -24,8 +23,9 @@ export default (funcParams: funcParamsProps) => {
|
|
|
24
23
|
store.setSchema(schema);
|
|
25
24
|
store.setUiSchema(uiSchema);
|
|
26
25
|
},
|
|
27
|
-
getFormdata: function () {
|
|
26
|
+
getFormdata: async function () {
|
|
28
27
|
const id = store.searchParams?.get("id");
|
|
28
|
+
const config: any = await funcParams.pageConfigProvider(id)
|
|
29
29
|
const formData = getFormdataFromLocalStorage()
|
|
30
30
|
if (formData) {
|
|
31
31
|
return formData;
|
|
@@ -49,17 +49,20 @@ export default (funcParams: funcParamsProps) => {
|
|
|
49
49
|
store.formData.elements = []
|
|
50
50
|
}
|
|
51
51
|
const response = saveFormdataInLocalStorage(store.ctx.core.data)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
if (id) {
|
|
53
|
+
store.navigate(
|
|
54
|
+
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
55
|
+
);
|
|
56
|
+
} else {
|
|
57
|
+
store.navigate(
|
|
58
|
+
`/Component?path=${`elements[${response?.elements.length}]`}`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
55
62
|
},
|
|
56
|
-
saveHandler: async ()=> await saveHandler(store,service,submitHandler),
|
|
63
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler),
|
|
57
64
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
58
|
-
|
|
59
|
-
Delete_Components: async function() {
|
|
60
|
-
await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
|
|
61
|
-
store.updateDialog("popUpPageMasterComponent");
|
|
62
|
-
},
|
|
65
|
+
Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
|
|
63
66
|
eventAddHandler: function () {
|
|
64
67
|
const id = store.searchParams?.get("id");
|
|
65
68
|
if (!Array.isArray(store.formData.events)) {
|
|
@@ -77,22 +80,10 @@ export default (funcParams: funcParamsProps) => {
|
|
|
77
80
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
78
81
|
},
|
|
79
82
|
deleteEvent: function () {
|
|
80
|
-
const rowId =
|
|
83
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
81
84
|
store.formData.events.splice(rowId, 1);
|
|
82
85
|
const response = saveFormdataInLocalStorage(store.ctx.core.data)
|
|
83
86
|
store.setFormdata(response);
|
|
84
|
-
store.updateDialog("popUpPageMasterEvent");
|
|
85
|
-
localStorage.removeItem('rowId');
|
|
86
|
-
},
|
|
87
|
-
deletePopUpComponent: function(){
|
|
88
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
89
|
-
localStorage.setItem('rowId',rowId);
|
|
90
|
-
store.updateDialog("popUpPageMasterComponent");
|
|
91
|
-
},
|
|
92
|
-
deletePopUpEvent: function(){
|
|
93
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
94
|
-
localStorage.setItem('rowId',rowId);
|
|
95
|
-
store.updateDialog("popUpPageMasterEvent");
|
|
96
87
|
},
|
|
97
88
|
}
|
|
98
89
|
};
|
|
@@ -65,7 +65,7 @@ export async function saveHandler(store, service, submitHandler, pageName?: stri
|
|
|
65
65
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
66
66
|
try {
|
|
67
67
|
const saveReturn = await submitHandler(store, service, config);
|
|
68
|
-
navigateHandler(store, true, pageName ? `/${pageName}?id=${id}` : "/PageMasterRecords")
|
|
68
|
+
navigateHandler(store, true, pageName ? `/${pageName}?id=${saveReturn.id}` : "/PageMasterRecords")
|
|
69
69
|
} catch (err) {
|
|
70
70
|
navigateHandler(store, false)
|
|
71
71
|
}
|