impaktapps-ui-builder 0.0.346 → 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.346",
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"],
@@ -101,20 +101,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
101
101
  saveFormdataInLocalStorage(store.ctx.core.data, path);
102
102
  const config = JSON.parse(localStorage.getItem("pageFormdata"));
103
103
  const isSubmitted = await saveHandler(store, service, submitHandler,config);
104
- if (isSubmitted) {
105
- localStorage.removeItem("pageFormdata");
106
- store.navigate(`/PageMaster?id=${id}`);
107
- store.setNotify({
108
- SuccessMessage: "Submit Successfully",
109
- Success: true,
110
- });
111
- } else {
112
- store.setValidation("ValidateAndShow");
113
- store.setNotify({
114
- Fail: true,
115
- FailMessage: "Errors on Page"
116
- });
117
- }
104
+ navigation(store,isSubmitted,`/PageMaster?id=${id}`)
118
105
  },
119
106
 
120
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,23 +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);
64
+ saveFormdataInLocalStorage(store.ctx.core.data, path);
65
65
  const config = JSON.parse(localStorage.getItem("pageFormdata"));
66
66
  const isSubmitted = await saveHandler(store, service, submitHandler,config);
67
- if (isSubmitted) {
68
- localStorage.removeItem("pageFormdata");
69
- store.navigate(`/PageMaster?id=${id}`);
70
- store.setNotify({
71
- SuccessMessage: "Submit Successfully",
72
- Success: true,
73
- });
74
- } else {
75
- store.setValidation("ValidateAndShow");
76
- store.setNotify({
77
- Fail: true,
78
- FailMessage: "Errors on Page"
79
- });
80
- }
67
+ navigation(store,isSubmitted,`/PageMaster?id=${id}`)
81
68
  },
82
69
 
83
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,
@@ -69,20 +87,7 @@ export default (funcParams: funcParamsProps) => {
69
87
  saveFormdataInLocalStorage(store.ctx.core.data);
70
88
  const config = JSON.parse(localStorage.getItem("pageFormdata"));
71
89
  const isSubmitted = await saveHandler(store, service, submitHandler,config);
72
- if (isSubmitted) {
73
- localStorage.removeItem("pageFormdata");
74
- store.navigate('/PageMasterRecords');
75
- store.setNotify({
76
- SuccessMessage: "Submit Successfully",
77
- Success: true,
78
- });
79
- } else {
80
- store.setValidation("ValidateAndShow");
81
- store.setNotify({
82
- Fail: true,
83
- FailMessage: "Errors on Page"
84
- });
85
- }
90
+ navigation(store,isSubmitted)
86
91
  },
87
92
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
88
93
  Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,