impaktapps-ui-builder 0.0.381 → 0.0.382-alpha.10

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.
@@ -41,7 +41,7 @@ const sectionLabels = {
41
41
 
42
42
 
43
43
  export const refreshPage = (type:string,store:any) => {
44
- const UiSchema = _.cloneDeep(componentBasicUiSchema)
44
+ const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
45
45
  if(type){
46
46
  const sectionUiSchema = {
47
47
  Core: CoreSection,
@@ -54,8 +54,8 @@ export const refreshPage = (type:string,store:any) => {
54
54
 
55
55
  }
56
56
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
57
- UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style","Event","Validation"];
58
- UiSchema.elements[1].elements = elements || [CoreSection, StyleSection,EventSection,ValidationSection];
57
+ UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "style","Event","Validation"];
58
+ UiSchema.elements[0].elements = elements || [CoreSection, StyleSection,EventSection,ValidationSection];
59
59
 
60
60
  }
61
61
  store.setUiSchema(UiSchema);
@@ -22,26 +22,26 @@ export default (
22
22
  this.refreshPage(formdata.Handler, store)
23
23
  },
24
24
  refreshPage: (handlerType: any, store: any) => {
25
- const uiSchema = _.cloneDeep(EventUiSchema);
25
+ const uiSchema = _.cloneDeep(EventUiSchema(store.theme.myTheme));
26
26
  const schema: any = _.cloneDeep(EventSchema)
27
27
  if (handlerType) {
28
28
  if (handlerType === "custom") {
29
- uiSchema.elements[1].elements[0].elements[2] = getTextArea("eventCode", "Write Custom Code", false)
29
+ uiSchema.elements[0].elements[0].elements[2] = getTextArea("eventCode", "Write Custom Code", false)
30
30
  schema.required = ["eventType", "Handler", "eventCode"]
31
31
 
32
32
  } else if (handlerType === "api") {
33
- uiSchema.elements[1].elements[0].elements[2] = APISection;
33
+ uiSchema.elements[0].elements[0].elements[2] = APISection;
34
34
  schema.required = ["eventType", "Handler", "method", "path"]
35
35
  } else if (handlerType === "inBuiltFunction") {
36
- uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
36
+ uiSchema.elements[0].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
37
37
  { label: "RankProvider", value: "RankProvider" },
38
38
  { label: "Download File", value: "downloadFile" },
39
39
  { label: "Download Blob File", value: "downloadBlobFile" }
40
40
  ])
41
- uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
41
+ uiSchema.elements[0].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
42
42
  schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
43
43
  } else if (handlerType === "refresh") {
44
- uiSchema.elements[1].elements[0].elements[2] = refreshSectionUiSchema;
44
+ uiSchema.elements[0].elements[0].elements[2] = refreshSectionUiSchema;
45
45
  schema.properties.refreshElements.required = ["value"]
46
46
  schema.properties.refreshElements.items.required = ["value"]
47
47
  schema.required = ["eventType", "Handler", "refreshElements"]
@@ -52,8 +52,8 @@ export default (
52
52
  },
53
53
 
54
54
  getFormData: Component(store, dynamicData, submitHandler, service).getFormdata,
55
- getUiSchema: function () {
56
- return EventUiSchema;
55
+ getUiSchema: async function () {
56
+ return await EventUiSchema(store.theme.myTheme);
57
57
  },
58
58
  getSchema: () => {
59
59
  return EventSchema;
@@ -34,7 +34,7 @@ export default (funcParams: funcParamsProps) => {
34
34
  return config
35
35
  },
36
36
  getUiSchema: function () {
37
- return PageMasterUiSchema;
37
+ return PageMasterUiSchema(store.theme.myTheme);
38
38
  },
39
39
  getSchema: () => {
40
40
  return PageMasterSchema;
@@ -16,13 +16,12 @@ export const downloadFile = (obj: any) => {
16
16
  document.body.removeChild(link);
17
17
  };
18
18
 
19
- export const clickDownloadLink = (response: any, service) => {
20
- const user = JSON.parse(localStorage.getItem("user"));
21
- let url = `${service.defaults.baseURL}/${response.path}?Authorization=Bearer%20${user.token}`;
19
+ export const doDownload = (response: any, service) => {
20
+ let url = `${service.defaults.baseURL}/${response.path}`;
22
21
  if (response?.params) {
23
22
  const keysArray = Object.keys(response?.params);
24
23
  keysArray.map((e, i) => {
25
- url = url + `&${e}=${response?.params[e]}`
24
+ url = url + `${i === 0?"?":"&"}${e}=${response?.params[e]}`
26
25
  })
27
26
  }
28
27
  const link = document.createElement('a');
@@ -87,7 +87,7 @@ async function executeInBuiltFunctionHandler(params: handlersProps) {
87
87
  const makeFunc = eval(params.config.funcParametersCode)
88
88
  parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
89
89
  }
90
- params.serviceHolder[params.config.inBuiltFunctionType](parameter,params.service)
90
+ params.serviceHolder[params.config.inBuiltFunctionType](parameter)
91
91
  }
92
92
 
93
93
  async function executeCustomHandler(params: handlersProps) {
@@ -1,5 +1,5 @@
1
1
  import _, { isEmpty } from "lodash";
2
- import { clickDownloadLink, downloadFile } from "./downloadFile";
2
+ import { doDownload, downloadFile } from "./downloadFile";
3
3
  import { executeEvents, executeRefreshHandler } from "./events";
4
4
  import { handlersProps } from "./interface";
5
5
  let compType: string;
@@ -62,7 +62,7 @@ export default (funcParams: funcParamsProps) => {
62
62
  let executeEventsParameters: handlersProps = {
63
63
  config: {}, componentName: "",
64
64
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
65
- serviceHolder: { downloadFile ,download:clickDownloadLink}, eventGroups
65
+ serviceHolder: { downloadFile,download:doDownload }, eventGroups
66
66
  };
67
67
  return {
68
68
  setPage: async function () {
@@ -192,7 +192,7 @@ export default (funcParams: funcParamsProps) => {
192
192
  }
193
193
  },
194
194
  downloadFile: downloadFile,
195
- download:clickDownloadLink,
195
+ download:doDownload,
196
196
  };
197
197
  };
198
198