@asaleh37/ui-base 26.2.2 → 26.2.13
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.js +45 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/administration/dev/EntityParameterGrid.tsx +20 -5
- package/src/components/templates/report/ReportViewer.tsx +50 -61
- package/src/hooks/useParameterPanel.tsx +1 -1
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import { DATE_FORMAT, DATE_TIME_FORMAT } from "../../../util";
|
|
|
12
12
|
const EntityParameterGrid: React.FC = () => {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const SystemParameterTypes = useSelector(
|
|
15
|
-
(state: any) => state.commonStores.stores.SystemParameterTypes.data
|
|
15
|
+
(state: any) => state.commonStores.stores.SystemParameterTypes.data,
|
|
16
16
|
);
|
|
17
17
|
const [data, setData] = useState([]);
|
|
18
18
|
const apiActions = useApiActions({
|
|
@@ -24,7 +24,7 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const SystemDataQueries = useSelector(
|
|
27
|
-
(state: any) => state.commonStores.stores.SystemDataQueries.data
|
|
27
|
+
(state: any) => state.commonStores.stores.SystemDataQueries.data,
|
|
28
28
|
);
|
|
29
29
|
const adjustFormAccordingFormValues: FormValueChangeCallBk = (
|
|
30
30
|
formValues: any,
|
|
@@ -32,7 +32,7 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
32
32
|
formManager,
|
|
33
33
|
fieldName,
|
|
34
34
|
newValue,
|
|
35
|
-
selectedRecord
|
|
35
|
+
selectedRecord,
|
|
36
36
|
) => {
|
|
37
37
|
if (fieldName) {
|
|
38
38
|
if (fieldName === "parameterType") {
|
|
@@ -41,6 +41,7 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
41
41
|
formActions.showField("parameterDataQueryId");
|
|
42
42
|
formActions.showField("parameterDataset");
|
|
43
43
|
formActions.showField("parameterDisplayField");
|
|
44
|
+
formActions.showField("comboboxValueDataType");
|
|
44
45
|
formActions.showField("parameterValueField");
|
|
45
46
|
formActions.hideField("parameterValueFormat");
|
|
46
47
|
} else {
|
|
@@ -48,6 +49,7 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
48
49
|
formActions.hideField("parameterDataset");
|
|
49
50
|
formActions.hideField("parameterDisplayField");
|
|
50
51
|
formActions.hideField("parameterValueField");
|
|
52
|
+
formActions.hideField("comboboxValueDataType");
|
|
51
53
|
}
|
|
52
54
|
if (newValue === "date" || newValue === "datetime") {
|
|
53
55
|
formActions.showField("parameterValueFormat");
|
|
@@ -75,14 +77,14 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
75
77
|
formActions.showField("parameterDataQueryId");
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
} else {
|
|
80
|
+
} else {
|
|
79
81
|
if (formValues?.parameterType === "combobox") {
|
|
80
82
|
formManager.setValue("parameterValueFormat", null);
|
|
81
83
|
formActions.showField("parameterDataQueryId");
|
|
82
84
|
formActions.showField("parameterDataset");
|
|
83
85
|
formActions.showField("parameterDisplayField");
|
|
84
86
|
formActions.showField("parameterValueField");
|
|
85
|
-
formActions.hideField("parameterValueFormat");
|
|
87
|
+
formActions.hideField("parameterValueFormat");
|
|
86
88
|
} else if (formValues?.parameterType === "date") {
|
|
87
89
|
formActions.hideField("parameterDataQueryId");
|
|
88
90
|
formActions.hideField("parameterDataset");
|
|
@@ -257,6 +259,19 @@ const EntityParameterGrid: React.FC = () => {
|
|
|
257
259
|
fieldType: "text",
|
|
258
260
|
},
|
|
259
261
|
},
|
|
262
|
+
{
|
|
263
|
+
type: "field",
|
|
264
|
+
mode: "props",
|
|
265
|
+
props: {
|
|
266
|
+
fieldLabel: "Value Type",
|
|
267
|
+
fieldName: "comboboxValueDataType",
|
|
268
|
+
fieldType: "combobox",
|
|
269
|
+
options: [{ value: "string" }, { value: "number" }],
|
|
270
|
+
comboboxValueDataType: "string",
|
|
271
|
+
optionDisplayField: "value",
|
|
272
|
+
optionValueField: "value",
|
|
273
|
+
},
|
|
274
|
+
},
|
|
260
275
|
{
|
|
261
276
|
type: "field",
|
|
262
277
|
mode: "props",
|
|
@@ -27,7 +27,7 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
27
27
|
const [errorMessage, setErrorMessage] = useState(null);
|
|
28
28
|
const [excelReportData, setExcelReportData] = useState<Array<any>>([]);
|
|
29
29
|
const [reportViewerState, setReportViewerState] = useState<ReportViewerState>(
|
|
30
|
-
"WAITING_REPORT_CODE"
|
|
30
|
+
"WAITING_REPORT_CODE",
|
|
31
31
|
);
|
|
32
32
|
const { handleGetRequest, handlePostRequest, HandleDownloadHTTPPostPDF } =
|
|
33
33
|
useAxios();
|
|
@@ -52,7 +52,7 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
52
52
|
},
|
|
53
53
|
failureCallBkFn: (response) => {
|
|
54
54
|
setErrorMessage(
|
|
55
|
-
"Failed loading report metadata ... contact your administrator"
|
|
55
|
+
"Failed loading report metadata ... contact your administrator",
|
|
56
56
|
);
|
|
57
57
|
setReportViewerState("ERROR");
|
|
58
58
|
},
|
|
@@ -136,7 +136,7 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
136
136
|
},
|
|
137
137
|
failureCallBkFn: (response) => {
|
|
138
138
|
setErrorMessage(
|
|
139
|
-
"Failed To run report ... contact your administrator"
|
|
139
|
+
"Failed To run report ... contact your administrator",
|
|
140
140
|
);
|
|
141
141
|
setReportViewerState("ERROR");
|
|
142
142
|
},
|
|
@@ -160,9 +160,9 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
160
160
|
<>
|
|
161
161
|
<Box
|
|
162
162
|
sx={{
|
|
163
|
-
display: "flex",
|
|
164
|
-
alignItems: "center",
|
|
165
|
-
justifyContent: "center",
|
|
163
|
+
// display: "flex",
|
|
164
|
+
// alignItems: "center",
|
|
165
|
+
// justifyContent: "center",
|
|
166
166
|
width: "100%",
|
|
167
167
|
}}
|
|
168
168
|
>
|
|
@@ -208,63 +208,52 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
208
208
|
<></>
|
|
209
209
|
)}
|
|
210
210
|
</Box>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
) : reportViewerState === "SHOWING_RESULT" ||
|
|
225
|
-
((reportViewerState === "WAITING_PARAMETER_INPUT" ||
|
|
226
|
-
reportViewerState === "WAITING_RESULT") &&
|
|
227
|
-
reportInfo?.reportType === "Excel") ? (
|
|
228
|
-
reportInfo?.reportType === "Excel" ? (
|
|
229
|
-
<ExcelReportViewer
|
|
230
|
-
reportData={excelReportData}
|
|
231
|
-
setReportData={setExcelReportData}
|
|
232
|
-
reloadReport={async () => {
|
|
233
|
-
runReport(parametersValues);
|
|
234
|
-
}}
|
|
235
|
-
gridLoadParameters={panelElements}
|
|
236
|
-
gridLoadParametersValues={parametersValues}
|
|
237
|
-
setGridLoadParametersValues={setParametersValues}
|
|
238
|
-
/>
|
|
239
|
-
) : (
|
|
240
|
-
<iframe
|
|
241
|
-
src={blobUrl}
|
|
242
|
-
width="100%"
|
|
243
|
-
height="100%"
|
|
244
|
-
title="PDF Preview"
|
|
245
|
-
style={{ border: "1px solid #ccc", marginTop: "20px" }}
|
|
246
|
-
></iframe>
|
|
247
|
-
)
|
|
248
|
-
) : reportViewerState === "ERROR" ? (
|
|
249
|
-
<Box
|
|
250
|
-
sx={{
|
|
251
|
-
display: "flex",
|
|
252
|
-
flex: 1,
|
|
253
|
-
alignItems: "center",
|
|
254
|
-
justifyContent: "center",
|
|
211
|
+
{reportViewerState === "WAITING_PARAMETER_INPUT" &&
|
|
212
|
+
reportInfo?.reportType != "Excel" ? (
|
|
213
|
+
<ParameterPanel searchBtnClickCallBk={runReport} />
|
|
214
|
+
) : reportViewerState === "SHOWING_RESULT" ||
|
|
215
|
+
((reportViewerState === "WAITING_PARAMETER_INPUT" ||
|
|
216
|
+
reportViewerState === "WAITING_RESULT") &&
|
|
217
|
+
reportInfo?.reportType === "Excel") ? (
|
|
218
|
+
reportInfo?.reportType === "Excel" ? (
|
|
219
|
+
<ExcelReportViewer
|
|
220
|
+
reportData={excelReportData}
|
|
221
|
+
setReportData={setExcelReportData}
|
|
222
|
+
reloadReport={async () => {
|
|
223
|
+
runReport(parametersValues);
|
|
255
224
|
}}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
style={{ marginRight: 10, marginLeft: 10 }}
|
|
261
|
-
/>
|
|
262
|
-
{errorMessage}
|
|
263
|
-
</Box>
|
|
225
|
+
gridLoadParameters={panelElements}
|
|
226
|
+
gridLoadParametersValues={parametersValues}
|
|
227
|
+
setGridLoadParametersValues={setParametersValues}
|
|
228
|
+
/>
|
|
264
229
|
) : (
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
230
|
+
<iframe
|
|
231
|
+
src={blobUrl}
|
|
232
|
+
width="100%"
|
|
233
|
+
height="100%"
|
|
234
|
+
title="PDF Preview"
|
|
235
|
+
style={{ border: "1px solid #ccc", marginTop: "20px" }}
|
|
236
|
+
></iframe>
|
|
237
|
+
)
|
|
238
|
+
) : reportViewerState === "ERROR" ? (
|
|
239
|
+
<Box
|
|
240
|
+
sx={{
|
|
241
|
+
display: "flex",
|
|
242
|
+
flex: 1,
|
|
243
|
+
alignItems: "center",
|
|
244
|
+
justifyContent: "center",
|
|
245
|
+
}}
|
|
246
|
+
>
|
|
247
|
+
<FontAwesomeIcon
|
|
248
|
+
icon="circle-exclamation"
|
|
249
|
+
color="darkred"
|
|
250
|
+
style={{ marginRight: 10, marginLeft: 10 }}
|
|
251
|
+
/>
|
|
252
|
+
{errorMessage}
|
|
253
|
+
</Box>
|
|
254
|
+
) : (
|
|
255
|
+
<></>
|
|
256
|
+
)}
|
|
268
257
|
</>
|
|
269
258
|
);
|
|
270
259
|
};
|