impaktapps-ui-builder 0.0.382-alpha.6 → 0.0.382-alpha.6000

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.
@@ -228,7 +228,7 @@ export const EventUiSchema: any = {
228
228
  icon: "RejectIcon",
229
229
  color: "error",
230
230
  tooltipMessage: "Reject This Record",
231
- onClick: "deleteEvent",
231
+ onClick: "deletePopUpEvent",
232
232
  },
233
233
  },
234
234
  },
@@ -238,6 +238,92 @@ 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
+ main: {
255
+ },
256
+ },
257
+ elements:
258
+ [
259
+ {
260
+ type: "Control",
261
+ scope: "#/properties/label",
262
+ options: {
263
+ widget: "Box",
264
+ },
265
+ config: {
266
+ layout: 12,
267
+ main: {
268
+ heading: "Are you sure you want to delete ?",
269
+ },
270
+ style:{
271
+ marginTop: "-40px"
272
+ }
273
+ },
274
+ },
275
+ {
276
+ type: "Control",
277
+ scope: "#/properties/EmptyBox",
278
+ options: {
279
+ widget: "EmptyBox",
280
+ },
281
+ config: {
282
+ main:{},
283
+ layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
284
+ },
285
+ },
286
+ {
287
+ type: "Control",
288
+ scope: "#/properties/ConfirmDeleteEventButton",
289
+ options: {
290
+ widget: "Button",
291
+ },
292
+ config: {
293
+ layout: 3,
294
+ main: {
295
+ name: "Yes",
296
+ startIcon: "ApproveIcon",
297
+ variant: "contained",
298
+ color: "info",
299
+ type: "text",
300
+ onClick: "deleteEvent",
301
+ size: "small",
302
+ },
303
+ },
304
+ },
305
+ {
306
+ type: "Control",
307
+ scope: "#/properties/CancelDeleteEventButton",
308
+ options: {
309
+ widget: "Button",
310
+ },
311
+ config: {
312
+ layout: 3,
313
+ main: {
314
+ name: "No",
315
+ startIcon: "ApproveIcon",
316
+ variant: "contained",
317
+ color: "info",
318
+ type: "text",
319
+ onClick: "deletePopUpEvent",
320
+ size: "small",
321
+ },
322
+ },
323
+ },
324
+ ]
325
+ },
326
+
241
327
  {
242
328
  type: "Control",
243
329
  scope: "#/properties/proc",
@@ -41,7 +41,7 @@ const sectionLabels = {
41
41
 
42
42
 
43
43
  export const refreshPage = (type:string,store:any) => {
44
- const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
44
+ const UiSchema = _.cloneDeep(componentBasicUiSchema)
45
45
  if(type){
46
46
  const sectionUiSchema = {
47
47
  Core: CoreSection,
@@ -104,20 +104,28 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
104
104
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
105
105
  }
106
106
  },
107
- deleteComponents: function () {
107
+ deleteComponents: function (shouldUpdateDialog: boolean = true) {
108
108
  const path = store.searchParams?.get("path");
109
- const rowId = dynamicData.path.split(".")[1];
109
+ const rowId = localStorage.getItem('rowId');
110
110
  store.formData.elements.splice(rowId, 1);
111
111
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
112
112
  const data = path ? _.get(response, path) : response;
113
113
  store.setFormdata(data);
114
+ if(shouldUpdateDialog){
115
+ store.updateDialog("popUpComponentSection");
116
+ }
117
+ localStorage.removeItem('rowId');
114
118
  },
115
- deleteEvent: function () {
119
+ deleteEvent: function (shouldUpdateDialog: boolean = true) {
116
120
  const path = store.searchParams?.get("path");
117
- const rowId = dynamicData.path.split(".")[1];
121
+ const rowId = localStorage.getItem('rowId');
118
122
  store.formData.events.splice(rowId, 1);
119
123
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
120
124
  store.setFormdata(_.get(response, path));
125
+ if(shouldUpdateDialog){
126
+ store.updateDialog("popUpEventSection")
127
+ }
128
+ localStorage.removeItem('rowId');
121
129
  },
122
130
  widgetAddClickHandler: function () {
123
131
  if (!Array.isArray(store.formData.elements)) {
@@ -152,6 +160,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
152
160
  backHandler: function () {
153
161
  store.navigate(-1)
154
162
  },
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
+ },
155
173
  }
156
174
  };
157
175
 
@@ -89,9 +89,17 @@ export default (
89
89
  this.setPage()
90
90
 
91
91
  },
92
- deleteEvent: Component(store, dynamicData, submitHandler, service).deleteEvent,
92
+ deleteEvent: async function () {
93
+ await Component(store, dynamicData, submitHandler, service).deleteEvent(false);
94
+ store.updateDialog("popUpEvent");
95
+ },
93
96
  backHandler: function () {
94
97
  store.navigate(-1)
95
98
  },
99
+ deletePopUpEvent: function(){
100
+ const rowId = dynamicData.path.split(".")[1];
101
+ localStorage.setItem('rowId',rowId);
102
+ store.updateDialog("popUpEvent");
103
+ }
96
104
  }
97
105
  };
@@ -34,7 +34,7 @@ export default (funcParams: funcParamsProps) => {
34
34
  return config
35
35
  },
36
36
  getUiSchema: function () {
37
- return PageMasterUiSchema(store.theme.myTheme);
37
+ return PageMasterUiSchema;
38
38
  },
39
39
  getSchema: () => {
40
40
  return PageMasterSchema;
@@ -55,7 +55,11 @@ export default (funcParams: funcParamsProps) => {
55
55
  },
56
56
  saveHandler: async ()=> await saveHandler(store,service,submitHandler),
57
57
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
58
- Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
58
+
59
+ Delete_Components: async function() {
60
+ await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
61
+ store.updateDialog("popUpPageMasterComponent");
62
+ },
59
63
  eventAddHandler: function () {
60
64
  const id = store.searchParams?.get("id");
61
65
  if (!Array.isArray(store.formData.events)) {
@@ -73,10 +77,22 @@ export default (funcParams: funcParamsProps) => {
73
77
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
74
78
  },
75
79
  deleteEvent: function () {
76
- const rowId = dynamicData.path.split(".")[1];
80
+ const rowId = localStorage.getItem('rowId');
77
81
  store.formData.events.splice(rowId, 1);
78
82
  const response = saveFormdataInLocalStorage(store.ctx.core.data)
79
83
  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");
80
96
  },
81
97
  }
82
98
  };
@@ -132,7 +132,10 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
132
132
  else {
133
133
  if (handlerResponse) {
134
134
  store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data } });
135
- const demoData = await asyncOperation();
135
+ if (!store.newData) {
136
+ store.newData = {}
137
+ }
138
+ store.newData[componentName] = handlerResponse.data
136
139
  }
137
140
  }
138
141
  }