impaktapps-ui-builder 0.0.347 → 0.0.350
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 +153 -170
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +10 -10
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +2 -2
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +1 -3
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +10 -0
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +3 -29
- package/src/impaktapps-ui-builder/builder/services/event.ts +14 -24
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +2 -37
- package/src/impaktapps-ui-builder/builder/services/utils.ts +109 -0
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/clearLocalStorage.d.ts +0 -2
- package/dist/src/impaktapps-ui-builder/builder/services/getNavigationHistory.d.ts +0 -3
- package/dist/src/impaktapps-ui-builder/builder/services/saveHandler.d.ts +0 -2
- package/src/impaktapps-ui-builder/builder/services/clearLocalStorage.ts +0 -3
- package/src/impaktapps-ui-builder/builder/services/getNavigationHistory.ts +0 -27
- package/src/impaktapps-ui-builder/builder/services/saveHandler.ts +0 -29
|
@@ -5,7 +5,7 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
5
5
|
getFormdata: () => any;
|
|
6
6
|
getSchema: () => any;
|
|
7
7
|
okHandler: () => void;
|
|
8
|
-
|
|
8
|
+
saveHandler: () => Promise<void>;
|
|
9
9
|
onChange: () => void;
|
|
10
10
|
editComponents: () => void;
|
|
11
11
|
deleteComponents: () => void;
|
|
@@ -76,9 +76,9 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
76
76
|
};
|
|
77
77
|
required: string[];
|
|
78
78
|
};
|
|
79
|
-
savePageHandler: () => Promise<void>;
|
|
80
|
-
onChange: () => void;
|
|
81
79
|
okHandler: () => void;
|
|
80
|
+
saveHandler: () => Promise<void>;
|
|
81
|
+
onChange: () => void;
|
|
82
82
|
addEvent: () => void;
|
|
83
83
|
editEvent: () => void;
|
|
84
84
|
deleteEvent: () => void;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare function saveHandler(store: any, service: any, submitHandler: any, config: any): Promise<boolean>;
|
|
2
|
-
export declare const navigation: (store: any, isSubmitted: any, pageName?: string | undefined) => void;
|
|
3
1
|
interface funcParamsProps {
|
|
4
2
|
store: any;
|
|
5
3
|
dynamicData: any;
|
|
@@ -51,7 +49,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
51
49
|
};
|
|
52
50
|
backHandler: () => void;
|
|
53
51
|
onAddClickHandler: () => void;
|
|
54
|
-
|
|
52
|
+
saveHandler: () => Promise<void>;
|
|
55
53
|
Edit_Components: () => void;
|
|
56
54
|
Delete_Components: () => void;
|
|
57
55
|
eventAddHandler: () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const clearFromLocalStorage: () => void;
|
|
2
|
+
export default clearFromLocalStorage;
|
|
3
|
+
export declare const getNavigationHistory: (config: any, path: string | undefined) => {
|
|
4
|
+
pageName: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const saveFormdataInLocalStorage: (formData: any, path?: string) => any;
|
|
7
|
+
export declare const getFormdataFromLocalStorage: (path?: string) => any;
|
|
8
|
+
export declare function saveHandler(store: any, service: any, submitHandler: any, pageName: string): Promise<void>;
|
|
9
|
+
export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
|
|
10
|
+
export declare function okHandler(store: any): void;
|
|
@@ -6,4 +6,4 @@ export { schema } from "../builder/build/buildUiSchema";
|
|
|
6
6
|
export { default as buildConfig } from "../builder/build/buildConfig";
|
|
7
7
|
export { default as buildUiSchema } from "../builder/build/buildUiSchema";
|
|
8
8
|
export { buildSchema } from "../builder/build/buildUiSchema";
|
|
9
|
-
export { default as
|
|
9
|
+
export { default as clearFromLocalStorage } from "../builder/services/utils";
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import { ComponentSchema } from "../elements/UiSchema/Component/schema";
|
|
3
3
|
import { componentBasicUiSchema } from "../elements/UiSchema/Component/uiSchema";
|
|
4
|
-
import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
|
|
5
4
|
import { CoreSection } from "../build/uischema/coreSection";
|
|
6
5
|
import { EventSection } from "../build/uischema/eventSection";
|
|
7
6
|
import { buildPropertiesSection } from "../build/uischema/buildPropertiesSection";
|
|
@@ -9,7 +8,7 @@ import { StyleSection } from "../build/uischema/styleSection";
|
|
|
9
8
|
import { TableSection } from "../build/uischema/tableSection";
|
|
10
9
|
import { ValueTab } from "../build/uischema/valueTab";
|
|
11
10
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
12
|
-
import {
|
|
11
|
+
import { getFormdataFromLocalStorage, okHandler, saveFormdataInLocalStorage, saveHandler } from "./utils";
|
|
13
12
|
const sectionLabels = {
|
|
14
13
|
Select: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
15
14
|
MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
@@ -77,33 +76,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
77
76
|
getSchema: function () {
|
|
78
77
|
return ComponentSchema;
|
|
79
78
|
},
|
|
80
|
-
okHandler:
|
|
81
|
-
|
|
82
|
-
console.log(store.ctx.core.errors)
|
|
83
|
-
if (_.isEmpty(store.ctx.core.errors)) {
|
|
84
|
-
saveFormdataInLocalStorage(store.ctx.core.data,path)
|
|
85
|
-
store.navigate(-1)
|
|
86
|
-
store.setNotify({
|
|
87
|
-
SuccessMessage: "Save Successfully",
|
|
88
|
-
Success: true,
|
|
89
|
-
});
|
|
90
|
-
} else {
|
|
91
|
-
store.setValidation("ValidateAndShow");
|
|
92
|
-
store.setNotify({
|
|
93
|
-
Fail:true,
|
|
94
|
-
FailMessage:"Errors on Page"
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
savePageHandler: async () => {
|
|
99
|
-
const id = store.searchParams?.get("id");
|
|
100
|
-
const path = store.searchParams?.get("path");
|
|
101
|
-
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
102
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
103
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
104
|
-
navigation(store,isSubmitted,`/PageMaster?id=${id}`)
|
|
105
|
-
},
|
|
106
|
-
|
|
79
|
+
okHandler:()=>okHandler(store),
|
|
80
|
+
saveHandler: async ()=> await saveHandler(store,service,submitHandler,"PageMaster"),
|
|
107
81
|
onChange: function () {
|
|
108
82
|
if (
|
|
109
83
|
store?.formData?.type !== store?.newData?.type &&
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EventSchema } from "../elements/UiSchema/event/schema";
|
|
1
|
+
import { EventSchema } from "../elements/UiSchema/event/schema";
|
|
2
2
|
import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
|
|
3
3
|
import Component from "./component";
|
|
4
|
-
import { saveFormdataInLocalStorage } from "./
|
|
4
|
+
import { okHandler, saveFormdataInLocalStorage, saveHandler } from "./utils";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import { navigation, saveHandler } from "./pageMaster";
|
|
7
6
|
import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
8
7
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
9
8
|
import _ from "lodash";
|
|
@@ -11,7 +10,7 @@ import _ from "lodash";
|
|
|
11
10
|
export default (
|
|
12
11
|
store: any,
|
|
13
12
|
dynamicData: any,
|
|
14
|
-
submitHandler: any,
|
|
13
|
+
submitHandler: any,
|
|
15
14
|
service: any
|
|
16
15
|
) => {
|
|
17
16
|
return {
|
|
@@ -20,63 +19,54 @@ export default (
|
|
|
20
19
|
store.setFormdata(formdata);
|
|
21
20
|
const schema = await this.getSchema();
|
|
22
21
|
store.setSchema(schema);
|
|
23
|
-
|
|
22
|
+
this.refreshPage(formdata.Handler, store)
|
|
24
23
|
},
|
|
25
24
|
refreshPage: (handlerType: any, store: any) => {
|
|
26
25
|
const uiSchema = _.cloneDeep(EventUiSchema);
|
|
27
|
-
const schema:any = _.cloneDeep(EventSchema)
|
|
26
|
+
const schema: any = _.cloneDeep(EventSchema)
|
|
28
27
|
if (handlerType) {
|
|
29
28
|
if (handlerType === "custom") {
|
|
30
29
|
uiSchema.elements[1].elements[0].elements[2] = getTextArea("eventCode", "Write Custom Code", false)
|
|
31
|
-
schema.required = ["eventType","Handler","eventCode"]
|
|
30
|
+
schema.required = ["eventType", "Handler", "eventCode"]
|
|
32
31
|
|
|
33
32
|
} else if (handlerType === "api") {
|
|
34
33
|
uiSchema.elements[1].elements[0].elements[2] = APISection;
|
|
35
|
-
schema.required = ["eventType","Handler","method","path"]
|
|
34
|
+
schema.required = ["eventType", "Handler", "method", "path"]
|
|
36
35
|
} else if (handlerType === "inBuiltFunction") {
|
|
37
36
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
38
37
|
{ label: "RankProvider", value: "RankProvider" },
|
|
39
38
|
{ label: "Download File", value: "downloadFile" },
|
|
40
39
|
])
|
|
41
40
|
uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
|
|
42
|
-
schema.required = ["eventType","Handler","inBuiltFunctionType"]
|
|
41
|
+
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
43
42
|
} else if (handlerType === "refresh") {
|
|
44
43
|
uiSchema.elements[1].elements[0].elements[2] = refreshSectionUiSchema;
|
|
45
44
|
schema.properties.refreshElements.required = ["value"]
|
|
46
45
|
schema.properties.refreshElements.items.required = ["value"]
|
|
47
|
-
schema.required = ["eventType","Handler","refreshElements"]
|
|
46
|
+
schema.required = ["eventType", "Handler", "refreshElements"]
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
store.setSchema(schema)
|
|
51
50
|
store.setUiSchema(uiSchema)
|
|
52
51
|
},
|
|
53
52
|
|
|
54
|
-
getFormData: Component(store, dynamicData,submitHandler,service).getFormdata,
|
|
53
|
+
getFormData: Component(store, dynamicData, submitHandler, service).getFormdata,
|
|
55
54
|
getUiSchema: function () {
|
|
56
55
|
return EventUiSchema;
|
|
57
56
|
},
|
|
58
57
|
getSchema: () => {
|
|
59
58
|
return EventSchema;
|
|
60
59
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const path = store.searchParams?.get("path");
|
|
64
|
-
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
65
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
66
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
67
|
-
navigation(store,isSubmitted,`/PageMaster?id=${id}`)
|
|
68
|
-
},
|
|
69
|
-
|
|
60
|
+
okHandler: () => okHandler(store),
|
|
61
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler,"PageMaster"),
|
|
70
62
|
onChange: function () {
|
|
71
63
|
if (
|
|
72
64
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
73
65
|
store?.newData?.Handler !== undefined
|
|
74
66
|
) {
|
|
75
|
-
this.refreshPage(store.newData.Handler||store.formdata.Handler,store)
|
|
67
|
+
this.refreshPage(store.newData.Handler || store.formdata.Handler, store)
|
|
76
68
|
}
|
|
77
69
|
},
|
|
78
|
-
|
|
79
|
-
okHandler: Component(store, dynamicData,submitHandler,service).okHandler,
|
|
80
70
|
addEvent: function () {
|
|
81
71
|
const path = store.searchParams?.get("path");
|
|
82
72
|
if (!Array.isArray(store.formData.events)) {
|
|
@@ -98,7 +88,7 @@ export default (
|
|
|
98
88
|
this.setPage()
|
|
99
89
|
|
|
100
90
|
},
|
|
101
|
-
deleteEvent: Component(store, dynamicData,submitHandler,service).deleteEvent,
|
|
91
|
+
deleteEvent: Component(store, dynamicData, submitHandler, service).deleteEvent,
|
|
102
92
|
backHandler: function () {
|
|
103
93
|
store.navigate(-1)
|
|
104
94
|
},
|
|
@@ -2,38 +2,8 @@ import { PageMasterSchema } from "../elements/UiSchema/PageMaster/schema";
|
|
|
2
2
|
import { PageMasterUiSchema } from "../elements/UiSchema/PageMaster/uiSchema";
|
|
3
3
|
import _ from "lodash";
|
|
4
4
|
import Component from "./component";
|
|
5
|
-
import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./
|
|
6
|
-
import { schema } from "../build/buildUiSchema";
|
|
5
|
+
import { getFormdataFromLocalStorage, saveFormdataInLocalStorage, saveHandler } from "./utils";
|
|
7
6
|
|
|
8
|
-
export async function saveHandler(store, service, submitHandler, config) {
|
|
9
|
-
let isTrue = false;
|
|
10
|
-
if (_.isEmpty(store.ctx.core.errors)) {
|
|
11
|
-
try {
|
|
12
|
-
const saveReturn = await submitHandler(store, service,config);
|
|
13
|
-
isTrue = true;
|
|
14
|
-
} catch (err) {
|
|
15
|
-
isTrue = false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return isTrue;
|
|
19
|
-
}
|
|
20
|
-
export const navigation = (store, isSubmitted, pageName?:string|undefined) => {
|
|
21
|
-
if (isSubmitted) {
|
|
22
|
-
localStorage.removeItem("pageFormdata");
|
|
23
|
-
// store.navigate(id ? `/PageMaster?id=${id}` : '/PageMasterRecords');
|
|
24
|
-
store.navigate(pageName||-1)
|
|
25
|
-
store.setNotify({
|
|
26
|
-
SuccessMessage: "Submit Successfully",
|
|
27
|
-
Success: true,
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
store.setValidation("ValidateAndShow");
|
|
31
|
-
store.setNotify({
|
|
32
|
-
Fail: true,
|
|
33
|
-
FailMessage: "Errors on Page"
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
7
|
|
|
38
8
|
interface funcParamsProps {
|
|
39
9
|
store: any,
|
|
@@ -83,12 +53,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
83
53
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
84
54
|
);
|
|
85
55
|
},
|
|
86
|
-
|
|
87
|
-
saveFormdataInLocalStorage(store.ctx.core.data);
|
|
88
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
89
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
90
|
-
navigation(store,isSubmitted)
|
|
91
|
-
},
|
|
56
|
+
saveHandler: async ()=> await saveHandler(store,service,submitHandler,"/PageMasterRecords"),
|
|
92
57
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
93
58
|
Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
|
|
94
59
|
eventAddHandler: function () {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import buildConfig from "../build/buildConfig";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
|
|
4
|
+
const clearFromLocalStorage = () => {
|
|
5
|
+
localStorage.removeItem("pageFormdata")
|
|
6
|
+
}
|
|
7
|
+
export default clearFromLocalStorage;
|
|
8
|
+
export const getNavigationHistory = (config: any, path: string | undefined) => {
|
|
9
|
+
if (path) {
|
|
10
|
+
let urlRoutes: string = config.name;
|
|
11
|
+
const pathArrayAll = path.split(".");
|
|
12
|
+
const arr: any = []
|
|
13
|
+
pathArrayAll.map((e: string, i: number) => {
|
|
14
|
+
if (i === 0) {
|
|
15
|
+
arr.push(e)
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
arr.push(`${arr[i - 1]}.${e}`)
|
|
19
|
+
})
|
|
20
|
+
arr.map((e) => {
|
|
21
|
+
const data = _.get(config, e)
|
|
22
|
+
if (data) {
|
|
23
|
+
urlRoutes = urlRoutes + ` > ${data?.name || data?.eventType}`
|
|
24
|
+
} else {
|
|
25
|
+
urlRoutes = urlRoutes + " > NewComponent";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
})
|
|
29
|
+
return { pageName: urlRoutes }
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const saveFormdataInLocalStorage = (formData: any, path?: string) => {
|
|
35
|
+
let updatedFormdata: any;
|
|
36
|
+
if (path) {
|
|
37
|
+
const pageFormdata = getFormdataFromLocalStorage()
|
|
38
|
+
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
39
|
+
} else {
|
|
40
|
+
updatedFormdata = buildConfig(formData)
|
|
41
|
+
}
|
|
42
|
+
localStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata))
|
|
43
|
+
return updatedFormdata;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const getFormdataFromLocalStorage = (path?: string) => {
|
|
47
|
+
const pageFormdata = localStorage.getItem("pageFormdata") ? JSON.parse(localStorage.getItem("pageFormdata")) : undefined;
|
|
48
|
+
let returnValue: any;
|
|
49
|
+
if (path) {
|
|
50
|
+
returnValue = _.get(pageFormdata, path)
|
|
51
|
+
returnValue = { ...returnValue, ...getNavigationHistory(pageFormdata, path) }
|
|
52
|
+
}
|
|
53
|
+
if (!returnValue) {
|
|
54
|
+
returnValue = getNavigationHistory(pageFormdata, path)
|
|
55
|
+
}
|
|
56
|
+
return returnValue || pageFormdata;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export async function saveHandler(store, service, submitHandler, pageName: string) {
|
|
61
|
+
const id = store.searchParams?.get("id");
|
|
62
|
+
const path = store.searchParams?.get("path");
|
|
63
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
64
|
+
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
65
|
+
if (_.isEmpty(store.ctx.core.errors)) {
|
|
66
|
+
try {
|
|
67
|
+
const saveReturn = await submitHandler(store, service, config);
|
|
68
|
+
navigateHandler(store, true, pageName ? `/${pageName}?id=${id}` : pageName)
|
|
69
|
+
} catch (err) {
|
|
70
|
+
navigateHandler(store, false)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const navigateHandler = (store, isSubmitted, pageName?: string | boolean) => {
|
|
76
|
+
if (isSubmitted) {
|
|
77
|
+
localStorage.removeItem("pageFormdata");
|
|
78
|
+
store.navigate(pageName || -1)
|
|
79
|
+
store.setNotify({
|
|
80
|
+
SuccessMessage: "Submit Successfully",
|
|
81
|
+
Success: true,
|
|
82
|
+
});
|
|
83
|
+
} else {
|
|
84
|
+
store.setValidation("ValidateAndShow");
|
|
85
|
+
store.setNotify({
|
|
86
|
+
Fail: true,
|
|
87
|
+
FailMessage: "Errors on Page"
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function okHandler(store) {
|
|
93
|
+
const path = store.searchParams?.get("path");
|
|
94
|
+
console.log(store.ctx.core.errors)
|
|
95
|
+
if (_.isEmpty(store.ctx.core.errors)) {
|
|
96
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
97
|
+
store.navigate(-1)
|
|
98
|
+
store.setNotify({
|
|
99
|
+
SuccessMessage: "Save Successfully",
|
|
100
|
+
Success: true,
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
store.setValidation("ValidateAndShow");
|
|
104
|
+
store.setNotify({
|
|
105
|
+
Fail: true,
|
|
106
|
+
FailMessage: "Errors on Page"
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -7,4 +7,4 @@ export { schema} from "../builder/build/buildUiSchema"
|
|
|
7
7
|
export {default as buildConfig} from "../builder/build/buildConfig"
|
|
8
8
|
export {default as buildUiSchema} from "../builder/build/buildUiSchema"
|
|
9
9
|
export {buildSchema} from "../builder/build/buildUiSchema"
|
|
10
|
-
export {default as
|
|
10
|
+
export {default as clearFromLocalStorage} from "../builder/services/utils"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
|
|
3
|
-
export const getNavigationHistory = (config: any, path: string|undefined) => {
|
|
4
|
-
if (path) {
|
|
5
|
-
let urlRoutes: string = config.name;
|
|
6
|
-
const pathArrayAll = path.split(".");
|
|
7
|
-
const arr:any = []
|
|
8
|
-
pathArrayAll.map((e: string, i: number) => {
|
|
9
|
-
if (i === 0) {
|
|
10
|
-
arr.push(e)
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
arr.push(`${arr[i - 1]}.${e}`)
|
|
14
|
-
})
|
|
15
|
-
arr.map((e) => {
|
|
16
|
-
const data = _.get(config, e)
|
|
17
|
-
if(data){
|
|
18
|
-
urlRoutes = urlRoutes + ` > ${data?.name || data?.eventType}`
|
|
19
|
-
}else{
|
|
20
|
-
urlRoutes = urlRoutes + " > NewComponent";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
return { pageName: urlRoutes }
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import buildConfig from "../build/buildConfig";
|
|
2
|
-
import _ from "lodash";
|
|
3
|
-
import { getNavigationHistory } from "./getNavigationHistory";
|
|
4
|
-
|
|
5
|
-
export const saveFormdataInLocalStorage = (formData: any, path?: string) => {
|
|
6
|
-
let updatedFormdata:any;
|
|
7
|
-
if (path) {
|
|
8
|
-
const pageFormdata = getFormdataFromLocalStorage()
|
|
9
|
-
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
10
|
-
} else {
|
|
11
|
-
updatedFormdata = buildConfig(formData)
|
|
12
|
-
}
|
|
13
|
-
localStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata))
|
|
14
|
-
return updatedFormdata;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const getFormdataFromLocalStorage = (path?: string) => {
|
|
18
|
-
const pageFormdata = localStorage.getItem("pageFormdata")?JSON.parse(localStorage.getItem("pageFormdata")):undefined;
|
|
19
|
-
let returnValue: any;
|
|
20
|
-
if (path) {
|
|
21
|
-
returnValue = _.get(pageFormdata, path)
|
|
22
|
-
returnValue = { ...returnValue, ...getNavigationHistory(pageFormdata, path) }
|
|
23
|
-
}
|
|
24
|
-
if (!returnValue) {
|
|
25
|
-
returnValue = getNavigationHistory(pageFormdata, path)
|
|
26
|
-
}
|
|
27
|
-
return returnValue || pageFormdata;
|
|
28
|
-
|
|
29
|
-
}
|