impaktapps-ui-builder 0.0.592-alpha.1 → 0.0.592-alpha.11
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 +68 -48
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +15 -15
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +0 -1
- 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 +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -0
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +3 -1
- package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +9 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +0 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +15 -22
- package/src/impaktapps-ui-builder/builder/services/event.ts +4 -4
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +12 -12
- package/src/impaktapps-ui-builder/builder/services/utils.ts +12 -12
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +4 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const clearFromSessionStorage: () => void;
|
|
2
|
+
export default clearFromSessionStorage;
|
|
3
3
|
export declare const getNavigationHistory: (config: any, path: string | undefined) => {
|
|
4
4
|
pageName: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const saveFormdataInSessionStorage: (formData: any, path?: string) => any;
|
|
7
|
+
export declare const getFormdataFromSessionStorage: (path?: string) => any;
|
|
8
8
|
export declare function saveHandler(store: any, service: any, submitHandler: any, pageName?: string): Promise<void>;
|
|
9
9
|
export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
|
|
10
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 clearFromSessionStorage } from "../builder/services/utils";
|
package/package.json
CHANGED
|
@@ -9,11 +9,15 @@ const buildHorizontalBarGraph = (config:any,componentScope:string) => {
|
|
|
9
9
|
if (config.layout) {
|
|
10
10
|
horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
|
|
11
11
|
}
|
|
12
|
+
horizontalBarGraph.config.main.type = config.graphType;
|
|
12
13
|
horizontalBarGraph.scope = componentScope;
|
|
13
14
|
horizontalBarGraph.config.main.header = config.heading;
|
|
14
15
|
if (config.barColor) {
|
|
15
16
|
horizontalBarGraph.config.barStyle.color = config.barColor;
|
|
16
17
|
}
|
|
18
|
+
if (config.xAxisValue) {
|
|
19
|
+
horizontalBarGraph.config.main.xAxisValue = config.xAxisValue;
|
|
20
|
+
}
|
|
17
21
|
if (config.containerBackground) {
|
|
18
22
|
horizontalBarGraph.config.containerStyle.background =
|
|
19
23
|
config.containerBackground;
|
|
@@ -24,7 +24,9 @@ export const buildPieGraph = (config, componentScope) => {
|
|
|
24
24
|
if (config.legendLabels) {
|
|
25
25
|
pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
if (config.xAxisValue) {
|
|
28
|
+
pieGraph.config.main.xAxisValue = config.xAxisValue;
|
|
29
|
+
}
|
|
28
30
|
if (config.pieArcColors) {
|
|
29
31
|
pieGraph.config.style = {
|
|
30
32
|
pieStyle: {
|
|
@@ -25,7 +25,7 @@ export const buildSchema = (config: any) => {
|
|
|
25
25
|
|
|
26
26
|
}
|
|
27
27
|
buildRule(config)
|
|
28
|
-
window.
|
|
28
|
+
window.sessionStorage.setItem("schemaDemo",JSON.stringify(schema))
|
|
29
29
|
return schema;
|
|
30
30
|
};
|
|
31
31
|
export default buildSchema;
|
|
@@ -15,6 +15,9 @@ export const buildStackbarGraph = (config:any,componentScope:string) => {
|
|
|
15
15
|
if (config.barColor) {
|
|
16
16
|
barGraph.config.barStyle.color = config.barColor;
|
|
17
17
|
}
|
|
18
|
+
if (config.xAxisValue) {
|
|
19
|
+
barGraph.config.main.xAxisValue = config.xAxisValue;
|
|
20
|
+
}
|
|
18
21
|
if (config.height) {
|
|
19
22
|
barGraph.config.style.containerStyle.height = config.height;
|
|
20
23
|
}
|
|
@@ -264,6 +264,7 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
264
264
|
elements = buildPieGraph(config, componentScope);
|
|
265
265
|
break;
|
|
266
266
|
case "HorizontalBarGraph":
|
|
267
|
+
case "HorizontalStackBarGraph":
|
|
267
268
|
elements = buildHorizontalBarGraph(config, componentScope);
|
|
268
269
|
break;
|
|
269
270
|
}
|
|
@@ -342,6 +342,14 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
342
342
|
getInputField("iconName", "Icon Name")];
|
|
343
343
|
break;
|
|
344
344
|
case "ProgressBar":
|
|
345
|
+
uiSchema.elements = [
|
|
346
|
+
getInputField("heading", "Heading"),
|
|
347
|
+
getInputField("bottomLabel_1", "First BottomLabel"),
|
|
348
|
+
getInputField("bottomLabel_2", "Second BottomLabel"),
|
|
349
|
+
getInputField("bottomLabel_3", "Third BottomLabel"),
|
|
350
|
+
emptyBox("ProgressBarCardEmpty1"), emptyBox("ProgressBarCardEmpty2")
|
|
351
|
+
];
|
|
352
|
+
break;
|
|
345
353
|
case "ProgressBarCard":
|
|
346
354
|
uiSchema.elements = [
|
|
347
355
|
getInputField("heading", "Heading"),
|
|
@@ -382,6 +390,7 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
382
390
|
{ label: "Line Graph", value: "LineGraph" },
|
|
383
391
|
{ label: "Pie Graph", value: "PieGraph" },
|
|
384
392
|
{ label: "Horizontal Bar Graph", value: "HorizontalBarGraph" },
|
|
393
|
+
{ label: "Stack Horizontal Bar Graph", value: "HorizontalStackBarGraph" }
|
|
385
394
|
]),
|
|
386
395
|
getInputField("leftLabel", "Left Label"),
|
|
387
396
|
getInputField("bottomLabel", "Bottom Label"),
|
|
@@ -273,6 +273,7 @@ export const ComponentSchema: any = {
|
|
|
273
273
|
{ title: "Line Graph", const: "LineGraph" },
|
|
274
274
|
{ title: "Pie Graph", const: "PieGraph" },
|
|
275
275
|
{ title: "Horizontal Bar Graph", const: "HorizontalBarGraph" },
|
|
276
|
+
{ title: "Stack Horizontal Bar Graph", const: "HorizontalStackBarGraph" }
|
|
276
277
|
]
|
|
277
278
|
},
|
|
278
279
|
iconName: {
|
|
@@ -8,7 +8,7 @@ import { StyleSection } from "../build/uischema/styleSection";
|
|
|
8
8
|
import { TableSection } from "../build/uischema/tableSection";
|
|
9
9
|
import { ValueTab } from "../build/uischema/valueTab";
|
|
10
10
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
11
|
-
import {
|
|
11
|
+
import { getFormdataFromSessionStorage, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
|
|
12
12
|
const sectionLabels = {
|
|
13
13
|
Select: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
14
14
|
MultipleSelect: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
@@ -76,7 +76,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
76
76
|
refreshPage: refreshPage,
|
|
77
77
|
getFormdata: function () {
|
|
78
78
|
const path = store.searchParams?.get("path");
|
|
79
|
-
return
|
|
79
|
+
return getFormdataFromSessionStorage(path)
|
|
80
80
|
},
|
|
81
81
|
getSchema: function () {
|
|
82
82
|
return ComponentSchema;
|
|
@@ -95,7 +95,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
95
95
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
96
|
const path = store.searchParams?.get("path");
|
|
97
97
|
const id = store.searchParams?.get("id");
|
|
98
|
-
|
|
98
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
99
99
|
if (path) {
|
|
100
100
|
const path = store.searchParams?.get("path");
|
|
101
101
|
const finalPath = `${path}.elements[${rowId}]`
|
|
@@ -108,33 +108,33 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
108
108
|
},
|
|
109
109
|
deleteComponents: function (shouldUpdateDialog: boolean = true) {
|
|
110
110
|
const path = store.searchParams?.get("path");
|
|
111
|
-
const rowId =
|
|
111
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
112
112
|
store.formData.elements.splice(rowId, 1);
|
|
113
|
-
const response =
|
|
113
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
114
114
|
const data = path ? _.get(response, path) : response;
|
|
115
115
|
store.setFormdata(data);
|
|
116
116
|
if (shouldUpdateDialog) {
|
|
117
117
|
store.updateDialog("popUpComponentSection");
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
sessionStorage.removeItem('rowId');
|
|
120
120
|
},
|
|
121
121
|
deleteEvent: function (shouldUpdateDialog: boolean = true) {
|
|
122
122
|
const path = store.searchParams?.get("path");
|
|
123
|
-
const rowId =
|
|
123
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
124
124
|
store.formData.events.splice(rowId, 1);
|
|
125
|
-
const response =
|
|
125
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
126
126
|
store.setFormdata(_.get(response, path));
|
|
127
127
|
if (shouldUpdateDialog) {
|
|
128
128
|
store.updateDialog("popUpEventSection")
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
sessionStorage.removeItem('rowId');
|
|
131
131
|
},
|
|
132
132
|
widgetAddClickHandler: function () {
|
|
133
133
|
if (!Array.isArray(store.formData.elements)) {
|
|
134
134
|
store.formData.elements = []
|
|
135
135
|
}
|
|
136
136
|
const path = store.searchParams?.get("path");
|
|
137
|
-
|
|
137
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
138
138
|
const finalPath = `${path}.elements[${store.formData.elements.length}]`
|
|
139
139
|
store.searchParams.set("path", finalPath)
|
|
140
140
|
store.setSearchParams(store.searchParams)
|
|
@@ -145,7 +145,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
145
145
|
const rowId = dynamicData.path.split(".")[1];
|
|
146
146
|
const path = store.searchParams?.get("path");
|
|
147
147
|
const id = store.searchParams?.get("id");
|
|
148
|
-
|
|
148
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
149
149
|
const finalPath = `${path}.events[${rowId}]`
|
|
150
150
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
151
151
|
},
|
|
@@ -155,7 +155,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
155
155
|
if (!Array.isArray(store.formData.events)) {
|
|
156
156
|
store.formData.events = []
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
159
159
|
const finalPath = `${path}.events[${store.formData.events.length}]`
|
|
160
160
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
161
161
|
},
|
|
@@ -164,20 +164,13 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
164
164
|
},
|
|
165
165
|
deletePopUpComponent: function () {
|
|
166
166
|
const rowId = dynamicData.path.split(".")[1];
|
|
167
|
-
|
|
167
|
+
sessionStorage.setItem('rowId',rowId);
|
|
168
168
|
store.updateDialog("popUpComponentSection");
|
|
169
169
|
},
|
|
170
170
|
deletePopUpEvent: function () {
|
|
171
171
|
const rowId = dynamicData.path.split(".")[1];
|
|
172
|
-
|
|
172
|
+
sessionStorage.setItem('rowId',rowId);
|
|
173
173
|
store.updateDialog("popUpEventSection");
|
|
174
174
|
},
|
|
175
175
|
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
176
|
+
};
|
|
@@ -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 } 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";
|
|
@@ -111,7 +111,7 @@ export default (
|
|
|
111
111
|
if (!Array.isArray(store.formData.events)) {
|
|
112
112
|
store.formData.events = []
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
115
115
|
const finalPath = `${path}.events[${store.formData?.events?.length}]`
|
|
116
116
|
store.searchParams.set("path", finalPath)
|
|
117
117
|
store.setSearchParams(store.searchParams)
|
|
@@ -120,7 +120,7 @@ export default (
|
|
|
120
120
|
editEvent: function () {
|
|
121
121
|
const rowId = dynamicData.path.split(".")[1];
|
|
122
122
|
const path = store.searchParams?.get("path");
|
|
123
|
-
|
|
123
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
124
124
|
const finalPath = `${path}.events[${rowId}]`
|
|
125
125
|
store.searchParams.set("path", finalPath)
|
|
126
126
|
store.setSearchParams(store.searchParams)
|
|
@@ -136,7 +136,7 @@ export default (
|
|
|
136
136
|
},
|
|
137
137
|
deletePopUpEvent: function(){
|
|
138
138
|
const rowId = dynamicData.path.split(".")[1];
|
|
139
|
-
|
|
139
|
+
sessionStorage.setItem('rowId',rowId);
|
|
140
140
|
store.updateDialog("popUpEvent");
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -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,11 +26,11 @@ 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 () {
|
|
@@ -40,7 +40,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
40
40
|
return PageMasterSchema;
|
|
41
41
|
},
|
|
42
42
|
backHandler: () => {
|
|
43
|
-
|
|
43
|
+
sessionStorage.removeItem("pageFormdata")
|
|
44
44
|
store.navigate("/PageMasterRecords");
|
|
45
45
|
},
|
|
46
46
|
onAddClickHandler: function () {
|
|
@@ -48,7 +48,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
48
48
|
if (!Array.isArray(store.formData.elements)) {
|
|
49
49
|
store.formData.elements = []
|
|
50
50
|
}
|
|
51
|
-
const response =
|
|
51
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
52
52
|
if (id) {
|
|
53
53
|
store.navigate(
|
|
54
54
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
@@ -72,33 +72,33 @@ export default (funcParams: funcParamsProps) => {
|
|
|
72
72
|
if (!Array.isArray(store.formData.events)) {
|
|
73
73
|
store.formData.events = []
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
76
76
|
const finalPath = `events[${store.formData.events.length}]`
|
|
77
77
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
78
78
|
},
|
|
79
79
|
editEvent: function () {
|
|
80
80
|
const rowId = dynamicData.path.split(".")[1];
|
|
81
81
|
const id = store.searchParams?.get("id");
|
|
82
|
-
|
|
82
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
83
83
|
const finalPath = `events[${rowId}]`
|
|
84
84
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
85
85
|
},
|
|
86
86
|
deleteEvent: function () {
|
|
87
|
-
const rowId =
|
|
87
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
88
88
|
store.formData.events.splice(rowId, 1);
|
|
89
|
-
const response =
|
|
89
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
90
90
|
store.setFormdata(response);
|
|
91
91
|
store.updateDialog("popUpPageMasterEvent");
|
|
92
|
-
|
|
92
|
+
sessionStorage.removeItem('rowId');
|
|
93
93
|
},
|
|
94
94
|
deletePopUpComponent: function(){
|
|
95
95
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
|
-
|
|
96
|
+
sessionStorage.setItem('rowId',rowId);
|
|
97
97
|
store.updateDialog("popUpPageMasterComponent");
|
|
98
98
|
},
|
|
99
99
|
deletePopUpEvent: function(){
|
|
100
100
|
const rowId = dynamicData.path.split(".")[1];
|
|
101
|
-
|
|
101
|
+
sessionStorage.setItem('rowId',rowId);
|
|
102
102
|
store.updateDialog("popUpPageMasterEvent");
|
|
103
103
|
},
|
|
104
104
|
}
|
|
@@ -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,8 +60,8 @@ 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);
|
|
@@ -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"
|
|
@@ -207,7 +207,7 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any, store: any)
|
|
|
207
207
|
}
|
|
208
208
|
else if (elem?.value?.startsWith("$local")) {
|
|
209
209
|
const finalpath = elem.value.substring(7);
|
|
210
|
-
const value = JSON.parse(
|
|
210
|
+
const value = JSON.parse(sessionStorage.getItem(finalpath) || '""')
|
|
211
211
|
finalBody[elem.key] = value;
|
|
212
212
|
}
|
|
213
213
|
else if (elem?.value?.startsWith("$")) {
|
|
@@ -12,7 +12,7 @@ const notifyUiSchema = {
|
|
|
12
12
|
},
|
|
13
13
|
layout: 6,
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
interface funcParamsProps {
|
|
17
17
|
store: any,
|
|
18
18
|
dynamicData: any,
|
|
@@ -62,6 +62,7 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
62
62
|
};
|
|
63
63
|
export default (funcParams: funcParamsProps) => {
|
|
64
64
|
eventGroups = {}
|
|
65
|
+
const formDataHolder = {}
|
|
65
66
|
if (pageData) {
|
|
66
67
|
if ((!isEmpty(pageData)) && typeof pageData === "object") {
|
|
67
68
|
eventGroups = extractEvents(pageData?.config)
|
|
@@ -77,12 +78,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
77
78
|
setPage: async function () {
|
|
78
79
|
funcParams.store.setFormdata({});
|
|
79
80
|
funcParams.store.newData = {};
|
|
80
|
-
const pageBasicDetailString =
|
|
81
|
+
const pageBasicDetailString = sessionStorage.getItem("pagemasterMetaData")
|
|
81
82
|
if (pageBasicDetailString) {
|
|
82
83
|
pageData = JSON.parse(pageBasicDetailString)
|
|
83
84
|
} else {
|
|
84
85
|
pageData = await funcParams.pageDataProvider();
|
|
85
|
-
|
|
86
|
+
sessionStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
86
87
|
schema: pageData?.schema,
|
|
87
88
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
88
89
|
}))
|