@asaleh37/ui-base 25.8.26-1 → 25.8.30
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/index.d.ts +22 -6
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +1 -0
- package/src/components/administration/dev/DataQueryGrid.tsx +26 -16
- package/src/components/administration/dev/DatasourceConnectionGrid.tsx +1 -0
- package/src/components/administration/dev/EntityParameterGrid.tsx +94 -67
- package/src/components/administration/dev/MailSenderConfigGrid.tsx +1 -0
- package/src/components/administration/dev/MailTemplateGrid.tsx +1 -0
- package/src/components/administration/dev/NotificationGrid.tsx +5 -2
- package/src/components/administration/dev/ReportGrid.tsx +102 -111
- package/src/components/administration/dev/WidgetGrid.tsx +96 -147
- package/src/components/administration/dev/WorkflowDocumentGrid.tsx +2 -23
- package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +41 -16
- package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +20 -10
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +80 -60
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/Datefield.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/DatetimeField.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +83 -65
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +8 -5
- package/src/components/templates/report/ReportViewer.tsx +24 -138
- package/src/components/templates/visuals/DashboardViewer.tsx +49 -5
- package/src/components/templates/visuals/WidgetViewer.tsx +24 -14
- package/src/examples/ExampleGrid.tsx +134 -0
- package/src/hooks/useParameterPanel.tsx +168 -0
- package/src/locales/arabic/devLocalsAr.json +2 -2
- package/src/locales/english/devLocalsEn.json +2 -2
- package/src/navigationItems/index.tsx +7 -0
- package/src/routes/index.ts +5 -1
- package/src/util/AppUtils.ts +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
3
|
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
FormElementProps,
|
|
6
|
+
FormValueChangeCallBk,
|
|
7
|
+
} from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
8
|
import { useTranslation } from "react-i18next";
|
|
6
9
|
import { useSelector } from "react-redux";
|
|
7
10
|
import DataQueryParametersForm from "./DataQueryParametersForm";
|
|
@@ -30,6 +33,27 @@ const DataQueryGrid: React.FC = () => {
|
|
|
30
33
|
setData: setData,
|
|
31
34
|
});
|
|
32
35
|
|
|
36
|
+
const adjustFormAfterValueChange: FormValueChangeCallBk = (
|
|
37
|
+
formValues,
|
|
38
|
+
formActions,
|
|
39
|
+
formManager,
|
|
40
|
+
fieldName,
|
|
41
|
+
newValue
|
|
42
|
+
) => {
|
|
43
|
+
if (fieldName) {
|
|
44
|
+
if (fieldName === "useSysCon" && newValue == true) {
|
|
45
|
+
formActions.hideField("datasourceConId");
|
|
46
|
+
formManager.setValue("datasourceConId", null);
|
|
47
|
+
} else {
|
|
48
|
+
formActions.showField("datasourceConId");
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
if (formValues?.useSysCon) {
|
|
52
|
+
formActions.hideField("datasourceConId");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
33
57
|
const formElements: Array<FormElementProps> = [
|
|
34
58
|
{
|
|
35
59
|
type: "field",
|
|
@@ -114,21 +138,6 @@ const DataQueryGrid: React.FC = () => {
|
|
|
114
138
|
fieldName: "useSysCon",
|
|
115
139
|
required: false,
|
|
116
140
|
fieldType: "checkbox",
|
|
117
|
-
formProps: {
|
|
118
|
-
onValueChangeCallBack(
|
|
119
|
-
value,
|
|
120
|
-
formManager,
|
|
121
|
-
formActions,
|
|
122
|
-
selectedRecord
|
|
123
|
-
) {
|
|
124
|
-
if (value) {
|
|
125
|
-
formActions.hideField("datasourceConId");
|
|
126
|
-
formManager.setValue("datasourceConId", null);
|
|
127
|
-
} else {
|
|
128
|
-
formActions.showField("datasourceConId");
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
141
|
},
|
|
133
142
|
},
|
|
134
143
|
{
|
|
@@ -198,6 +207,7 @@ const DataQueryGrid: React.FC = () => {
|
|
|
198
207
|
girdIcon="table-cells"
|
|
199
208
|
editAction={{ isEnabled: true, authority: "DATA_QUERY_EDIT" }}
|
|
200
209
|
deleteAction={{ isEnabled: true, authority: "DATA_QUERY_DELETE" }}
|
|
210
|
+
formProps={{ formValuesChangeCallBk: adjustFormAfterValueChange }}
|
|
201
211
|
/>
|
|
202
212
|
</>
|
|
203
213
|
);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
3
|
import { useApiActions } from "../../../hooks";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
FormElementProps,
|
|
6
|
+
FormValueChangeCallBk,
|
|
7
|
+
} from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
8
|
import { useTranslation } from "react-i18next";
|
|
6
9
|
import { useSelector } from "react-redux";
|
|
7
10
|
import { DATE_FORMAT, DATE_TIME_FORMAT } from "../../../util";
|
|
@@ -20,6 +23,91 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
20
23
|
setData: setData,
|
|
21
24
|
});
|
|
22
25
|
|
|
26
|
+
const SystemDataQueries = useSelector(
|
|
27
|
+
(state: any) => state.commonStores.stores.SystemDataQueries.data
|
|
28
|
+
);
|
|
29
|
+
const adjustFormAccordingFormValues: FormValueChangeCallBk = (
|
|
30
|
+
formValues: any,
|
|
31
|
+
formActions,
|
|
32
|
+
formManager,
|
|
33
|
+
fieldName,
|
|
34
|
+
newValue,
|
|
35
|
+
selectedRecord
|
|
36
|
+
) => {
|
|
37
|
+
if (fieldName) {
|
|
38
|
+
if (fieldName === "parameterType") {
|
|
39
|
+
if (newValue === "combobox") {
|
|
40
|
+
formManager.setValue("parameterValueFormat", null);
|
|
41
|
+
formActions.showField("parameterDataQueryId");
|
|
42
|
+
formActions.showField("parameterDataset");
|
|
43
|
+
formActions.showField("parameterDisplayField");
|
|
44
|
+
formActions.showField("parameterValueField");
|
|
45
|
+
formActions.hideField("parameterValueFormat");
|
|
46
|
+
} else {
|
|
47
|
+
formActions.hideField("parameterDataQueryId");
|
|
48
|
+
formActions.hideField("parameterDataset");
|
|
49
|
+
formActions.hideField("parameterDisplayField");
|
|
50
|
+
formActions.hideField("parameterValueField");
|
|
51
|
+
}
|
|
52
|
+
if (newValue === "date" || newValue === "datetime") {
|
|
53
|
+
formActions.showField("parameterValueFormat");
|
|
54
|
+
if (newValue === "date") {
|
|
55
|
+
formManager.setValue("parameterValueFormat", DATE_FORMAT);
|
|
56
|
+
} else {
|
|
57
|
+
formManager.setValue("parameterValueFormat", DATE_TIME_FORMAT);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
formActions.hideField("parameterValueFormat");
|
|
61
|
+
formManager.setValue("parameterValueFormat", null);
|
|
62
|
+
}
|
|
63
|
+
} else if (fieldName == "parameterDataQueryId") {
|
|
64
|
+
if (newValue != null && newValue != "") {
|
|
65
|
+
formManager.setValue("parameterDataset", null);
|
|
66
|
+
formActions.hideField("parameterDataset");
|
|
67
|
+
} else {
|
|
68
|
+
formActions.showField("parameterDataset");
|
|
69
|
+
}
|
|
70
|
+
} else if (fieldName == "parameterDataset") {
|
|
71
|
+
if (newValue != null && newValue != "") {
|
|
72
|
+
formManager.setValue("parameterDataQueryId", null);
|
|
73
|
+
formActions.hideField("parameterDataQueryId");
|
|
74
|
+
} else {
|
|
75
|
+
formActions.showField("parameterDataQueryId");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
if (formValues?.parameterType === "combobox") {
|
|
80
|
+
formManager.setValue("parameterValueFormat", null);
|
|
81
|
+
formActions.showField("parameterDataQueryId");
|
|
82
|
+
formActions.showField("parameterDataset");
|
|
83
|
+
formActions.showField("parameterDisplayField");
|
|
84
|
+
formActions.showField("parameterValueField");
|
|
85
|
+
formActions.hideField("parameterValueFormat");
|
|
86
|
+
} else if (formValues?.parameterType === "date") {
|
|
87
|
+
formActions.hideField("parameterDataQueryId");
|
|
88
|
+
formActions.hideField("parameterDataset");
|
|
89
|
+
formActions.hideField("parameterDisplayField");
|
|
90
|
+
formActions.hideField("parameterValueField");
|
|
91
|
+
formActions.showField("parameterValueFormat");
|
|
92
|
+
formManager.setValue("parameterValueFormat", DATE_FORMAT);
|
|
93
|
+
} else if (formValues?.parameterType === "datetime") {
|
|
94
|
+
formActions.hideField("parameterDataQueryId");
|
|
95
|
+
formActions.hideField("parameterDataset");
|
|
96
|
+
formActions.hideField("parameterDisplayField");
|
|
97
|
+
formActions.hideField("parameterValueField");
|
|
98
|
+
formActions.showField("parameterValueFormat");
|
|
99
|
+
formManager.setValue("parameterValueFormat", DATE_TIME_FORMAT);
|
|
100
|
+
} else {
|
|
101
|
+
formManager.setValue("parameterValueFormat", null);
|
|
102
|
+
formActions.hideField("parameterDataQueryId");
|
|
103
|
+
formActions.hideField("parameterDataset");
|
|
104
|
+
formActions.hideField("parameterDisplayField");
|
|
105
|
+
formActions.hideField("parameterValueField");
|
|
106
|
+
formActions.hideField("parameterValueFormat");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
23
111
|
const formElements: Array<FormElementProps> = [
|
|
24
112
|
{
|
|
25
113
|
type: "field",
|
|
@@ -119,41 +207,6 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
119
207
|
comboboxValueDataType: "string",
|
|
120
208
|
optionDisplayField: "value",
|
|
121
209
|
optionValueField: "value",
|
|
122
|
-
formProps: {
|
|
123
|
-
onValueChangeCallBack(
|
|
124
|
-
value,
|
|
125
|
-
formManager,
|
|
126
|
-
formActions,
|
|
127
|
-
selectedRecord
|
|
128
|
-
) {
|
|
129
|
-
if (value === "combobox") {
|
|
130
|
-
formManager.setValue("parameterValueFormat", null);
|
|
131
|
-
formActions.showField("parameterDataQueryId");
|
|
132
|
-
formActions.showField("parameterDataset");
|
|
133
|
-
formActions.showField("parameterDisplayField");
|
|
134
|
-
formActions.showField("parameterValueField");
|
|
135
|
-
formActions.hideField("parameterValueFormat");
|
|
136
|
-
} else if (value === "date" || value === "datetime") {
|
|
137
|
-
if (value === "date") {
|
|
138
|
-
formManager.setValue("parameterValueFormat", DATE_FORMAT);
|
|
139
|
-
} else if (value === "datetime") {
|
|
140
|
-
formManager.setValue("parameterValueFormat", DATE_TIME_FORMAT);
|
|
141
|
-
}
|
|
142
|
-
formActions.hideField("parameterDataQueryId");
|
|
143
|
-
formActions.hideField("parameterDataset");
|
|
144
|
-
formActions.hideField("parameterDisplayField");
|
|
145
|
-
formActions.hideField("parameterValueField");
|
|
146
|
-
formActions.showField("parameterValueFormat");
|
|
147
|
-
} else {
|
|
148
|
-
formManager.setValue("parameterValueFormat", null);
|
|
149
|
-
formActions.hideField("parameterDataQueryId");
|
|
150
|
-
formActions.hideField("parameterDataset");
|
|
151
|
-
formActions.hideField("parameterDisplayField");
|
|
152
|
-
formActions.hideField("parameterValueField");
|
|
153
|
-
formActions.hideField("parameterValueFormat");
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
210
|
},
|
|
158
211
|
},
|
|
159
212
|
{
|
|
@@ -164,22 +217,10 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
164
217
|
fieldName: "parameterDataQueryId",
|
|
165
218
|
hidden: true,
|
|
166
219
|
required: false,
|
|
167
|
-
fieldType: "
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
formManager,
|
|
172
|
-
formActions,
|
|
173
|
-
selectedRecord
|
|
174
|
-
) {
|
|
175
|
-
if (value != null && value != "") {
|
|
176
|
-
formManager.setValue("parameterDataset", null);
|
|
177
|
-
formActions.hideField("parameterDataset");
|
|
178
|
-
} else {
|
|
179
|
-
formActions.showField("parameterDataset");
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
},
|
|
220
|
+
fieldType: "combobox",
|
|
221
|
+
options: SystemDataQueries,
|
|
222
|
+
optionDisplayField: "queryName",
|
|
223
|
+
optionValueField: "id",
|
|
183
224
|
},
|
|
184
225
|
},
|
|
185
226
|
{
|
|
@@ -191,21 +232,6 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
191
232
|
hidden: true,
|
|
192
233
|
required: false,
|
|
193
234
|
fieldType: "text",
|
|
194
|
-
formProps: {
|
|
195
|
-
onValueChangeCallBack(
|
|
196
|
-
value,
|
|
197
|
-
formManager,
|
|
198
|
-
formActions,
|
|
199
|
-
selectedRecord
|
|
200
|
-
) {
|
|
201
|
-
if (value != null && value != "") {
|
|
202
|
-
formManager.setValue("parameterDataQueryId", null);
|
|
203
|
-
formActions.hideField("parameterDataQueryId");
|
|
204
|
-
} else {
|
|
205
|
-
formActions.showField("parameterDataQueryId");
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
235
|
},
|
|
210
236
|
},
|
|
211
237
|
{
|
|
@@ -271,6 +297,7 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
271
297
|
keyColumnName={"id"}
|
|
272
298
|
gridTitle={t("ENTITY_PARAMETER_PLURAL")}
|
|
273
299
|
girdIcon="p"
|
|
300
|
+
formProps={{ formValuesChangeCallBk: adjustFormAccordingFormValues }}
|
|
274
301
|
editAction={{ isEnabled: true, authority: "ENTITY_PARAMETER_EDIT" }}
|
|
275
302
|
deleteAction={{ isEnabled: true, authority: "ENTITY_PARAMETER_DELETE" }}
|
|
276
303
|
/>
|
|
@@ -107,7 +107,8 @@ const NotificationGrid: React.FC = () => {
|
|
|
107
107
|
type: "field",
|
|
108
108
|
mode: "props",
|
|
109
109
|
props: {
|
|
110
|
-
fieldLabel:
|
|
110
|
+
fieldLabel:
|
|
111
|
+
"Notification Data Query ( will be passed a parameter call last_run_time represents last check time)",
|
|
111
112
|
fieldName: "notificationQueryId",
|
|
112
113
|
required: true,
|
|
113
114
|
fieldType: "combobox",
|
|
@@ -156,6 +157,7 @@ const NotificationGrid: React.FC = () => {
|
|
|
156
157
|
fieldLabel: "Interval Type",
|
|
157
158
|
fieldName: "intervalType",
|
|
158
159
|
fieldType: "combobox",
|
|
160
|
+
comboboxValueDataType: "string",
|
|
159
161
|
options: SystemTimeIntervals,
|
|
160
162
|
gridProps: {
|
|
161
163
|
hidden: true,
|
|
@@ -321,7 +323,7 @@ const NotificationGrid: React.FC = () => {
|
|
|
321
323
|
disabled: true,
|
|
322
324
|
fieldType: "text",
|
|
323
325
|
},
|
|
324
|
-
},
|
|
326
|
+
},
|
|
325
327
|
{
|
|
326
328
|
type: "field",
|
|
327
329
|
mode: "props",
|
|
@@ -357,6 +359,7 @@ const NotificationGrid: React.FC = () => {
|
|
|
357
359
|
fieldName: "notificationAction",
|
|
358
360
|
required: false,
|
|
359
361
|
fieldType: "combobox",
|
|
362
|
+
comboboxValueDataType: "string",
|
|
360
363
|
options: [{ value: "NAVIGATION" }],
|
|
361
364
|
optionDisplayField: "value",
|
|
362
365
|
optionValueField: "value",
|
|
@@ -2,89 +2,108 @@ import { useState } from "react";
|
|
|
2
2
|
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
3
|
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
4
|
import {
|
|
5
|
-
FormActionProps,
|
|
6
5
|
FormElementProps,
|
|
6
|
+
FormValueChangeCallBk,
|
|
7
7
|
} from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
9
|
import { UseFormReturn } from "react-hook-form";
|
|
10
10
|
import { useSelector } from "react-redux";
|
|
11
11
|
import { toast } from "react-toastify";
|
|
12
|
-
import ReportParametersForm from "./ReportParametersForm";
|
|
13
12
|
import ReportParameterGrid from "./ReportParameterGrid";
|
|
14
13
|
import ReportViewer from "../../templates/report/ReportViewer";
|
|
15
14
|
import { storageTypes } from "./AttachmentConfigGrid";
|
|
16
15
|
|
|
17
|
-
type ValidationCritria = {
|
|
18
|
-
isVisible: boolean;
|
|
19
|
-
isMandatory: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
16
|
export type ReportType = "Jasper" | "Excel" | "Blueprint";
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
useSysDatasource: { isMandatory: false, isVisible: false },
|
|
39
|
-
datasourceConId: { isMandatory: false, isVisible: false },
|
|
40
|
-
reportBluePrintId: { isMandatory: true, isVisible: true },
|
|
41
|
-
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
42
|
-
reportJasperName: { isMandatory: false, isVisible: false },
|
|
43
|
-
},
|
|
44
|
-
Jasper: {
|
|
45
|
-
useSysDatasource: { isMandatory: false, isVisible: true },
|
|
46
|
-
datasourceConId: { isMandatory: false, isVisible: true },
|
|
47
|
-
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
48
|
-
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
49
|
-
reportJasperName: { isMandatory: true, isVisible: true },
|
|
50
|
-
},
|
|
51
|
-
Excel: {
|
|
52
|
-
useSysDatasource: { isMandatory: false, isVisible: false },
|
|
53
|
-
datasourceConId: { isMandatory: false, isVisible: false },
|
|
54
|
-
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
55
|
-
reportExcelDataQueryId: { isMandatory: true, isVisible: true },
|
|
56
|
-
reportJasperName: { isMandatory: false, isVisible: false },
|
|
57
|
-
},
|
|
58
|
-
};
|
|
18
|
+
const adjustFormAfterValueChange: FormValueChangeCallBk = (
|
|
19
|
+
formValues,
|
|
20
|
+
formActions,
|
|
21
|
+
formManager,
|
|
22
|
+
fieldName,
|
|
23
|
+
newValue
|
|
24
|
+
) => {
|
|
25
|
+
if (fieldName) {
|
|
26
|
+
if (fieldName === "useSysDatasource" && newValue == true) {
|
|
27
|
+
formActions.hideField("datasourceConId");
|
|
28
|
+
formManager.setValue("datasourceConId", null);
|
|
29
|
+
} else {
|
|
30
|
+
formActions.showField("datasourceConId");
|
|
31
|
+
}
|
|
59
32
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
formActions.showField(
|
|
33
|
+
if (fieldName === "reportType") {
|
|
34
|
+
if (newValue === "Blueprint") {
|
|
35
|
+
formActions.hideField("storageType");
|
|
36
|
+
formActions.hideField("includeAppCodeInPath");
|
|
37
|
+
formActions.hideField("useSysDatasource");
|
|
38
|
+
formActions.hideField("datasourceConId");
|
|
39
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
40
|
+
formActions.hideField("reportJasperName");
|
|
41
|
+
formActions.showField("reportBluePrintId");
|
|
42
|
+
} else if (newValue === "Jasper") {
|
|
43
|
+
formActions.showField("storageType");
|
|
44
|
+
formActions.showField("includeAppCodeInPath");
|
|
45
|
+
formActions.showField("useSysDatasource");
|
|
46
|
+
formActions.showField("datasourceConId");
|
|
47
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
48
|
+
formActions.showField("reportJasperName");
|
|
49
|
+
formActions.hideField("reportBluePrintId");
|
|
50
|
+
} else if (newValue === "Excel") {
|
|
51
|
+
formActions.hideField("storageType");
|
|
52
|
+
formActions.hideField("includeAppCodeInPath");
|
|
53
|
+
formActions.hideField("useSysDatasource");
|
|
54
|
+
formActions.hideField("datasourceConId");
|
|
55
|
+
formActions.showField("reportExcelDataQueryId");
|
|
56
|
+
formActions.hideField("reportJasperName");
|
|
57
|
+
formActions.hideField("reportBluePrintId");
|
|
72
58
|
} else {
|
|
73
|
-
formActions.hideField(
|
|
74
|
-
|
|
59
|
+
formActions.hideField("storageType");
|
|
60
|
+
formActions.hideField("includeAppCodeInPath");
|
|
61
|
+
formActions.hideField("useSysDatasource");
|
|
62
|
+
formActions.hideField("datasourceConId");
|
|
63
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
64
|
+
formActions.hideField("reportJasperName");
|
|
65
|
+
formActions.hideField("reportBluePrintId");
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
68
|
} else {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
if (formValues?.useSysCon) {
|
|
70
|
+
formActions.hideField("datasourceConId");
|
|
71
|
+
}
|
|
72
|
+
if (formValues?.reportType) {
|
|
73
|
+
if (formValues?.reportType === "Blueprint") {
|
|
74
|
+
formActions.hideField("storageType");
|
|
75
|
+
formActions.hideField("includeAppCodeInPath");
|
|
76
|
+
formActions.hideField("useSysDatasource");
|
|
77
|
+
formActions.hideField("datasourceConId");
|
|
78
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
79
|
+
formActions.hideField("reportJasperName");
|
|
80
|
+
formActions.showField("reportBluePrintId");
|
|
81
|
+
} else if (formValues?.reportType === "Jasper") {
|
|
82
|
+
formActions.showField("storageType");
|
|
83
|
+
formActions.showField("includeAppCodeInPath");
|
|
84
|
+
formActions.showField("useSysDatasource");
|
|
85
|
+
formActions.showField("datasourceConId");
|
|
86
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
87
|
+
formActions.showField("reportJasperName");
|
|
88
|
+
formActions.hideField("reportBluePrintId");
|
|
89
|
+
} else if (formValues?.reportType === "Excel") {
|
|
90
|
+
formActions.hideField("storageType");
|
|
91
|
+
formActions.hideField("includeAppCodeInPath");
|
|
92
|
+
formActions.hideField("useSysDatasource");
|
|
93
|
+
formActions.hideField("datasourceConId");
|
|
94
|
+
formActions.showField("reportExcelDataQueryId");
|
|
95
|
+
formActions.hideField("reportJasperName");
|
|
96
|
+
formActions.hideField("reportBluePrintId");
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
formActions.hideField("storageType");
|
|
100
|
+
formActions.hideField("includeAppCodeInPath");
|
|
101
|
+
formActions.hideField("useSysDatasource");
|
|
102
|
+
formActions.hideField("datasourceConId");
|
|
103
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
104
|
+
formActions.hideField("reportJasperName");
|
|
105
|
+
formActions.hideField("reportBluePrintId");
|
|
106
|
+
}
|
|
88
107
|
}
|
|
89
108
|
};
|
|
90
109
|
|
|
@@ -209,16 +228,6 @@ const ReportGrid: React.FC = () => {
|
|
|
209
228
|
required: true,
|
|
210
229
|
fieldType: "combobox",
|
|
211
230
|
comboboxValueDataType: "string",
|
|
212
|
-
formProps: {
|
|
213
|
-
onValueChangeCallBack(
|
|
214
|
-
value,
|
|
215
|
-
formManager,
|
|
216
|
-
formActions,
|
|
217
|
-
selectedRecord
|
|
218
|
-
) {
|
|
219
|
-
adjustFormAccordingToReportType(value, formActions, formManager);
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
231
|
},
|
|
223
232
|
},
|
|
224
233
|
{
|
|
@@ -247,7 +256,11 @@ const ReportGrid: React.FC = () => {
|
|
|
247
256
|
props: {
|
|
248
257
|
fieldLabel: "ATTACHMENT_CONFIG_STORAGE_TYPE",
|
|
249
258
|
fieldName: "storageType",
|
|
250
|
-
required:
|
|
259
|
+
required: false,
|
|
260
|
+
hidden: true,
|
|
261
|
+
gridProps: {
|
|
262
|
+
hidden: true,
|
|
263
|
+
},
|
|
251
264
|
comboboxValueDataType: "string",
|
|
252
265
|
fieldType: "combobox",
|
|
253
266
|
options: storageTypes,
|
|
@@ -295,21 +308,6 @@ const ReportGrid: React.FC = () => {
|
|
|
295
308
|
gridProps: {
|
|
296
309
|
hidden: true,
|
|
297
310
|
},
|
|
298
|
-
formProps: {
|
|
299
|
-
onValueChangeCallBack(
|
|
300
|
-
value,
|
|
301
|
-
formManager,
|
|
302
|
-
formActions,
|
|
303
|
-
selectedRecord
|
|
304
|
-
) {
|
|
305
|
-
if (value) {
|
|
306
|
-
formActions.hideField("datasourceConId");
|
|
307
|
-
formManager.setValue("datasourceConId", null);
|
|
308
|
-
} else {
|
|
309
|
-
formActions.showField("datasourceConId");
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
311
|
required: false,
|
|
314
312
|
fieldType: "checkbox",
|
|
315
313
|
},
|
|
@@ -356,10 +354,7 @@ const ReportGrid: React.FC = () => {
|
|
|
356
354
|
props: {
|
|
357
355
|
fieldLabel: "REPORT_REPORT_EXCEL_DATA_QUERY_ID",
|
|
358
356
|
fieldName: "reportExcelDataQueryId",
|
|
359
|
-
|
|
360
|
-
// gridProps: {
|
|
361
|
-
// hidden: true,
|
|
362
|
-
// },
|
|
357
|
+
hidden: true,
|
|
363
358
|
required: false,
|
|
364
359
|
fieldType: "combobox",
|
|
365
360
|
options: SystemDataQueries,
|
|
@@ -414,7 +409,16 @@ const ReportGrid: React.FC = () => {
|
|
|
414
409
|
<ReportParameterGrid selectedRecord={selectedRecord} />
|
|
415
410
|
</ReportParameterWindow>
|
|
416
411
|
<TemplateGrid
|
|
417
|
-
attachment={{
|
|
412
|
+
attachment={{
|
|
413
|
+
attachmentCode: "JASPER_REPORTS",
|
|
414
|
+
enableAttachFn(record) {
|
|
415
|
+
if (record?.reportType === "Jasper") {
|
|
416
|
+
return true;
|
|
417
|
+
} else {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
}}
|
|
418
422
|
apiActions={apiActions}
|
|
419
423
|
data={data}
|
|
420
424
|
setData={setData}
|
|
@@ -447,20 +451,7 @@ const ReportGrid: React.FC = () => {
|
|
|
447
451
|
},
|
|
448
452
|
},
|
|
449
453
|
]}
|
|
450
|
-
|
|
451
|
-
formActions: FormActionProps,
|
|
452
|
-
formManager: UseFormReturn,
|
|
453
|
-
record: any
|
|
454
|
-
) => {
|
|
455
|
-
adjustFormAccordingToReportType(
|
|
456
|
-
record.reportType,
|
|
457
|
-
formActions,
|
|
458
|
-
formManager
|
|
459
|
-
);
|
|
460
|
-
if (record?.useSysDatasource === true) {
|
|
461
|
-
formActions.hideField("datasourceConId");
|
|
462
|
-
}
|
|
463
|
-
}}
|
|
454
|
+
formProps={{ formValuesChangeCallBk: adjustFormAfterValueChange }}
|
|
464
455
|
formElements={formElements}
|
|
465
456
|
keyColumnName={"id"}
|
|
466
457
|
gridTitle={t("REPORT_PLURAL")}
|