@asaleh37/ui-base 1.2.3 → 1.2.5
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 +20 -13
- 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 +15 -3
- package/src/components/App.tsx +1 -1
- package/src/components/BaseApp.tsx +2 -19
- package/src/components/administration/admin/OrgMemberRoleForm.tsx +83 -0
- package/src/components/administration/admin/OrganizationApplicationModuleGrid.tsx +131 -0
- package/src/components/administration/admin/OrganizationGrid.tsx +165 -0
- package/src/components/administration/admin/OrganizationMemberGrid.tsx +176 -0
- package/src/components/administration/admin/OrganizationMemberRoleGrid.tsx +87 -0
- package/src/components/{admin → administration/admin}/OrganizationRankGrid.tsx +49 -19
- package/src/components/administration/admin/OrganizationUnitGrid.tsx +139 -0
- package/src/components/administration/admin/OrganizationUnitTypeGrid.tsx +121 -0
- package/src/components/administration/admin/PersonGrid.tsx +195 -0
- package/src/components/{admin → administration/admin}/RoleAuthoritiesForm.tsx +30 -11
- package/src/components/administration/admin/SystemApplicationAuthorityGrid.tsx +142 -0
- package/src/components/administration/admin/SystemApplicationGrid.tsx +161 -0
- package/src/components/administration/admin/SystemApplicationModuleGrid.tsx +109 -0
- package/src/components/administration/admin/SystemApplicationRoleAuthorityGrid.tsx +67 -0
- package/src/components/administration/admin/SystemApplicationRoleGrid.tsx +130 -0
- package/src/components/administration/dev/BluePrintGrid.tsx +129 -0
- package/src/components/administration/dev/DashboardGrid.tsx +173 -0
- package/src/components/administration/dev/DashboardWidgetGrid.tsx +164 -0
- package/src/components/administration/dev/DataQueryGrid.tsx +206 -0
- package/src/components/administration/dev/DataQueryParameterGrid.tsx +191 -0
- package/src/components/administration/dev/DataQueryParametersForm.tsx +84 -0
- package/src/components/administration/dev/DatasourceConnectionGrid.tsx +150 -0
- package/src/components/administration/dev/EntityParameterGrid.tsx +279 -0
- package/src/components/administration/dev/LookupGrid.tsx +131 -0
- package/src/components/administration/dev/MailAttachmentGrid.tsx +155 -0
- package/src/components/administration/dev/MailBodyGrid.tsx +215 -0
- package/src/components/{admin → administration/dev}/MailNotificationQueueGrid.tsx +114 -26
- package/src/components/administration/dev/MailRecipientGrid.tsx +169 -0
- package/src/components/administration/dev/MailSenderConfigGrid.tsx +478 -0
- package/src/components/administration/dev/MailTemplateGrid.tsx +388 -0
- package/src/components/administration/dev/ReportGrid.tsx +504 -0
- package/src/components/administration/dev/ReportParameterGrid.tsx +186 -0
- package/src/components/administration/dev/ReportParametersForm.tsx +84 -0
- package/src/components/administration/dev/WidgetGrid.tsx +431 -0
- package/src/components/administration/dev/WorkflowDocumentActionGrid.tsx +264 -0
- package/src/components/administration/dev/WorkflowDocumentActionHistoryGrid.tsx +172 -0
- package/src/components/administration/dev/WorkflowDocumentActionMailGrid.tsx +161 -0
- package/src/components/administration/dev/WorkflowDocumentGrid.tsx +377 -0
- package/src/components/{admin → administration/dev}/WorkflowDocumentMailLogGrid.tsx +87 -10
- package/src/components/administration/dev/WorkflowDocumentStatusGrid.tsx +243 -0
- package/src/components/common/ChangeOrgForm.tsx +81 -0
- package/src/components/common/Home.tsx +28 -22
- package/src/components/common/LoadingMask.tsx +9 -4
- package/src/components/common/Login.tsx +9 -13
- package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +30 -6
- package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +46 -5
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +64 -5
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementGroup.tsx +11 -3
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/CheckBox.tsx +2 -2
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx +1 -2
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/HtmlEditor.tsx +144 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/SystemLookupCombobox.tsx +55 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/TemplateTextField.tsx +9 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +45 -5
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx +8 -7
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +38 -10
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridRecordAction.tsx +4 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +3 -4
- package/src/components/templates/TransferList.tsx +16 -6
- package/src/components/templates/index.ts +0 -2
- package/src/components/templates/report/ExcelReportViewer.tsx +65 -0
- package/src/components/templates/report/ReportViewer.tsx +382 -0
- package/src/components/templates/visuals/DashboardRouteView.tsx +9 -0
- package/src/components/templates/visuals/DashboardViewer.tsx +148 -0
- package/src/components/templates/visuals/WidgetViewer.tsx +198 -0
- package/src/components/templates/visuals/charts/TemplateBarChart.tsx +9 -2
- package/src/components/templates/visuals/charts/TemplateDataCard.tsx +6 -31
- package/src/components/templates/visuals/charts/TemplateGauge.tsx +8 -3
- package/src/components/templates/visuals/charts/TemplateLineChart.tsx +8 -2
- package/src/components/templates/visuals/charts/TemplateLineProgress.tsx +5 -3
- package/src/components/templates/visuals/charts/TemplatePieChart.tsx +1 -2
- package/src/components/templates/workflow/WorkflowDocumentPanel.tsx +581 -0
- package/src/components/templates/workflow/WorkflowDocumentTimeLine.tsx +134 -0
- package/src/hooks/UseSession.tsx +3 -7
- package/src/hooks/UseWindow.tsx +2 -1
- package/src/hooks/useAxios.tsx +9 -27
- package/src/hooks/useLookupGridColumn.tsx +35 -0
- package/src/layout/Layout.tsx +2 -46
- package/src/layout/MainContent.tsx +60 -7
- package/src/layout/MobileDrawer.tsx +5 -5
- package/src/layout/NavigationTree.tsx +0 -1
- package/src/layout/RouteWrapper.tsx +36 -0
- package/src/layout/SideBar.tsx +15 -10
- package/src/layout/TopBar.tsx +139 -71
- package/src/locales/arabic/adminLocalsAr.json +81 -344
- package/src/locales/arabic/common.json +11 -1
- package/src/locales/arabic/devLocalsAr.json +280 -0
- package/src/locales/arabic/index.ts +2 -0
- package/src/locales/english/adminLocalsEn.json +86 -346
- package/src/locales/english/common.json +11 -1
- package/src/locales/english/devLocalsEn.json +281 -0
- package/src/locales/english/index.ts +3 -0
- package/src/main.tsx +5 -6
- package/src/navigationItems/Administration/adminNavigationItems.tsx +65 -99
- package/src/navigationItems/Administration/index.tsx +10 -65
- package/src/redux/features/administration/AdministrationStoresMetaData.ts +45 -12
- package/src/redux/features/common/AppLayoutSlice.ts +0 -8
- package/src/redux/features/common/CommonStoreSlice.ts +4 -0
- package/src/redux/features/common/SideBarSlice.ts +29 -0
- package/src/redux/features/common/UserSessionSlice.ts +15 -23
- package/src/redux/store.ts +1 -1
- package/src/routes/administration/adminRoutes.tsx +41 -222
- package/src/routes/administration/devRoutes.tsx +90 -0
- package/src/routes/administration/index.ts +5 -1
- package/src/routes/index.ts +1 -0
- package/src/styles/index.css +3 -3
- package/src/util/AppUtils.ts +5 -0
- package/vite.config.ts +14 -0
- package/src/components/admin/AttachmentGrid.tsx +0 -116
- package/src/components/admin/AuthorityGrid.tsx +0 -88
- package/src/components/admin/BluePrintGrid.tsx +0 -55
- package/src/components/admin/BluePrintPageGrid.tsx +0 -85
- package/src/components/admin/BluePrintPointGrid.tsx +0 -85
- package/src/components/admin/DashboardGrid.tsx +0 -95
- package/src/components/admin/DashboardWidgetGrid.tsx +0 -75
- package/src/components/admin/DataQueryGrid.tsx +0 -75
- package/src/components/admin/DataQueryParameterGrid.tsx +0 -98
- package/src/components/admin/DatasourceConnectionGrid.tsx +0 -98
- package/src/components/admin/EmployeeGrid.tsx +0 -105
- package/src/components/admin/EntityParameterGrid.tsx +0 -125
- package/src/components/admin/ExcelUploaderDetailGrid.tsx +0 -78
- package/src/components/admin/ExcelUploaderHeaderGrid.tsx +0 -78
- package/src/components/admin/LookupGrid.tsx +0 -95
- package/src/components/admin/MailAttachmentGrid.tsx +0 -65
- package/src/components/admin/MailBodyGrid.tsx +0 -105
- package/src/components/admin/MailRecipientGrid.tsx +0 -75
- package/src/components/admin/MailTemplateGrid.tsx +0 -145
- package/src/components/admin/NewTableGrid.tsx +0 -65
- package/src/components/admin/NotificationGrid.tsx +0 -115
- package/src/components/admin/NotificationQueueGrid.tsx +0 -125
- package/src/components/admin/OrganizationApplicationGrid.tsx +0 -81
- package/src/components/admin/OrganizationGrid.tsx +0 -65
- package/src/components/admin/OrganizationUnitGrid.tsx +0 -85
- package/src/components/admin/OrganizationUserGrid.tsx +0 -75
- package/src/components/admin/OrganizationUserRoleGrid.tsx +0 -98
- package/src/components/admin/ReportGrid.tsx +0 -155
- package/src/components/admin/ReportParameterGrid.tsx +0 -95
- package/src/components/admin/RoleAuthorityGrid.tsx +0 -65
- package/src/components/admin/RoleGrid.tsx +0 -132
- package/src/components/admin/UserAccountGrid.tsx +0 -65
- package/src/components/admin/UserRequestGrid.tsx +0 -145
- package/src/components/admin/WidgetGrid.tsx +0 -175
- package/src/components/admin/WorkflowDocumentActionGrid.tsx +0 -111
- package/src/components/admin/WorkflowDocumentActionHistoryGrid.tsx +0 -111
- package/src/components/admin/WorkflowDocumentActionMailGrid.tsx +0 -71
- package/src/components/admin/WorkflowDocumentGrid.tsx +0 -185
- package/src/components/admin/WorkflowDocumentStatusGrid.tsx +0 -121
- package/src/components/templates/visuals/TemplateDashboard.tsx +0 -126
- package/src/redux/features/CounterSlice.tsx +0 -13
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
|
+
import {
|
|
5
|
+
FormActionProps,
|
|
6
|
+
FormElementProps,
|
|
7
|
+
} from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
import { UseFormReturn } from "react-hook-form";
|
|
10
|
+
import { useSelector } from "react-redux";
|
|
11
|
+
import { toast } from "react-toastify";
|
|
12
|
+
import ReportParametersForm from "./ReportParametersForm";
|
|
13
|
+
import ReportParameterGrid from "./ReportParameterGrid";
|
|
14
|
+
import ReportViewer from "../../templates/report/ReportViewer";
|
|
15
|
+
|
|
16
|
+
type ValidationCritria = {
|
|
17
|
+
isVisible: boolean;
|
|
18
|
+
isMandatory: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ReportType = "Jasper" | "Excel" | "Blueprint";
|
|
22
|
+
|
|
23
|
+
type ReportValidationOptions = {
|
|
24
|
+
useSysDatasource: ValidationCritria;
|
|
25
|
+
datasourceConId: ValidationCritria;
|
|
26
|
+
reportBluePrintId: ValidationCritria;
|
|
27
|
+
reportExcelDataQueryId: ValidationCritria;
|
|
28
|
+
reportJasperName: ValidationCritria;
|
|
29
|
+
reportJasperPath: ValidationCritria;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type validationObjectType = {
|
|
33
|
+
[key in ReportType]: ReportValidationOptions;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const validationObject: validationObjectType = {
|
|
37
|
+
Blueprint: {
|
|
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
|
+
reportJasperPath: { isMandatory: false, isVisible: false },
|
|
44
|
+
},
|
|
45
|
+
Jasper: {
|
|
46
|
+
useSysDatasource: { isMandatory: false, isVisible: true },
|
|
47
|
+
datasourceConId: { isMandatory: false, isVisible: true },
|
|
48
|
+
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
49
|
+
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
50
|
+
reportJasperName: { isMandatory: true, isVisible: true },
|
|
51
|
+
reportJasperPath: { isMandatory: true, isVisible: true },
|
|
52
|
+
},
|
|
53
|
+
Excel: {
|
|
54
|
+
useSysDatasource: { isMandatory: false, isVisible: false },
|
|
55
|
+
datasourceConId: { isMandatory: false, isVisible: false },
|
|
56
|
+
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
57
|
+
reportExcelDataQueryId: { isMandatory: true, isVisible: true },
|
|
58
|
+
reportJasperName: { isMandatory: false, isVisible: false },
|
|
59
|
+
reportJasperPath: { isMandatory: false, isVisible: false },
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const adjustFormAccordingToReportType = (
|
|
64
|
+
value: any,
|
|
65
|
+
formActions: FormActionProps,
|
|
66
|
+
formManager: UseFormReturn
|
|
67
|
+
) => {
|
|
68
|
+
if (value && validationObject[value]) {
|
|
69
|
+
const validationObjects: ReportValidationOptions = validationObject[value];
|
|
70
|
+
const fields = Object.keys(validationObjects);
|
|
71
|
+
for (const field of fields) {
|
|
72
|
+
const validationCritria: ValidationCritria = validationObjects[field];
|
|
73
|
+
if (validationCritria.isVisible) {
|
|
74
|
+
formActions.showField(field);
|
|
75
|
+
} else {
|
|
76
|
+
formActions.hideField(field);
|
|
77
|
+
formManager.setValue(field, null);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
formActions.hideField("useSysDatasource");
|
|
82
|
+
formActions.hideField("datasourceConId");
|
|
83
|
+
formActions.hideField("reportBluePrintId");
|
|
84
|
+
formActions.hideField("reportExcelDataQueryId");
|
|
85
|
+
formActions.hideField("reportJasperName");
|
|
86
|
+
formActions.hideField("reportJasperPath");
|
|
87
|
+
formManager.setValue("useSysDatasource", null);
|
|
88
|
+
formManager.setValue("datasourceConId", null);
|
|
89
|
+
formManager.setValue("reportBluePrintId", null);
|
|
90
|
+
formManager.setValue("reportExcelDataQueryId", null);
|
|
91
|
+
formManager.setValue("reportJasperName", null);
|
|
92
|
+
formManager.setValue("reportJasperPath", null);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const ReportGrid: React.FC = () => {
|
|
97
|
+
const { t } = useTranslation();
|
|
98
|
+
const [selectedRecord, setSelectedRecord] = useState(null);
|
|
99
|
+
const {
|
|
100
|
+
Window: ReporTrialWindow,
|
|
101
|
+
setWindowState: setReportTrialWindowState,
|
|
102
|
+
} = useWindow({
|
|
103
|
+
windowTitle: "Report View",
|
|
104
|
+
windowIcon: "eye",
|
|
105
|
+
width: "80%",
|
|
106
|
+
});
|
|
107
|
+
const {
|
|
108
|
+
Window: ReportParameterWindow,
|
|
109
|
+
setWindowState: setReportParameterWindowState,
|
|
110
|
+
} = useWindow({
|
|
111
|
+
windowTitle: "Report Parameters",
|
|
112
|
+
windowIcon: "p",
|
|
113
|
+
width: "80%",
|
|
114
|
+
});
|
|
115
|
+
const [data, setData] = useState([]);
|
|
116
|
+
const SystemDataSources = useSelector(
|
|
117
|
+
(state: any) => state.commonStores.stores.SystemDataSources.data
|
|
118
|
+
);
|
|
119
|
+
const SystemDataQueries = useSelector(
|
|
120
|
+
(state: any) => state.commonStores.stores.SystemDataQueries.data
|
|
121
|
+
);
|
|
122
|
+
const SystemBluePrints = useSelector(
|
|
123
|
+
(state: any) => state.commonStores.stores.SystemBluePrints.data
|
|
124
|
+
);
|
|
125
|
+
const apiActions = useApiActions({
|
|
126
|
+
findAll: "api/v1/dev/report/all",
|
|
127
|
+
deleteById: "api/v1/dev/report",
|
|
128
|
+
save: "api/v1/dev/report",
|
|
129
|
+
findById: "api/v1/dev/report",
|
|
130
|
+
setData: setData,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const formElements: Array<FormElementProps> = [
|
|
134
|
+
{
|
|
135
|
+
type: "field",
|
|
136
|
+
mode: "props",
|
|
137
|
+
props: {
|
|
138
|
+
fieldLabel: "id",
|
|
139
|
+
fieldName: "id",
|
|
140
|
+
fieldType: "number",
|
|
141
|
+
hidden: true,
|
|
142
|
+
gridProps: {
|
|
143
|
+
hidden: true,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
{
|
|
149
|
+
type: "field",
|
|
150
|
+
mode: "props",
|
|
151
|
+
props: {
|
|
152
|
+
fieldLabel: "createTime",
|
|
153
|
+
fieldName: "createTime",
|
|
154
|
+
fieldType: "datetime",
|
|
155
|
+
hidden: true,
|
|
156
|
+
gridProps: {
|
|
157
|
+
hidden: true,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: "field",
|
|
163
|
+
mode: "props",
|
|
164
|
+
props: {
|
|
165
|
+
fieldLabel: "createdBy",
|
|
166
|
+
fieldName: "createdBy",
|
|
167
|
+
fieldType: "text",
|
|
168
|
+
hidden: true,
|
|
169
|
+
gridProps: {
|
|
170
|
+
hidden: true,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
{
|
|
176
|
+
type: "field",
|
|
177
|
+
mode: "props",
|
|
178
|
+
props: {
|
|
179
|
+
fieldLabel: "lastUpdateBy",
|
|
180
|
+
fieldName: "lastUpdateBy",
|
|
181
|
+
fieldType: "text",
|
|
182
|
+
hidden: true,
|
|
183
|
+
gridProps: {
|
|
184
|
+
hidden: true,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: "field",
|
|
190
|
+
mode: "props",
|
|
191
|
+
props: {
|
|
192
|
+
fieldLabel: "lastUpdateTime",
|
|
193
|
+
fieldName: "lastUpdateTime",
|
|
194
|
+
fieldType: "datetime",
|
|
195
|
+
hidden: true,
|
|
196
|
+
gridProps: {
|
|
197
|
+
hidden: true,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: "field",
|
|
203
|
+
mode: "props",
|
|
204
|
+
props: {
|
|
205
|
+
fieldLabel: "REPORT_REPORT_TYPE",
|
|
206
|
+
fieldName: "reportType",
|
|
207
|
+
options: [
|
|
208
|
+
{ value: "Excel" },
|
|
209
|
+
{ value: "Jasper" },
|
|
210
|
+
{ value: "Blueprint" },
|
|
211
|
+
],
|
|
212
|
+
optionDisplayField: "value",
|
|
213
|
+
optionValueField: "value",
|
|
214
|
+
required: true,
|
|
215
|
+
fieldType: "combobox",
|
|
216
|
+
formProps: {
|
|
217
|
+
onValueChangeCallBack(
|
|
218
|
+
value,
|
|
219
|
+
formManager,
|
|
220
|
+
formActions,
|
|
221
|
+
selectedRecord
|
|
222
|
+
) {
|
|
223
|
+
adjustFormAccordingToReportType(value, formActions, formManager);
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: "field",
|
|
230
|
+
mode: "props",
|
|
231
|
+
props: {
|
|
232
|
+
fieldLabel: "REPORT_REPORT_CODE",
|
|
233
|
+
fieldName: "reportCode",
|
|
234
|
+
required: true,
|
|
235
|
+
fieldType: "text",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: "field",
|
|
240
|
+
mode: "props",
|
|
241
|
+
props: {
|
|
242
|
+
fieldLabel: "REPORT_REPORT_NAME",
|
|
243
|
+
fieldName: "reportName",
|
|
244
|
+
required: true,
|
|
245
|
+
fieldType: "text",
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: "field",
|
|
250
|
+
mode: "props",
|
|
251
|
+
props: {
|
|
252
|
+
fieldLabel: "REPORT_REPORT_CATEGORY",
|
|
253
|
+
fieldName: "reportCategory",
|
|
254
|
+
required: false,
|
|
255
|
+
fieldType: "text",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: "field",
|
|
260
|
+
mode: "props",
|
|
261
|
+
props: {
|
|
262
|
+
fieldLabel: "Authority Code",
|
|
263
|
+
fieldName: "reportAuthorityCode",
|
|
264
|
+
required: false,
|
|
265
|
+
fieldType: "text",
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
type: "field",
|
|
270
|
+
mode: "props",
|
|
271
|
+
props: {
|
|
272
|
+
fieldLabel: "REPORT_REPORT_EXPORT_NAME",
|
|
273
|
+
fieldName: "reportExportName",
|
|
274
|
+
required: false,
|
|
275
|
+
fieldType: "text",
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
type: "field",
|
|
280
|
+
mode: "props",
|
|
281
|
+
props: {
|
|
282
|
+
fieldLabel: "REPORT_USE_SYS_DATASOURCE",
|
|
283
|
+
fieldName: "useSysDatasource",
|
|
284
|
+
hidden: true,
|
|
285
|
+
gridProps: {
|
|
286
|
+
hidden: true,
|
|
287
|
+
},
|
|
288
|
+
formProps: {
|
|
289
|
+
onValueChangeCallBack(
|
|
290
|
+
value,
|
|
291
|
+
formManager,
|
|
292
|
+
formActions,
|
|
293
|
+
selectedRecord
|
|
294
|
+
) {
|
|
295
|
+
if (value) {
|
|
296
|
+
formActions.hideField("datasourceConId");
|
|
297
|
+
formManager.setValue("datasourceConId", null);
|
|
298
|
+
} else {
|
|
299
|
+
formActions.showField("datasourceConId");
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
required: false,
|
|
304
|
+
fieldType: "checkbox",
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
type: "field",
|
|
309
|
+
mode: "props",
|
|
310
|
+
props: {
|
|
311
|
+
fieldLabel: "REPORT_DATASOURCE_CON_ID",
|
|
312
|
+
fieldName: "datasourceConId",
|
|
313
|
+
hidden: true,
|
|
314
|
+
gridProps: {
|
|
315
|
+
hidden: true,
|
|
316
|
+
},
|
|
317
|
+
required: false,
|
|
318
|
+
fieldType: "combobox",
|
|
319
|
+
options: SystemDataSources,
|
|
320
|
+
optionValueField: "id",
|
|
321
|
+
optionDisplayField: "connectionName",
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
{
|
|
326
|
+
type: "field",
|
|
327
|
+
mode: "props",
|
|
328
|
+
props: {
|
|
329
|
+
fieldLabel: "REPORT_REPORT_BLUE_PRINT_ID",
|
|
330
|
+
fieldName: "reportBluePrintId",
|
|
331
|
+
hidden: true,
|
|
332
|
+
gridProps: {
|
|
333
|
+
hidden: true,
|
|
334
|
+
},
|
|
335
|
+
required: false,
|
|
336
|
+
fieldType: "combobox",
|
|
337
|
+
options: SystemBluePrints,
|
|
338
|
+
optionDisplayField: "bluePrintCode",
|
|
339
|
+
optionValueField: "id",
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
{
|
|
344
|
+
type: "field",
|
|
345
|
+
mode: "props",
|
|
346
|
+
props: {
|
|
347
|
+
fieldLabel: "REPORT_REPORT_EXCEL_DATA_QUERY_ID",
|
|
348
|
+
fieldName: "reportExcelDataQueryId",
|
|
349
|
+
hidden: true,
|
|
350
|
+
gridProps: {
|
|
351
|
+
hidden: true,
|
|
352
|
+
},
|
|
353
|
+
required: false,
|
|
354
|
+
fieldType: "combobox",
|
|
355
|
+
options: SystemDataQueries,
|
|
356
|
+
optionValueField: "id",
|
|
357
|
+
optionDisplayField: "queryName",
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
type: "field",
|
|
362
|
+
mode: "props",
|
|
363
|
+
props: {
|
|
364
|
+
fieldLabel: "REPORT_REPORT_JASPER_NAME",
|
|
365
|
+
fieldName: "reportJasperName",
|
|
366
|
+
hidden: true,
|
|
367
|
+
gridProps: {
|
|
368
|
+
hidden: true,
|
|
369
|
+
},
|
|
370
|
+
required: false,
|
|
371
|
+
fieldType: "text",
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
type: "field",
|
|
376
|
+
mode: "props",
|
|
377
|
+
props: {
|
|
378
|
+
fieldLabel: "REPORT_REPORT_JASPER_PATH",
|
|
379
|
+
fieldName: "reportJasperPath",
|
|
380
|
+
hidden: true,
|
|
381
|
+
gridProps: {
|
|
382
|
+
hidden: true,
|
|
383
|
+
},
|
|
384
|
+
required: false,
|
|
385
|
+
fieldType: "text",
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
type: "field",
|
|
390
|
+
mode: "props",
|
|
391
|
+
props: {
|
|
392
|
+
fieldLabel: "Active",
|
|
393
|
+
fieldName: "isActive",
|
|
394
|
+
fieldType: "checkbox",
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
];
|
|
398
|
+
|
|
399
|
+
return (
|
|
400
|
+
<>
|
|
401
|
+
<ReporTrialWindow>
|
|
402
|
+
<ReportViewer
|
|
403
|
+
reportCode={selectedRecord?.reportCode}
|
|
404
|
+
resultMode="App"
|
|
405
|
+
/>
|
|
406
|
+
</ReporTrialWindow>
|
|
407
|
+
<ReportParameterWindow>
|
|
408
|
+
<ReportParameterGrid selectedRecord={selectedRecord} />
|
|
409
|
+
</ReportParameterWindow>
|
|
410
|
+
<TemplateGrid
|
|
411
|
+
apiActions={apiActions}
|
|
412
|
+
data={data}
|
|
413
|
+
setData={setData}
|
|
414
|
+
editMode={{
|
|
415
|
+
editMode: "modal",
|
|
416
|
+
specs: {
|
|
417
|
+
modalTitle: "Report",
|
|
418
|
+
modalIcon: "file",
|
|
419
|
+
modalWidth: 300,
|
|
420
|
+
},
|
|
421
|
+
}}
|
|
422
|
+
rowActions={[
|
|
423
|
+
{
|
|
424
|
+
icon: "p",
|
|
425
|
+
label: "Report Parameters",
|
|
426
|
+
isActionVisibleForRecord: (record) => {
|
|
427
|
+
return record.reportType === "Jasper";
|
|
428
|
+
},
|
|
429
|
+
actionFn: async (data, recordIdsToProcessActionOn) => {
|
|
430
|
+
setSelectedRecord(data);
|
|
431
|
+
setReportParameterWindowState(true);
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
icon: "eye",
|
|
436
|
+
label: "View Report",
|
|
437
|
+
actionFn: async (data, recordIdsToProcessActionOn) => {
|
|
438
|
+
setSelectedRecord(data);
|
|
439
|
+
setReportTrialWindowState(true);
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
]}
|
|
443
|
+
formLoadCallBk={(
|
|
444
|
+
formActions: FormActionProps,
|
|
445
|
+
formManager: UseFormReturn,
|
|
446
|
+
record: any
|
|
447
|
+
) => {
|
|
448
|
+
adjustFormAccordingToReportType(
|
|
449
|
+
record.reportType,
|
|
450
|
+
formActions,
|
|
451
|
+
formManager
|
|
452
|
+
);
|
|
453
|
+
if (record?.useSysDatasource === true) {
|
|
454
|
+
formActions.hideField("datasourceConId");
|
|
455
|
+
}
|
|
456
|
+
}}
|
|
457
|
+
formElements={formElements}
|
|
458
|
+
keyColumnName={"id"}
|
|
459
|
+
gridTitle={t("REPORT_PLURAL")}
|
|
460
|
+
girdIcon="table-cells"
|
|
461
|
+
editAction={{
|
|
462
|
+
isEnabled: true,
|
|
463
|
+
authority: "REPORT_EDIT",
|
|
464
|
+
preActionValidation: (record) => {
|
|
465
|
+
if (
|
|
466
|
+
record?.reportType === "Jasper" &&
|
|
467
|
+
record?.useSysDatasource === false &&
|
|
468
|
+
!record?.datasourceConId
|
|
469
|
+
) {
|
|
470
|
+
toast.error("You must choose the datasource");
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
if (record?.reportType === "Jasper" && !record?.reportJasperName) {
|
|
474
|
+
toast.error("You must enter the jasper report name");
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
if (record?.reportType === "Jasper" && !record?.reportJasperPath) {
|
|
478
|
+
toast.error("You must enter the jasper report path");
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
if (
|
|
482
|
+
record?.reportType === "Blueprint" &&
|
|
483
|
+
!record?.reportBluePrintId
|
|
484
|
+
) {
|
|
485
|
+
toast.error("You must choose the report blueprint");
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
if (
|
|
489
|
+
record?.reportType === "Excel" &&
|
|
490
|
+
!record?.reportExcelDataQueryId
|
|
491
|
+
) {
|
|
492
|
+
toast.error("You must choose the report query");
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
return true;
|
|
496
|
+
},
|
|
497
|
+
}}
|
|
498
|
+
deleteAction={{ isEnabled: true, authority: "REPORT_DELETE" }}
|
|
499
|
+
/>
|
|
500
|
+
</>
|
|
501
|
+
);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
export default ReportGrid;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { useApiActions } from "../../../hooks";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
|
+
|
|
8
|
+
type ReportParameterGridProps = {
|
|
9
|
+
selectedRecord: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const ReportParameterGrid: React.FC<ReportParameterGridProps> = (props) => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const SystemEntityParameters = useSelector(
|
|
15
|
+
(state: any) => state.commonStores.stores.SystemEntityParameters.data
|
|
16
|
+
);
|
|
17
|
+
const [data, setData] = useState([]);
|
|
18
|
+
const apiActions = useApiActions({
|
|
19
|
+
findAll: "api/v1/dev/reportparameter/all",
|
|
20
|
+
deleteById: "api/v1/dev/reportparameter",
|
|
21
|
+
save: "api/v1/dev/reportparameter",
|
|
22
|
+
findById: "api/v1/dev/reportparameter",
|
|
23
|
+
setData: setData,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const formElements: Array<FormElementProps> = [
|
|
27
|
+
{
|
|
28
|
+
type: "field",
|
|
29
|
+
mode: "props",
|
|
30
|
+
props: {
|
|
31
|
+
fieldLabel: "id",
|
|
32
|
+
fieldName: "id",
|
|
33
|
+
fieldType: "number",
|
|
34
|
+
hidden: true,
|
|
35
|
+
gridProps: {
|
|
36
|
+
hidden: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: "field",
|
|
42
|
+
mode: "props",
|
|
43
|
+
props: {
|
|
44
|
+
fieldLabel: "createTime",
|
|
45
|
+
fieldName: "createTime",
|
|
46
|
+
fieldType: "datetime",
|
|
47
|
+
hidden: true,
|
|
48
|
+
gridProps: {
|
|
49
|
+
hidden: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "field",
|
|
55
|
+
mode: "props",
|
|
56
|
+
props: {
|
|
57
|
+
fieldLabel: "createdBy",
|
|
58
|
+
fieldName: "createdBy",
|
|
59
|
+
fieldType: "text",
|
|
60
|
+
hidden: true,
|
|
61
|
+
gridProps: {
|
|
62
|
+
hidden: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: "field",
|
|
68
|
+
mode: "props",
|
|
69
|
+
props: {
|
|
70
|
+
fieldLabel: "lastUpdateBy",
|
|
71
|
+
fieldName: "lastUpdateBy",
|
|
72
|
+
fieldType: "text",
|
|
73
|
+
hidden: true,
|
|
74
|
+
gridProps: {
|
|
75
|
+
hidden: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "field",
|
|
81
|
+
mode: "props",
|
|
82
|
+
props: {
|
|
83
|
+
fieldLabel: "lastUpdateTime",
|
|
84
|
+
fieldName: "lastUpdateTime",
|
|
85
|
+
fieldType: "datetime",
|
|
86
|
+
hidden: true,
|
|
87
|
+
gridProps: {
|
|
88
|
+
hidden: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "field",
|
|
94
|
+
mode: "props",
|
|
95
|
+
props: {
|
|
96
|
+
fieldLabel: "REPORT_PARAMETER_ENTITY_PARAMETER_ID",
|
|
97
|
+
fieldName: "entityParameterId",
|
|
98
|
+
required: true,
|
|
99
|
+
fieldType: "combobox",
|
|
100
|
+
options: SystemEntityParameters,
|
|
101
|
+
optionValueField: "id",
|
|
102
|
+
optionDisplayField: "parameterCode",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "field",
|
|
107
|
+
mode: "props",
|
|
108
|
+
props: {
|
|
109
|
+
fieldLabel: "REPORT_PARAMETER_DEFAULT_VALUE",
|
|
110
|
+
fieldName: "defaultValue",
|
|
111
|
+
required: false,
|
|
112
|
+
fieldType: "text",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: "field",
|
|
117
|
+
mode: "props",
|
|
118
|
+
props: {
|
|
119
|
+
fieldLabel: "REPORT_PARAMETER_ENABLED",
|
|
120
|
+
fieldName: "enabled",
|
|
121
|
+
required: false,
|
|
122
|
+
fieldType: "checkbox",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "field",
|
|
127
|
+
mode: "props",
|
|
128
|
+
props: {
|
|
129
|
+
fieldLabel: "REPORT_PARAMETER_HIDDEN",
|
|
130
|
+
fieldName: "hidden",
|
|
131
|
+
required: false,
|
|
132
|
+
fieldType: "checkbox",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: "field",
|
|
137
|
+
mode: "props",
|
|
138
|
+
props: {
|
|
139
|
+
fieldLabel: "REPORT_PARAMETER_MANDATORY",
|
|
140
|
+
fieldName: "mandatory",
|
|
141
|
+
required: false,
|
|
142
|
+
fieldType: "checkbox",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: "field",
|
|
147
|
+
mode: "props",
|
|
148
|
+
props: {
|
|
149
|
+
fieldLabel: "REPORT_PARAMETER_REPORT_ID",
|
|
150
|
+
fieldName: "reportId",
|
|
151
|
+
hidden: true,
|
|
152
|
+
gridProps: {
|
|
153
|
+
hidden: true,
|
|
154
|
+
},
|
|
155
|
+
required: false,
|
|
156
|
+
fieldType: "number",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<TemplateGrid
|
|
163
|
+
apiActions={apiActions}
|
|
164
|
+
data={data}
|
|
165
|
+
hideInfoBar={true}
|
|
166
|
+
setData={setData}
|
|
167
|
+
gridLoadParametersValues={{ reportId: props.selectedRecord.id }}
|
|
168
|
+
editMode={{ editMode: "row" }}
|
|
169
|
+
formElements={formElements}
|
|
170
|
+
keyColumnName={"id"}
|
|
171
|
+
gridTitle={t("REPORT_PARAMETER_PLURAL")}
|
|
172
|
+
girdIcon="p"
|
|
173
|
+
editAction={{
|
|
174
|
+
isEnabled: true,
|
|
175
|
+
authority: "REPORT_PARAMETER_EDIT",
|
|
176
|
+
preActionValidation: async (data) => {
|
|
177
|
+
data.reportId = props.selectedRecord.id;
|
|
178
|
+
return true;
|
|
179
|
+
},
|
|
180
|
+
}}
|
|
181
|
+
deleteAction={{ isEnabled: true, authority: "REPORT_PARAMETER_DELETE" }}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export default ReportParameterGrid;
|