@asaleh37/ui-base 25.6.17-1 → 25.6.17-3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "25.6.17-1",
3
+ "version": "25.6.17-3",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -4,7 +4,7 @@ import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTy
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { useApiActions } from "../../../hooks";
6
6
 
7
- const storageTypes = [{ value: "FILE_SYSTEM" }, { value: "SFTP" }];
7
+ export const storageTypes = [{ value: "FILE_SYSTEM" }, { value: "SFTP" }];
8
8
 
9
9
  const AttachmentConfigGrid: React.FC = () => {
10
10
  const { t } = useTranslation();
@@ -116,6 +116,16 @@ const AttachmentConfigGrid: React.FC = () => {
116
116
  optionValueField: "value",
117
117
  },
118
118
  },
119
+ {
120
+ type: "field",
121
+ mode: "props",
122
+ props: {
123
+ fieldLabel: "Include App Code in attachment path",
124
+ fieldName: "includeAppCodeInPath",
125
+ required: false,
126
+ fieldType: "checkbox",
127
+ },
128
+ },
119
129
  {
120
130
  type: "field",
121
131
  mode: "props",
@@ -12,6 +12,7 @@ import { toast } from "react-toastify";
12
12
  import ReportParametersForm from "./ReportParametersForm";
13
13
  import ReportParameterGrid from "./ReportParameterGrid";
14
14
  import ReportViewer from "../../templates/report/ReportViewer";
15
+ import { storageTypes } from "./AttachmentConfigGrid";
15
16
 
16
17
  type ValidationCritria = {
17
18
  isVisible: boolean;
@@ -26,7 +27,6 @@ type ReportValidationOptions = {
26
27
  reportBluePrintId: ValidationCritria;
27
28
  reportExcelDataQueryId: ValidationCritria;
28
29
  reportJasperName: ValidationCritria;
29
- reportJasperPath: ValidationCritria;
30
30
  };
31
31
 
32
32
  type validationObjectType = {
@@ -40,7 +40,6 @@ const validationObject: validationObjectType = {
40
40
  reportBluePrintId: { isMandatory: true, isVisible: true },
41
41
  reportExcelDataQueryId: { isMandatory: false, isVisible: false },
42
42
  reportJasperName: { isMandatory: false, isVisible: false },
43
- reportJasperPath: { isMandatory: false, isVisible: false },
44
43
  },
45
44
  Jasper: {
46
45
  useSysDatasource: { isMandatory: false, isVisible: true },
@@ -48,7 +47,6 @@ const validationObject: validationObjectType = {
48
47
  reportBluePrintId: { isMandatory: false, isVisible: false },
49
48
  reportExcelDataQueryId: { isMandatory: false, isVisible: false },
50
49
  reportJasperName: { isMandatory: true, isVisible: true },
51
- reportJasperPath: { isMandatory: true, isVisible: true },
52
50
  },
53
51
  Excel: {
54
52
  useSysDatasource: { isMandatory: false, isVisible: false },
@@ -56,7 +54,6 @@ const validationObject: validationObjectType = {
56
54
  reportBluePrintId: { isMandatory: false, isVisible: false },
57
55
  reportExcelDataQueryId: { isMandatory: true, isVisible: true },
58
56
  reportJasperName: { isMandatory: false, isVisible: false },
59
- reportJasperPath: { isMandatory: false, isVisible: false },
60
57
  },
61
58
  };
62
59
 
@@ -83,13 +80,11 @@ const adjustFormAccordingToReportType = (
83
80
  formActions.hideField("reportBluePrintId");
84
81
  formActions.hideField("reportExcelDataQueryId");
85
82
  formActions.hideField("reportJasperName");
86
- formActions.hideField("reportJasperPath");
87
83
  formManager.setValue("useSysDatasource", null);
88
84
  formManager.setValue("datasourceConId", null);
89
85
  formManager.setValue("reportBluePrintId", null);
90
86
  formManager.setValue("reportExcelDataQueryId", null);
91
87
  formManager.setValue("reportJasperName", null);
92
- formManager.setValue("reportJasperPath", null);
93
88
  }
94
89
  };
95
90
 
@@ -245,6 +240,19 @@ const ReportGrid: React.FC = () => {
245
240
  fieldType: "text",
246
241
  },
247
242
  },
243
+ {
244
+ type: "field",
245
+ mode: "props",
246
+ props: {
247
+ fieldLabel: "ATTACHMENT_CONFIG_STORAGE_TYPE",
248
+ fieldName: "storageType",
249
+ required: true,
250
+ fieldType: "combobox",
251
+ options: storageTypes,
252
+ optionDisplayField: "value",
253
+ optionValueField: "value",
254
+ },
255
+ },
248
256
  {
249
257
  type: "field",
250
258
  mode: "props",
@@ -375,14 +383,10 @@ const ReportGrid: React.FC = () => {
375
383
  type: "field",
376
384
  mode: "props",
377
385
  props: {
378
- fieldLabel: "REPORT_REPORT_JASPER_PATH",
379
- fieldName: "reportJasperPath",
380
- hidden: true,
381
- gridProps: {
382
- hidden: true,
383
- },
386
+ fieldLabel: "Include App Code in attachment path",
387
+ fieldName: "includeAppCodeInPath",
384
388
  required: false,
385
- fieldType: "text",
389
+ fieldType: "checkbox",
386
390
  },
387
391
  },
388
392
  {
@@ -408,6 +412,7 @@ const ReportGrid: React.FC = () => {
408
412
  <ReportParameterGrid selectedRecord={selectedRecord} />
409
413
  </ReportParameterWindow>
410
414
  <TemplateGrid
415
+ attachment={{ attachmentCode: "JASPER_REPORTS" }}
411
416
  apiActions={apiActions}
412
417
  data={data}
413
418
  setData={setData}
@@ -474,10 +479,7 @@ const ReportGrid: React.FC = () => {
474
479
  toast.error("You must enter the jasper report name");
475
480
  return false;
476
481
  }
477
- if (record?.reportType === "Jasper" && !record?.reportJasperPath) {
478
- toast.error("You must enter the jasper report path");
479
- return false;
480
- }
482
+
481
483
  if (
482
484
  record?.reportType === "Blueprint" &&
483
485
  !record?.reportBluePrintId
@@ -14,12 +14,12 @@ interface setStoreDataProps {
14
14
  data: Array<any>;
15
15
  }
16
16
 
17
- export type StoreMetaData {
17
+ export type StoreMetaData = {
18
18
  url: string;
19
19
  data: Array<any>;
20
20
  autoLoad: boolean;
21
21
  authority?: string;
22
- }
22
+ };
23
23
 
24
24
  export const commonStoresInitialState: CommonStoresInterface = {
25
25
  stores: {},
@@ -27,7 +27,7 @@ export const commonStoresInitialState: CommonStoresInterface = {
27
27
  };
28
28
 
29
29
  const commonStoreSlice = createSlice({
30
- name: "loadingMask",
30
+ name: "commonStores",
31
31
  initialState: commonStoresInitialState,
32
32
  reducers: {
33
33
  setStoresMetaData: (state, action) => {