impaktapps-ui-builder 0.0.409-h → 0.0.409-k
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 +361 -340
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +3 -3
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +30 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +6 -7
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +7 -8
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +87 -15
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +41 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +24 -19
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +41 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +54 -54
- package/src/impaktapps-ui-builder/runtime/services/events.ts +103 -135
- package/src/impaktapps-ui-builder/runtime/services/service.ts +39 -88
|
@@ -1,148 +1,102 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
1
|
+
import _, { cloneDeep } from "lodash";
|
|
2
2
|
import { handlersProps } from "./interface";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
export const executeEvents = async (
|
|
6
|
+
params: handlersProps
|
|
7
|
+
) => {
|
|
5
8
|
let nextEvent = [];
|
|
6
9
|
let finalResponse = null;
|
|
7
|
-
|
|
8
|
-
if (params.config.isSync !== "Yes") {
|
|
9
|
-
return shouldEventExecute(params)
|
|
10
|
-
.then((shouldExecute) => {
|
|
11
|
-
if (!shouldExecute) {
|
|
12
|
-
return { response: undefined, events: undefined };
|
|
13
|
-
}
|
|
14
|
-
return executeEventsHandler(params);
|
|
15
|
-
})
|
|
16
|
-
.then((response) => {
|
|
17
|
-
finalResponse = response;
|
|
18
|
-
const SuccessEvent = params.config?.events.filter(e => e.eventType === "Success");
|
|
19
|
-
nextEvent = SuccessEvent;
|
|
20
|
-
})
|
|
21
|
-
.catch((err) => {
|
|
22
|
-
const FailEvent = params.config?.events?.filter(e => e.eventType === "Fail");
|
|
23
|
-
const setEvent = FailEvent?.length > 0 ? FailEvent : [];
|
|
24
|
-
nextEvent = setEvent;
|
|
25
|
-
})
|
|
26
|
-
.then(() => {
|
|
27
|
-
if (nextEvent?.length > 0) {
|
|
28
|
-
return nextEvent.reduce((chain, actionConfig) => {
|
|
29
|
-
return chain.then(() => executeEvents({ ...params, config: actionConfig, parentEventOutput: finalResponse }));
|
|
30
|
-
}, Promise.resolve());
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
.then(() => finalResponse)
|
|
34
|
-
}
|
|
35
|
-
const shouldExecute = shouldEventExecute(params);
|
|
36
|
-
if (!shouldExecute) {
|
|
37
|
-
return { response: undefined, events: undefined };
|
|
38
|
-
}
|
|
39
10
|
try {
|
|
40
|
-
const
|
|
41
|
-
|
|
11
|
+
const shouldExecute = await shouldEventExecute(params)
|
|
12
|
+
if (!shouldExecute) {
|
|
13
|
+
return { response: undefined, events: undefined };
|
|
14
|
+
}
|
|
15
|
+
const response = await executeEventsHandler(params)
|
|
16
|
+
finalResponse = response;
|
|
42
17
|
const SuccessEvent = params.config?.events.filter(e => e.eventType === "Success");
|
|
43
18
|
nextEvent = SuccessEvent;
|
|
44
|
-
} catch {
|
|
45
|
-
const FailEvent = params.config?.events?.filter(e => e.eventType === "Fail")
|
|
46
|
-
const setEvent = FailEvent?.length > 0 ? FailEvent : []
|
|
19
|
+
} catch (err) {
|
|
20
|
+
const FailEvent = params.config?.events?.filter(e => e.eventType === "Fail")
|
|
21
|
+
const setEvent = FailEvent?.length > 0 ? FailEvent : []
|
|
47
22
|
nextEvent = setEvent;
|
|
48
23
|
}
|
|
49
24
|
if (nextEvent?.length > 0) {
|
|
50
25
|
for (const actionConfig of nextEvent) {
|
|
51
|
-
executeEvents({ ...params, config: actionConfig, parentEventOutput: finalResponse })
|
|
26
|
+
await executeEvents({ ...params, config: actionConfig, parentEventOutput: finalResponse })
|
|
52
27
|
}
|
|
53
28
|
}
|
|
54
29
|
return finalResponse;
|
|
55
30
|
}
|
|
56
|
-
|
|
31
|
+
|
|
32
|
+
async function executeEventsHandler(params: handlersProps) {
|
|
57
33
|
if (params.config.Handler === "api") {
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
params.service
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return params.store.functionParameters?.
|
|
34
|
+
return await executeApiEventHandler(params)
|
|
35
|
+
}
|
|
36
|
+
else if (params.config.Handler === "inBuiltFunction") {
|
|
37
|
+
return await executeInBuiltFunctionHandler(params)
|
|
38
|
+
}
|
|
39
|
+
else if (params.config.Handler === "custom") {
|
|
40
|
+
return await executeCustomHandler(params)
|
|
41
|
+
}
|
|
42
|
+
else if (params.config.Handler === "refresh") {
|
|
43
|
+
return await executeRefreshHandler(params)
|
|
44
|
+
}
|
|
45
|
+
else if (params.config.Handler === "mergeFormdata") {
|
|
46
|
+
const result = await mergeFormdata(
|
|
47
|
+
params.parentEventOutput, params.componentName, params.config, params.store, params.service)
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
else if (params.config.Handler === "onBackHandler") {
|
|
51
|
+
return params.store.functionParameters?.handleBack()
|
|
52
|
+
}
|
|
53
|
+
else if (params.config.Handler === "onNextHandler") {
|
|
54
|
+
return params.store.functionParameters?.handleNext()
|
|
55
|
+
}
|
|
56
|
+
else if (params.config.Handler === "onResetHandler") {
|
|
57
|
+
return params.store.functionParameters?.handleReset()
|
|
79
58
|
}
|
|
80
59
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return e.value
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
} else {
|
|
90
|
-
if (eventGropus?.onLoad) {
|
|
91
|
-
result = Object.keys(eventGropus?.onLoad)
|
|
92
|
-
result.push(result[0]);
|
|
60
|
+
export async function executeRefreshHandler(params: handlersProps) {
|
|
61
|
+
const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups)
|
|
62
|
+
for (const componentName of compToRefresh) {
|
|
63
|
+
for (const compEventConfig of params.eventGroups.onLoad[componentName]) {
|
|
64
|
+
await executeEvents({ ...params, config: compEventConfig, componentName });
|
|
93
65
|
}
|
|
94
66
|
}
|
|
95
|
-
return result;
|
|
96
67
|
}
|
|
97
|
-
|
|
98
|
-
const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
|
|
99
|
-
|
|
100
|
-
return Promise.all(compToRefresh.map(componentName => {
|
|
101
|
-
return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
|
|
102
|
-
return executeEvents({ ...params, config: compEventConfig, componentName });
|
|
103
|
-
}));
|
|
104
|
-
}))
|
|
105
|
-
};
|
|
106
|
-
export function executeApiRequest(params: any) {
|
|
68
|
+
async function executeApiEventHandler(params: handlersProps) {
|
|
107
69
|
const initialBody = { ...params.userValue?.payload };
|
|
108
70
|
const initialHeaders = {
|
|
109
71
|
"X-Requested-With": "XMLHttpRequest",
|
|
110
72
|
"Access-Control-Allow-Origin": "*"
|
|
111
73
|
};
|
|
74
|
+
const { body, headers } = await buildApiPayload(params.config, initialBody, initialHeaders, params.store, params.dynamicData, params.userValue, params.service)
|
|
112
75
|
|
|
113
|
-
const
|
|
114
|
-
return params.service[params.config.method](
|
|
76
|
+
const response = await params.service[params.config.method](
|
|
115
77
|
params.config.path,
|
|
116
|
-
|
|
117
|
-
{ headers:
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
};
|
|
78
|
+
body,
|
|
79
|
+
headers && { headers: headers }
|
|
80
|
+
);
|
|
81
|
+
return response;
|
|
82
|
+
}
|
|
122
83
|
|
|
123
|
-
function executeInBuiltFunctionHandler(params: handlersProps) {
|
|
84
|
+
async function executeInBuiltFunctionHandler(params: handlersProps) {
|
|
124
85
|
let parameter = {};
|
|
125
86
|
if (params.config.funcParametersCode) {
|
|
126
87
|
const makeFunc = eval(params.config.funcParametersCode)
|
|
127
88
|
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
|
|
128
|
-
params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service)
|
|
129
|
-
} else {
|
|
130
|
-
params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service)
|
|
131
89
|
}
|
|
90
|
+
params.serviceHolder[params.config.inBuiltFunctionType](parameter)
|
|
132
91
|
}
|
|
133
92
|
|
|
134
|
-
function executeCustomHandler(params: handlersProps) {
|
|
93
|
+
async function executeCustomHandler(params: handlersProps) {
|
|
135
94
|
const makeFunc = eval(params.config.eventCode)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
} else {
|
|
139
|
-
const response = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.componentName)
|
|
140
|
-
return response;
|
|
141
|
-
}
|
|
142
|
-
|
|
95
|
+
const response = await makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.componentName);
|
|
96
|
+
return response;
|
|
143
97
|
}
|
|
144
98
|
|
|
145
|
-
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
|
|
99
|
+
async function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
|
|
146
100
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
147
101
|
store.setSchema((pre) => {
|
|
148
102
|
return {
|
|
@@ -177,13 +131,14 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
177
131
|
}
|
|
178
132
|
else {
|
|
179
133
|
if (handlerResponse) {
|
|
180
|
-
store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse
|
|
134
|
+
store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data } });
|
|
135
|
+
const demoData = await asyncOperation();
|
|
181
136
|
}
|
|
182
137
|
}
|
|
183
138
|
}
|
|
184
139
|
|
|
185
140
|
const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
|
|
186
|
-
|
|
141
|
+
const finalBody = { ...userValue?.payload };
|
|
187
142
|
body.map((elem) => {
|
|
188
143
|
if (typeof elem?.value !== "string") {
|
|
189
144
|
finalBody[elem.key] = elem.value;
|
|
@@ -195,12 +150,7 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
|
|
|
195
150
|
else if (elem?.value?.startsWith("$")) {
|
|
196
151
|
const finalpath = elem.value.substring(1);
|
|
197
152
|
finalBody[elem.key] = _.get(formData, finalpath);;
|
|
198
|
-
} else
|
|
199
|
-
finalBody = { ...finalBody, ...formData };
|
|
200
|
-
} else if (elem?.value === "*") {
|
|
201
|
-
finalBody[elem.key] = formData;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
153
|
+
} else {
|
|
204
154
|
finalBody[elem.key] = elem.value;
|
|
205
155
|
}
|
|
206
156
|
}
|
|
@@ -219,40 +169,58 @@ const buildHeadersFormat = (headers: any[]) => {
|
|
|
219
169
|
return headerObj;
|
|
220
170
|
}
|
|
221
171
|
|
|
222
|
-
|
|
172
|
+
async function shouldEventExecute(params: handlersProps) {
|
|
223
173
|
const startEvent = params.config?.events?.filter(e => e.eventType === "onStart");
|
|
224
|
-
|
|
225
174
|
if (startEvent?.length > 0) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
});
|
|
175
|
+
const response = await executeEventsHandler({ ...params, config: startEvent[0] });
|
|
176
|
+
return response;
|
|
229
177
|
} else {
|
|
230
|
-
|
|
231
|
-
return Promise.resolve(true)
|
|
232
|
-
} else {
|
|
233
|
-
return true
|
|
234
|
-
}
|
|
178
|
+
return true
|
|
235
179
|
}
|
|
236
180
|
}
|
|
237
181
|
|
|
238
|
-
|
|
239
|
-
export function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service) {
|
|
182
|
+
export async function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service) {
|
|
240
183
|
if (compConfig?.headers) {
|
|
241
|
-
headers = buildHeadersFormat(compConfig.headers)
|
|
242
|
-
}
|
|
184
|
+
headers = buildHeadersFormat(compConfig.headers)
|
|
243
185
|
|
|
186
|
+
}
|
|
244
187
|
if (compConfig.body) {
|
|
245
188
|
body = { ...buildBodyFormat(compConfig.body, store.newData || store?.ctx?.core?.data || store.formData, userValue) };
|
|
246
189
|
}
|
|
247
|
-
|
|
248
|
-
const promiseChain = { body, headers };
|
|
249
|
-
|
|
250
|
-
|
|
251
190
|
if (compConfig.apiBody) {
|
|
252
191
|
const makeFunc = eval(compConfig.apiBody);
|
|
253
|
-
|
|
254
|
-
|
|
192
|
+
const data = await makeFunc(store, dynamicData, userValue, body);
|
|
193
|
+
body = data
|
|
194
|
+
}
|
|
195
|
+
return { body, headers };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function getRefreshElements(eventConfig: any, eventGropus: any) {
|
|
199
|
+
let result: string[] = [];
|
|
200
|
+
if (eventConfig?.refreshElements?.length > 0) {
|
|
201
|
+
result = eventConfig.refreshElements.map((e) => {
|
|
202
|
+
return e.value
|
|
203
|
+
})
|
|
255
204
|
|
|
205
|
+
} else {
|
|
206
|
+
if (eventGropus?.onLoad) {
|
|
207
|
+
result = Object.keys(eventGropus?.onLoad)
|
|
208
|
+
result.push(result[0]);
|
|
209
|
+
}
|
|
256
210
|
}
|
|
257
|
-
|
|
211
|
+
console.log(result);
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
export function asyncOperation() {
|
|
217
|
+
return new Promise((resolve, reject) => {
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
const success = true;
|
|
220
|
+
if (success) {
|
|
221
|
+
resolve("Operation completed successfully!");
|
|
222
|
+
reject(new Error("Operation failed!"));
|
|
223
|
+
}
|
|
224
|
+
}, 50);
|
|
225
|
+
});
|
|
258
226
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
2
|
import { doDownload, downloadFile } from "./downloadFile";
|
|
3
|
-
import { executeEvents, executeRefreshHandler } from "./events";
|
|
3
|
+
import { asyncOperation, executeEvents, executeRefreshHandler } from "./events";
|
|
4
4
|
import { handlersProps } from "./interface";
|
|
5
5
|
let compType: string;
|
|
6
6
|
let eventGroups: any = {};
|
|
@@ -13,14 +13,6 @@ const notifyUiSchema = {
|
|
|
13
13
|
layout: 6,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
interface funcParamsProps {
|
|
17
|
-
store: any,
|
|
18
|
-
dynamicData: any,
|
|
19
|
-
service: any,
|
|
20
|
-
userValue: any,
|
|
21
|
-
functionsProvider?: Record<string, any>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
16
|
export const extractEvents = (eventConfig: any) => {
|
|
25
17
|
function extractsConfigEvents(eventConfigObj: any) {
|
|
26
18
|
if (eventConfigObj.events) {
|
|
@@ -54,53 +46,41 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
54
46
|
}
|
|
55
47
|
return eventGroups;
|
|
56
48
|
};
|
|
49
|
+
|
|
50
|
+
interface funcParamsProps {
|
|
51
|
+
store: any,
|
|
52
|
+
dynamicData: any,
|
|
53
|
+
config: any,
|
|
54
|
+
uiSchema: any,
|
|
55
|
+
schema: any,
|
|
56
|
+
service: any,
|
|
57
|
+
userValue: any,
|
|
58
|
+
}
|
|
57
59
|
export default (funcParams: funcParamsProps) => {
|
|
60
|
+
eventGroups = {}
|
|
61
|
+
eventGroups = extractEvents(funcParams.config)
|
|
58
62
|
let executeEventsParameters: handlersProps = {
|
|
59
63
|
config: {}, componentName: "",
|
|
60
64
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
61
|
-
serviceHolder: { downloadFile, download: doDownload
|
|
62
|
-
functionsProvider: funcParams.functionsProvider,
|
|
65
|
+
serviceHolder: { downloadFile, download: doDownload }, eventGroups
|
|
63
66
|
};
|
|
64
67
|
return {
|
|
65
68
|
setPage: async function () {
|
|
66
|
-
funcParams.store.setFormdata({})
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (pageBasicDetailString) {
|
|
73
|
-
pageData = JSON.parse(pageBasicDetailString)
|
|
74
|
-
} else {
|
|
75
|
-
const pageId = await funcParams.service
|
|
76
|
-
.post("/page/getByName", data, {
|
|
77
|
-
headers: {
|
|
78
|
-
"Content-Type": "application/json",
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const response = await funcParams.service.get(
|
|
82
|
-
`/page/getById?id=${pageId?.data?.id}`,
|
|
83
|
-
{
|
|
84
|
-
headers: {
|
|
85
|
-
"Content-Type": "application/json",
|
|
86
|
-
},
|
|
69
|
+
funcParams.store.setFormdata({});
|
|
70
|
+
funcParams.store.setSchema(
|
|
71
|
+
(pre: any) => {
|
|
72
|
+
return {
|
|
73
|
+
...funcParams.schema, properties:
|
|
74
|
+
{ ...funcParams.schema.properties, ...pre.properties, }
|
|
87
75
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}))
|
|
94
|
-
}
|
|
95
|
-
const config = pageData?.config;
|
|
96
|
-
const uiSchema = pageData?.uiSchema;
|
|
97
|
-
const schema = pageData?.schema ?? { type: "object", properties: {} };
|
|
98
|
-
eventGroups = {}
|
|
99
|
-
eventGroups = extractEvents(config);
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
funcParams.uiSchema.elements.push(notifyUiSchema);
|
|
79
|
+
funcParams.store.setUiSchema(funcParams.uiSchema);
|
|
80
|
+
await asyncOperation()
|
|
100
81
|
executeEventsParameters = {
|
|
101
82
|
config: {}, componentName: "",
|
|
102
83
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
103
|
-
functionsProvider: funcParams.functionsProvider,
|
|
104
84
|
serviceHolder: this, eventGroups
|
|
105
85
|
}
|
|
106
86
|
await executeRefreshHandler({
|
|
@@ -108,47 +88,15 @@ export default (funcParams: funcParamsProps) => {
|
|
|
108
88
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
109
89
|
serviceHolder: this, eventGroups
|
|
110
90
|
})
|
|
111
|
-
funcParams.store.setSchema(
|
|
112
|
-
(pre: any) => {
|
|
113
|
-
return {
|
|
114
|
-
...schema, properties:
|
|
115
|
-
{ ...schema.properties, ...pre.properties, }
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
uiSchema.elements.push(notifyUiSchema);
|
|
120
|
-
funcParams.store.setUiSchema(uiSchema);
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
onCellRenderer: (cellParams) => {
|
|
124
|
-
let finalResponse = {};
|
|
125
|
-
cellParams.spanRef.current.style.color = "yellow";
|
|
126
|
-
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
127
|
-
for (const eventConfig of eventGroups?.onCellRenderer[path]) {
|
|
128
|
-
executeEventsParameters.store.functionParameters = cellParams
|
|
129
|
-
finalResponse = executeEvents({
|
|
130
|
-
...executeEventsParameters,
|
|
131
|
-
config: eventConfig,
|
|
132
|
-
componentName: path
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
console.log("finalResponse >> >> >> ", finalResponse)
|
|
136
|
-
return finalResponse
|
|
137
|
-
},
|
|
138
|
-
onClick: function () {
|
|
139
|
-
this.callHandler("onClick")
|
|
140
91
|
},
|
|
141
|
-
|
|
142
|
-
this.callHandler("
|
|
92
|
+
onClick: async function () {
|
|
93
|
+
await this.callHandler("onClick")
|
|
143
94
|
},
|
|
144
|
-
onFileDownload: function () {
|
|
145
|
-
this.callHandler("onDownload")
|
|
95
|
+
onFileDownload: async function () {
|
|
96
|
+
await this.callHandler("onDownload")
|
|
146
97
|
},
|
|
147
|
-
onFileUpload: function () {
|
|
148
|
-
this.callHandler("onUpload")
|
|
149
|
-
},
|
|
150
|
-
backHandler: function () {
|
|
151
|
-
funcParams.store.navigate(-1)
|
|
98
|
+
onFileUpload: async function () {
|
|
99
|
+
await this.callHandler("onUpload")
|
|
152
100
|
},
|
|
153
101
|
onPaginationChange: async function (paginationValues) {
|
|
154
102
|
const apiBody = [
|
|
@@ -167,8 +115,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
167
115
|
{ key: "searchValue", value: param.serachValue },
|
|
168
116
|
{ key: "currentValue", value: param.currentValue }
|
|
169
117
|
]
|
|
170
|
-
|
|
171
|
-
return response?.data;
|
|
118
|
+
return await this.updateConfigApiBody(param, apiBody)
|
|
172
119
|
}
|
|
173
120
|
},
|
|
174
121
|
onChange: async function () {
|
|
@@ -237,7 +184,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
237
184
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
238
185
|
for (const eventConfig of eventGroups?.[eventType]?.[path]) {
|
|
239
186
|
executeEventsParameters.store.functionParameters = functionParameters
|
|
240
|
-
|
|
187
|
+
await executeEvents({
|
|
241
188
|
...executeEventsParameters,
|
|
242
189
|
config: eventConfig,
|
|
243
190
|
componentName: path
|
|
@@ -245,10 +192,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
245
192
|
}
|
|
246
193
|
}
|
|
247
194
|
},
|
|
248
|
-
|
|
249
195
|
downloadFile: downloadFile,
|
|
250
196
|
download: doDownload,
|
|
251
|
-
...funcParams.functionsProvider
|
|
252
197
|
};
|
|
253
198
|
};
|
|
254
199
|
|
|
@@ -256,3 +201,9 @@ export default (funcParams: funcParamsProps) => {
|
|
|
256
201
|
|
|
257
202
|
|
|
258
203
|
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|