impaktapps-ui-builder 0.0.595 → 0.0.751
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 +2200 -1675
- 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/buildCard.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildTable.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +23 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +170 -82
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +55 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +52 -23
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +10 -301
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/progressBar.d.ts +6 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +50 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/{lazyLoadingTable.d.ts → thoughtOfTheDay.d.ts} +6 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/timer.d.ts +1 -14
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.d.ts +3 -0
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +3 -0
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +8 -2
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +5 -0
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +5 -0
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +4 -4
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -1
- package/package.json +5 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +11 -7
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +21 -13
- package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +18 -13
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +10 -2
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +7 -16
- package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildRankCard.ts +4 -10
- package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +19 -4
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +23 -29
- package/src/impaktapps-ui-builder/builder/build/buildTextArea.ts +6 -0
- package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +22 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +27 -12
- package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +16 -19
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +10 -10
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +111 -56
- package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +1 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +188 -90
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +11 -11
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +44 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +13 -29
- package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +10 -367
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/progressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/rankCard.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/runnerBoyProgressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +45 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.ts +14 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/timer.ts +2 -16
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +3 -3
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +37 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +283 -182
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +4 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +344 -130
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +194 -80
- package/src/impaktapps-ui-builder/builder/services/component.ts +105 -26
- package/src/impaktapps-ui-builder/builder/services/event.ts +50 -9
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +32 -14
- package/src/impaktapps-ui-builder/builder/services/utils.ts +13 -13
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +26 -23
- package/src/impaktapps-ui-builder/runtime/services/service.ts +52 -52
- package/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.ts +0 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
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 { okHandler,
|
|
4
|
+
import { okHandler, saveFormdataInSessionStorage, saveHandler, getFormdataFromSessionStorage } from "./utils";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
6
|
import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
7
7
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
@@ -29,8 +29,20 @@ export default (
|
|
|
29
29
|
if (handlerType) {
|
|
30
30
|
if (handlerType === "custom") {
|
|
31
31
|
uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
uiSchema.elements[1].elements[0].elements[3] = {
|
|
33
|
+
type: "Control",
|
|
34
|
+
scope: "#/properties/emptyBox",
|
|
35
|
+
options: {
|
|
36
|
+
widget: "EmptyBox",
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
config: {
|
|
40
|
+
layout: { xs: 0, sm: 6, md: 0, lg: 0 },
|
|
41
|
+
main: {},
|
|
42
|
+
style:{}
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
|
|
34
46
|
schema.required = ["eventType", "Handler", "eventCode"]
|
|
35
47
|
|
|
36
48
|
} else if (handlerType === "api") {
|
|
@@ -38,12 +50,26 @@ export default (
|
|
|
38
50
|
uiSchema.elements[1].elements[0].elements[3] = APISection;
|
|
39
51
|
schema.required = ["eventType", "Handler", "method", "path"]
|
|
40
52
|
} else if (handlerType === "inBuiltFunction") {
|
|
53
|
+
|
|
41
54
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
42
55
|
{ label: "RankProvider", value: "RankProvider" },
|
|
43
56
|
{ label: "Download File", value: "downloadFile" },
|
|
44
57
|
{ label: "Download Blob File", value: "downloadBlobFile" }
|
|
45
58
|
])
|
|
46
|
-
uiSchema.elements[1].elements[0].elements[3] =
|
|
59
|
+
uiSchema.elements[1].elements[0].elements[3] = {
|
|
60
|
+
type: "Control",
|
|
61
|
+
scope: "#/properties/emptyBox",
|
|
62
|
+
options: {
|
|
63
|
+
widget: "EmptyBox",
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
config: {
|
|
67
|
+
layout: { xs: 6, sm: 6, md: 0, lg: 0 },
|
|
68
|
+
main: {},
|
|
69
|
+
style:{}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
uiSchema.elements[1].elements[0].elements[4] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true);
|
|
47
73
|
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
48
74
|
} else if (handlerType === "refresh") {
|
|
49
75
|
uiSchema.elements[1].elements[0].elements[2] = emptyBox;
|
|
@@ -59,6 +85,10 @@ export default (
|
|
|
59
85
|
...functionsName
|
|
60
86
|
]
|
|
61
87
|
}
|
|
88
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
89
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(uiSchema);
|
|
90
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
91
|
+
}
|
|
62
92
|
store.setSchema(schema)
|
|
63
93
|
store.setUiSchema(uiSchema)
|
|
64
94
|
},
|
|
@@ -68,7 +98,11 @@ export default (
|
|
|
68
98
|
return EventUiSchema;
|
|
69
99
|
},
|
|
70
100
|
getSchema: () => {
|
|
71
|
-
|
|
101
|
+
const schema = _.cloneDeep(EventSchema);
|
|
102
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
103
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
104
|
+
}
|
|
105
|
+
return schema;
|
|
72
106
|
},
|
|
73
107
|
okHandler: () => okHandler(store),
|
|
74
108
|
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
@@ -85,7 +119,7 @@ export default (
|
|
|
85
119
|
if (!Array.isArray(store.formData.events)) {
|
|
86
120
|
store.formData.events = []
|
|
87
121
|
}
|
|
88
|
-
|
|
122
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
89
123
|
const finalPath = `${path}.events[${store.formData?.events?.length}]`
|
|
90
124
|
store.searchParams.set("path", finalPath)
|
|
91
125
|
store.setSearchParams(store.searchParams)
|
|
@@ -94,7 +128,7 @@ export default (
|
|
|
94
128
|
editEvent: function () {
|
|
95
129
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
130
|
const path = store.searchParams?.get("path");
|
|
97
|
-
|
|
131
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
98
132
|
const finalPath = `${path}.events[${rowId}]`
|
|
99
133
|
store.searchParams.set("path", finalPath)
|
|
100
134
|
store.setSearchParams(store.searchParams)
|
|
@@ -110,8 +144,15 @@ export default (
|
|
|
110
144
|
},
|
|
111
145
|
deletePopUpEvent: function(){
|
|
112
146
|
const rowId = dynamicData.path.split(".")[1];
|
|
113
|
-
|
|
147
|
+
sessionStorage.setItem('rowId',rowId);
|
|
114
148
|
store.updateDialog("popUpEvent");
|
|
115
|
-
}
|
|
149
|
+
},
|
|
150
|
+
copyPasteElement: function(){
|
|
151
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
|
|
152
|
+
},
|
|
153
|
+
RemoveItemButton: function(){
|
|
154
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
|
|
155
|
+
},
|
|
156
|
+
|
|
116
157
|
}
|
|
117
158
|
};
|
|
@@ -2,7 +2,7 @@ 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 {
|
|
5
|
+
import { getFormdataFromSessionStorage, saveFormdataInSessionStorage, saveHandler } from "./utils";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface funcParamsProps {
|
|
@@ -26,21 +26,29 @@ export default (funcParams: funcParamsProps) => {
|
|
|
26
26
|
getFormdata: async function () {
|
|
27
27
|
const id = store.searchParams?.get("id");
|
|
28
28
|
const config: any = await funcParams.pageConfigProvider(id)
|
|
29
|
-
const formData =
|
|
29
|
+
const formData = getFormdataFromSessionStorage()
|
|
30
30
|
if (formData) {
|
|
31
31
|
return formData;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
saveFormdataInSessionStorage(config)
|
|
34
34
|
return config
|
|
35
35
|
},
|
|
36
36
|
getUiSchema: function () {
|
|
37
|
-
|
|
37
|
+
const UiSchema = _.cloneDeep(PageMasterUiSchema(store.theme.myTheme));
|
|
38
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
39
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(UiSchema)
|
|
40
|
+
}
|
|
41
|
+
return UiSchema;
|
|
38
42
|
},
|
|
39
43
|
getSchema: () => {
|
|
40
|
-
|
|
44
|
+
const schema = _.cloneDeep(PageMasterSchema);
|
|
45
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
46
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
47
|
+
}
|
|
48
|
+
return schema;
|
|
41
49
|
},
|
|
42
50
|
backHandler: () => {
|
|
43
|
-
|
|
51
|
+
sessionStorage.removeItem("pageFormdata")
|
|
44
52
|
store.navigate("/PageMasterRecords");
|
|
45
53
|
},
|
|
46
54
|
onAddClickHandler: function () {
|
|
@@ -48,7 +56,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
48
56
|
if (!Array.isArray(store.formData.elements)) {
|
|
49
57
|
store.formData.elements = []
|
|
50
58
|
}
|
|
51
|
-
const response =
|
|
59
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
52
60
|
if (id) {
|
|
53
61
|
store.navigate(
|
|
54
62
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
@@ -72,34 +80,44 @@ export default (funcParams: funcParamsProps) => {
|
|
|
72
80
|
if (!Array.isArray(store.formData.events)) {
|
|
73
81
|
store.formData.events = []
|
|
74
82
|
}
|
|
75
|
-
|
|
83
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
76
84
|
const finalPath = `events[${store.formData.events.length}]`
|
|
77
85
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
78
86
|
},
|
|
79
87
|
editEvent: function () {
|
|
80
88
|
const rowId = dynamicData.path.split(".")[1];
|
|
81
89
|
const id = store.searchParams?.get("id");
|
|
82
|
-
|
|
90
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
83
91
|
const finalPath = `events[${rowId}]`
|
|
84
92
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
85
93
|
},
|
|
86
94
|
deleteEvent: function () {
|
|
87
|
-
const rowId =
|
|
95
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
88
96
|
store.formData.events.splice(rowId, 1);
|
|
89
|
-
const response =
|
|
97
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
90
98
|
store.setFormdata(response);
|
|
91
99
|
store.updateDialog("popUpPageMasterEvent");
|
|
92
|
-
|
|
100
|
+
sessionStorage.removeItem('rowId');
|
|
93
101
|
},
|
|
94
102
|
deletePopUpComponent: function(){
|
|
95
103
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
|
-
|
|
104
|
+
sessionStorage.setItem('rowId',rowId);
|
|
97
105
|
store.updateDialog("popUpPageMasterComponent");
|
|
98
106
|
},
|
|
99
107
|
deletePopUpEvent: function(){
|
|
100
108
|
const rowId = dynamicData.path.split(".")[1];
|
|
101
|
-
|
|
109
|
+
sessionStorage.setItem('rowId',rowId);
|
|
102
110
|
store.updateDialog("popUpPageMasterEvent");
|
|
103
111
|
},
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
copyPasteElement: function(){
|
|
115
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
RemoveItemButton: function(){
|
|
119
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
|
|
120
|
+
},
|
|
121
|
+
|
|
104
122
|
}
|
|
105
123
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import buildConfig from "../build/buildConfig";
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const clearFromSessionStorage = () => {
|
|
5
|
+
sessionStorage.removeItem("pageFormdata")
|
|
6
6
|
}
|
|
7
|
-
export default
|
|
7
|
+
export default clearFromSessionStorage;
|
|
8
8
|
export const getNavigationHistory = (config: any, path: string | undefined) => {
|
|
9
9
|
if (path) {
|
|
10
10
|
let urlRoutes: string = config.name;
|
|
@@ -31,20 +31,20 @@ export const getNavigationHistory = (config: any, path: string | undefined) => {
|
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const
|
|
34
|
+
export const saveFormdataInSessionStorage = (formData: any, path?: string) => {
|
|
35
35
|
let updatedFormdata: any;
|
|
36
36
|
if (path) {
|
|
37
|
-
const pageFormdata =
|
|
37
|
+
const pageFormdata = getFormdataFromSessionStorage()
|
|
38
38
|
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
39
39
|
} else {
|
|
40
40
|
updatedFormdata = buildConfig(formData)
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
sessionStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata))
|
|
43
43
|
return updatedFormdata;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const
|
|
47
|
-
const pageFormdata =
|
|
46
|
+
export const getFormdataFromSessionStorage = (path?: string) => {
|
|
47
|
+
const pageFormdata = sessionStorage.getItem("pageFormdata") ? JSON.parse(sessionStorage.getItem("pageFormdata")) : undefined;
|
|
48
48
|
let returnValue: any;
|
|
49
49
|
if (path) {
|
|
50
50
|
returnValue = _.get(pageFormdata, path)
|
|
@@ -60,12 +60,12 @@ export const getFormdataFromLocalStorage = (path?: string) => {
|
|
|
60
60
|
export async function saveHandler(store, service, submitHandler, pageName?: string) {
|
|
61
61
|
const id = store.searchParams?.get("id");
|
|
62
62
|
const path = store.searchParams?.get("path");
|
|
63
|
-
|
|
64
|
-
const config = JSON.parse(
|
|
63
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
64
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
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=${saveReturn.id}` : "/PageMasterRecords")
|
|
68
|
+
navigateHandler(store, true, pageName ? `/${pageName}?id=${saveReturn.response.id}` : "/PageMasterRecords")
|
|
69
69
|
} catch (err) {
|
|
70
70
|
navigateHandler(store, false)
|
|
71
71
|
}
|
|
@@ -74,7 +74,7 @@ export async function saveHandler(store, service, submitHandler, pageName?: stri
|
|
|
74
74
|
|
|
75
75
|
export const navigateHandler = (store, isSubmitted, pageName?: string | boolean) => {
|
|
76
76
|
if (isSubmitted) {
|
|
77
|
-
|
|
77
|
+
sessionStorage.removeItem("pageFormdata");
|
|
78
78
|
store.navigate(pageName || -1)
|
|
79
79
|
store.setNotify({
|
|
80
80
|
SuccessMessage: "Submit Successfully",
|
|
@@ -92,7 +92,7 @@ export const navigateHandler = (store, isSubmitted, pageName?: string | boolean)
|
|
|
92
92
|
export function okHandler(store) {
|
|
93
93
|
const path = store.searchParams?.get("path");
|
|
94
94
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
95
|
-
|
|
95
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
96
96
|
store.navigate(-1)
|
|
97
97
|
store.setNotify({
|
|
98
98
|
SuccessMessage: "Save Successfully",
|
|
@@ -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 clearFromSessionStorage} from "../builder/services/utils"
|
|
@@ -90,7 +90,6 @@ export function getRefreshElements(eventConfig: any, eventGropus: any) {
|
|
|
90
90
|
} else {
|
|
91
91
|
if (eventGropus?.onLoad) {
|
|
92
92
|
result = Object.keys(eventGropus?.onLoad)
|
|
93
|
-
result.push(result[0]);
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
return result;
|
|
@@ -147,35 +146,39 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
|
|
150
|
-
if (eventConfig.type === "Select" &&
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
...pre
|
|
155
|
-
...pre.properties
|
|
156
|
-
|
|
149
|
+
if (eventConfig.type === "Select" && handlerResponse?.data) {
|
|
150
|
+
if (!_.isEmpty(handlerResponse?.data)) {
|
|
151
|
+
store.setSchema((pre) => {
|
|
152
|
+
return {
|
|
153
|
+
...pre, properties: {
|
|
154
|
+
...pre.properties, [componentName]: {
|
|
155
|
+
...pre.properties?.[componentName],
|
|
156
|
+
oneOf: handlerResponse.data
|
|
157
|
+
}
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
160
|
+
})
|
|
161
|
+
}
|
|
161
162
|
}
|
|
162
|
-
else if (eventConfig.type === "MultipleSelect" &&
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
...pre
|
|
167
|
-
...pre.properties
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
else if (eventConfig.type === "MultipleSelect" && handlerResponse?.data) {
|
|
164
|
+
if (!_.isEmpty(handlerResponse?.data)) {
|
|
165
|
+
store.setSchema((pre) => {
|
|
166
|
+
return {
|
|
167
|
+
...pre, properties: {
|
|
168
|
+
...pre.properties, [componentName]: {
|
|
169
|
+
...pre.properties?.[componentName],
|
|
170
|
+
type: "array",
|
|
171
|
+
items: {
|
|
172
|
+
oneOf: handlerResponse?.data
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
176
179
|
}
|
|
177
180
|
else if (eventConfig.type === "page") {
|
|
178
|
-
if ((
|
|
181
|
+
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
179
182
|
store.newData = {
|
|
180
183
|
...store.newData,
|
|
181
184
|
...handlerResponse?.data
|
|
@@ -207,7 +210,7 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any, store: any)
|
|
|
207
210
|
}
|
|
208
211
|
else if (elem?.value?.startsWith("$local")) {
|
|
209
212
|
const finalpath = elem.value.substring(7);
|
|
210
|
-
const value = JSON.parse(
|
|
213
|
+
const value = JSON.parse(sessionStorage.getItem(finalpath) || '""')
|
|
211
214
|
finalBody[elem.key] = value;
|
|
212
215
|
}
|
|
213
216
|
else if (elem?.value?.startsWith("$")) {
|
|
@@ -78,12 +78,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
78
78
|
setPage: async function () {
|
|
79
79
|
funcParams.store.setFormdata({});
|
|
80
80
|
funcParams.store.newData = {};
|
|
81
|
-
const pageBasicDetailString =
|
|
81
|
+
const pageBasicDetailString = sessionStorage.getItem("pagemasterMetaData")
|
|
82
82
|
if (pageBasicDetailString) {
|
|
83
83
|
pageData = JSON.parse(pageBasicDetailString)
|
|
84
84
|
} else {
|
|
85
85
|
pageData = await funcParams.pageDataProvider();
|
|
86
|
-
|
|
86
|
+
sessionStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
87
87
|
schema: pageData?.schema,
|
|
88
88
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
89
89
|
}))
|
|
@@ -101,22 +101,20 @@ export default (funcParams: funcParamsProps) => {
|
|
|
101
101
|
type: "HorizontalLayout",
|
|
102
102
|
config: {
|
|
103
103
|
main: {
|
|
104
|
-
direction:
|
|
104
|
+
direction: "row",
|
|
105
105
|
},
|
|
106
106
|
style: {
|
|
107
107
|
flexDirection: "row",
|
|
108
108
|
position: "absolute",
|
|
109
109
|
bottom: 0,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
overflow: 'hidden',
|
|
110
|
+
height: "fit-content",
|
|
111
|
+
overflow: "hidden",
|
|
113
112
|
zIndex: 1000,
|
|
114
|
-
width:
|
|
115
|
-
}
|
|
113
|
+
width: "inherit",
|
|
114
|
+
},
|
|
116
115
|
},
|
|
117
116
|
elements: [
|
|
118
117
|
{
|
|
119
|
-
|
|
120
118
|
type: "Control",
|
|
121
119
|
scope: "#/properties/FooterText",
|
|
122
120
|
options: {
|
|
@@ -124,86 +122,88 @@ export default (funcParams: funcParamsProps) => {
|
|
|
124
122
|
},
|
|
125
123
|
config: {
|
|
126
124
|
main: {
|
|
127
|
-
heading: "Copywriter@ACT21.IO"
|
|
125
|
+
heading: "Copywriter@ACT21.IO",
|
|
128
126
|
},
|
|
129
127
|
style: {
|
|
130
|
-
color: theme?.palette?.text
|
|
131
|
-
fontSize:
|
|
132
|
-
textAlign:
|
|
133
|
-
lineHeight:
|
|
134
|
-
width:
|
|
135
|
-
left:
|
|
136
|
-
position:
|
|
128
|
+
color: theme?.palette?.text?.disabled || "#AFAFAF",
|
|
129
|
+
fontSize: "12px",
|
|
130
|
+
textAlign: "center",
|
|
131
|
+
lineHeight: 2,
|
|
132
|
+
width: "fit-content",
|
|
133
|
+
left: "50%",
|
|
134
|
+
position: "relative",
|
|
137
135
|
margin: 0,
|
|
138
136
|
flexGrow: 1,
|
|
139
|
-
height: 0
|
|
140
|
-
|
|
137
|
+
height: 0,
|
|
138
|
+
transform: "translate(-50%, 0%)",
|
|
139
|
+
},
|
|
141
140
|
},
|
|
142
141
|
},
|
|
143
142
|
{
|
|
144
143
|
type: "Control",
|
|
145
|
-
scope: "#/properties/
|
|
144
|
+
scope: "#/properties/FooterBackIcon",
|
|
146
145
|
options: {
|
|
147
146
|
widget: "Box",
|
|
148
147
|
},
|
|
149
148
|
config: {
|
|
150
149
|
main: {
|
|
151
|
-
iconName:
|
|
150
|
+
iconName: "PrevIcon",
|
|
152
151
|
onClick: "backHandler",
|
|
153
|
-
width:
|
|
152
|
+
width: "fit-content",
|
|
154
153
|
},
|
|
155
154
|
style: {
|
|
156
|
-
fill: theme
|
|
155
|
+
fill: theme?.palette?.primary?.main,
|
|
157
156
|
width: 20,
|
|
158
157
|
height: 0,
|
|
159
|
-
margin: 0,
|
|
158
|
+
// margin: 0,
|
|
160
159
|
top: 0,
|
|
161
|
-
right:
|
|
162
|
-
position:
|
|
163
|
-
fontSize:
|
|
164
|
-
cursor:
|
|
165
|
-
|
|
166
|
-
fill: theme
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
right: { xs: "12px", sm: "84px" },
|
|
161
|
+
position: "absolute",
|
|
162
|
+
fontSize: "12px",
|
|
163
|
+
cursor: "pointer",
|
|
164
|
+
":hover": {
|
|
165
|
+
fill: theme?.palette?.primary?.dark,
|
|
166
|
+
},
|
|
167
|
+
marginRight: "13px",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
type: "Control",
|
|
173
|
-
scope: "#/properties/
|
|
174
|
-
|
|
173
|
+
scope: "#/properties/FooterBackHandlerText",
|
|
175
174
|
options: {
|
|
176
175
|
widget: "Box",
|
|
177
176
|
},
|
|
178
177
|
config: {
|
|
179
178
|
main: {
|
|
180
179
|
heading: "Previous Page",
|
|
181
|
-
onClick: "backHandler"
|
|
180
|
+
onClick: "backHandler",
|
|
182
181
|
},
|
|
183
182
|
style: {
|
|
184
|
-
|
|
183
|
+
display: { xs: "none", sm: "flex" },
|
|
184
|
+
textAlign: "left",
|
|
185
185
|
lineHeight: 1,
|
|
186
186
|
height: 0,
|
|
187
|
-
width:
|
|
188
|
-
color: theme
|
|
189
|
-
fontSize: "
|
|
190
|
-
cursor:
|
|
191
|
-
marginLeft:
|
|
192
|
-
|
|
187
|
+
width: "fit-content",
|
|
188
|
+
color: theme?.palette?.primary?.main,
|
|
189
|
+
fontSize: "14px",
|
|
190
|
+
cursor: "pointer",
|
|
191
|
+
marginLeft: "2px",
|
|
192
|
+
|
|
193
193
|
top: 3,
|
|
194
|
-
right:
|
|
195
|
-
position:
|
|
196
|
-
|
|
197
|
-
color: theme
|
|
198
|
-
}
|
|
199
|
-
|
|
194
|
+
right: "12px",
|
|
195
|
+
position: "absolute",
|
|
196
|
+
":hover": {
|
|
197
|
+
color: theme?.palette?.primary?.dark,
|
|
198
|
+
},
|
|
199
|
+
marginRight: "4px",
|
|
200
|
+
},
|
|
200
201
|
},
|
|
201
202
|
},
|
|
202
|
-
]
|
|
203
|
+
],
|
|
203
204
|
}
|
|
204
205
|
);
|
|
205
206
|
const schema = pageData?.schema ?? { type: "object", properties: {} };
|
|
206
|
-
eventGroups = {}
|
|
207
207
|
eventGroups = extractEvents(config);
|
|
208
208
|
executeEventsParameters = {
|
|
209
209
|
config: {}, componentName: "",
|
|
@@ -219,7 +219,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
219
219
|
funcParams.store.setSchema(
|
|
220
220
|
(pre: any) => {
|
|
221
221
|
return {
|
|
222
|
-
...schema, properties:
|
|
222
|
+
...schema,...pre, properties:
|
|
223
223
|
{ ...schema.properties, ...pre.properties, }
|
|
224
224
|
}
|
|
225
225
|
}
|