impaktapps-ui-builder 0.0.345 → 0.0.347

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.
@@ -1,4 +1,5 @@
1
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;
2
3
  interface funcParamsProps {
3
4
  store: any;
4
5
  dynamicData: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.345",
3
+ "version": "0.0.347",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -9,7 +9,7 @@ import { StyleSection } from "../build/uischema/styleSection";
9
9
  import { TableSection } from "../build/uischema/tableSection";
10
10
  import { ValueTab } from "../build/uischema/valueTab";
11
11
  import { ValidationSection } from "../build/uischema/validationSections";
12
- import { saveHandler } from "./pageMaster";
12
+ import { navigation, saveHandler } from "./pageMaster";
13
13
  const sectionLabels = {
14
14
  Select: ["Core", "Properties","Value", "style", "Event","Validation"],
15
15
  MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
@@ -99,23 +99,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
99
99
  const id = store.searchParams?.get("id");
100
100
  const path = store.searchParams?.get("path");
101
101
  saveFormdataInLocalStorage(store.ctx.core.data, path);
102
- const config = localStorage.getItem("pageFormdata");
103
- const actualConfig = JSON.parse(config);
104
- const isSubmitted = await saveHandler(store, service, submitHandler,actualConfig);
105
- if (isSubmitted) {
106
- localStorage.removeItem("pageFormdata");
107
- store.navigate(`/PageMaster?id=${id}`);
108
- store.setNotify({
109
- SuccessMessage: "Submit Successfully",
110
- Success: true,
111
- });
112
- } else {
113
- store.setValidation("ValidateAndShow");
114
- store.setNotify({
115
- Fail: true,
116
- FailMessage: "Errors on Page"
117
- });
118
- }
102
+ const config = JSON.parse(localStorage.getItem("pageFormdata"));
103
+ const isSubmitted = await saveHandler(store, service, submitHandler,config);
104
+ navigation(store,isSubmitted,`/PageMaster?id=${id}`)
119
105
  },
120
106
 
121
107
  onChange: function () {
@@ -3,7 +3,7 @@ import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
3
3
  import Component from "./component";
4
4
  import { saveFormdataInLocalStorage } from "./saveHandler";
5
5
  import { APISection } from "../build/uischema/apiSection";
6
- import { saveHandler } from "./pageMaster";
6
+ import { navigation, saveHandler } from "./pageMaster";
7
7
  import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
8
8
  import { refreshSectionUiSchema } from "../build/uischema/refresh";
9
9
  import _ from "lodash";
@@ -61,24 +61,10 @@ export default (
61
61
  savePageHandler: async () => {
62
62
  const id = store.searchParams?.get("id");
63
63
  const path = store.searchParams?.get("path");
64
- saveFormdataInLocalStorage(store.ctx.core.data,path);
65
- const config = localStorage.getItem("pageFormdata");
66
- const actualConfig = JSON.parse(config);
67
- const isSubmitted = await saveHandler(store, service, submitHandler,actualConfig);
68
- if (isSubmitted) {
69
- localStorage.removeItem("pageFormdata");
70
- store.navigate(`/PageMaster?id=${id}`);
71
- store.setNotify({
72
- SuccessMessage: "Submit Successfully",
73
- Success: true,
74
- });
75
- } else {
76
- store.setValidation("ValidateAndShow");
77
- store.setNotify({
78
- Fail: true,
79
- FailMessage: "Errors on Page"
80
- });
81
- }
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}`)
82
68
  },
83
69
 
84
70
  onChange: function () {
@@ -17,6 +17,24 @@ export async function saveHandler(store, service, submitHandler, config) {
17
17
  }
18
18
  return isTrue;
19
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
+
20
38
  interface funcParamsProps {
21
39
  store: any,
22
40
  dynamicData: any,
@@ -67,23 +85,9 @@ export default (funcParams: funcParamsProps) => {
67
85
  },
68
86
  savePageHandler: async () => {
69
87
  saveFormdataInLocalStorage(store.ctx.core.data);
70
- const config = localStorage.getItem("pageFormdata");
71
- const actualConfig = JSON.parse(config);
72
- const isSubmitted = await saveHandler(store, service, submitHandler,actualConfig);
73
- if (isSubmitted) {
74
- localStorage.removeItem("pageFormdata");
75
- store.navigate('/PageMasterRecords');
76
- store.setNotify({
77
- SuccessMessage: "Submit Successfully",
78
- Success: true,
79
- });
80
- } else {
81
- store.setValidation("ValidateAndShow");
82
- store.setNotify({
83
- Fail: true,
84
- FailMessage: "Errors on Page"
85
- });
86
- }
88
+ const config = JSON.parse(localStorage.getItem("pageFormdata"));
89
+ const isSubmitted = await saveHandler(store, service, submitHandler,config);
90
+ navigation(store,isSubmitted)
87
91
  },
88
92
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
89
93
  Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,