@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,191 @@
|
|
|
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 DataQueryParameterGridProps = {
|
|
9
|
+
selectedRecord: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const DataQueryParameterGrid: React.FC<DataQueryParameterGridProps> = (
|
|
13
|
+
props
|
|
14
|
+
) => {
|
|
15
|
+
const SystemEntityParameters = useSelector(
|
|
16
|
+
(state: any) => state.commonStores.stores.SystemEntityParameters.data
|
|
17
|
+
);
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const [data, setData] = useState([]);
|
|
20
|
+
const apiActions = useApiActions({
|
|
21
|
+
findAll: "api/v1/dev/dataqueryparameter/all",
|
|
22
|
+
deleteById: "api/v1/dev/dataqueryparameter",
|
|
23
|
+
save: "api/v1/dev/dataqueryparameter",
|
|
24
|
+
findById: "api/v1/dev/dataqueryparameter",
|
|
25
|
+
setData: setData,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const formElements: Array<FormElementProps> = [
|
|
29
|
+
{
|
|
30
|
+
type: "field",
|
|
31
|
+
mode: "props",
|
|
32
|
+
props: {
|
|
33
|
+
fieldLabel: "id",
|
|
34
|
+
fieldName: "id",
|
|
35
|
+
fieldType: "number",
|
|
36
|
+
hidden: true,
|
|
37
|
+
gridProps: {
|
|
38
|
+
hidden: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "field",
|
|
44
|
+
mode: "props",
|
|
45
|
+
props: {
|
|
46
|
+
fieldLabel: "createTime",
|
|
47
|
+
fieldName: "createTime",
|
|
48
|
+
fieldType: "datetime",
|
|
49
|
+
hidden: true,
|
|
50
|
+
gridProps: {
|
|
51
|
+
hidden: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "field",
|
|
57
|
+
mode: "props",
|
|
58
|
+
props: {
|
|
59
|
+
fieldLabel: "createdBy",
|
|
60
|
+
fieldName: "createdBy",
|
|
61
|
+
fieldType: "text",
|
|
62
|
+
hidden: true,
|
|
63
|
+
gridProps: {
|
|
64
|
+
hidden: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: "field",
|
|
70
|
+
mode: "props",
|
|
71
|
+
props: {
|
|
72
|
+
fieldLabel: "lastUpdateBy",
|
|
73
|
+
fieldName: "lastUpdateBy",
|
|
74
|
+
fieldType: "text",
|
|
75
|
+
hidden: true,
|
|
76
|
+
gridProps: {
|
|
77
|
+
hidden: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "field",
|
|
83
|
+
mode: "props",
|
|
84
|
+
props: {
|
|
85
|
+
fieldLabel: "lastUpdateTime",
|
|
86
|
+
fieldName: "lastUpdateTime",
|
|
87
|
+
fieldType: "datetime",
|
|
88
|
+
hidden: true,
|
|
89
|
+
gridProps: {
|
|
90
|
+
hidden: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "field",
|
|
96
|
+
mode: "props",
|
|
97
|
+
props: {
|
|
98
|
+
fieldLabel: "DATA_QUERY_PARAMETER_DATA_QUERY_ID",
|
|
99
|
+
fieldName: "dataQueryId",
|
|
100
|
+
required: false,
|
|
101
|
+
fieldType: "number",
|
|
102
|
+
hidden: true,
|
|
103
|
+
gridProps: {
|
|
104
|
+
hidden: true,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "field",
|
|
110
|
+
mode: "props",
|
|
111
|
+
props: {
|
|
112
|
+
fieldLabel: "DATA_QUERY_PARAMETER_ENTITY_PARAMETER_ID",
|
|
113
|
+
fieldName: "entityParameterId",
|
|
114
|
+
required: true,
|
|
115
|
+
fieldType: "combobox",
|
|
116
|
+
options: SystemEntityParameters,
|
|
117
|
+
optionValueField: "id",
|
|
118
|
+
optionDisplayField: "parameterCode",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "field",
|
|
123
|
+
mode: "props",
|
|
124
|
+
props: {
|
|
125
|
+
fieldLabel: "DATA_QUERY_PARAMETER_DEFAULT_VALUE",
|
|
126
|
+
fieldName: "defaultValue",
|
|
127
|
+
required: false,
|
|
128
|
+
fieldType: "text",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: "field",
|
|
133
|
+
mode: "props",
|
|
134
|
+
props: {
|
|
135
|
+
fieldLabel: "DATA_QUERY_PARAMETER_ENABLED",
|
|
136
|
+
fieldName: "enabled",
|
|
137
|
+
required: false,
|
|
138
|
+
fieldType: "checkbox",
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "field",
|
|
143
|
+
mode: "props",
|
|
144
|
+
props: {
|
|
145
|
+
fieldLabel: "DATA_QUERY_PARAMETER_HIDDEN",
|
|
146
|
+
fieldName: "hidden",
|
|
147
|
+
required: false,
|
|
148
|
+
fieldType: "checkbox",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: "field",
|
|
153
|
+
mode: "props",
|
|
154
|
+
props: {
|
|
155
|
+
fieldLabel: "DATA_QUERY_PARAMETER_MANDATORY",
|
|
156
|
+
fieldName: "mandatory",
|
|
157
|
+
required: false,
|
|
158
|
+
fieldType: "checkbox",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<TemplateGrid
|
|
165
|
+
apiActions={apiActions}
|
|
166
|
+
data={data}
|
|
167
|
+
setData={setData}
|
|
168
|
+
editMode={{ editMode: "row" }}
|
|
169
|
+
hideInfoBar={true}
|
|
170
|
+
formElements={formElements}
|
|
171
|
+
keyColumnName={"id"}
|
|
172
|
+
gridLoadParametersValues={{ dataQueryId: props.selectedRecord.id }}
|
|
173
|
+
gridTitle={t("DATA_QUERY_PARAMETER_PLURAL")}
|
|
174
|
+
girdIcon="table-cells"
|
|
175
|
+
editAction={{
|
|
176
|
+
isEnabled: true,
|
|
177
|
+
authority: "DATA_QUERY_PARAMETER_EDIT",
|
|
178
|
+
preActionValidation: async (data) => {
|
|
179
|
+
data.dataQueryId = props.selectedRecord.id;
|
|
180
|
+
return true;
|
|
181
|
+
},
|
|
182
|
+
}}
|
|
183
|
+
deleteAction={{
|
|
184
|
+
isEnabled: true,
|
|
185
|
+
authority: "DATA_QUERY_PARAMETER_DELETE",
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export default DataQueryParameterGrid;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import TransferList from "../../templates/TransferList";
|
|
3
|
+
import { Box, Button } from "@mui/material";
|
|
4
|
+
import { toast } from "react-toastify";
|
|
5
|
+
import { useAxios } from "../../../hooks";
|
|
6
|
+
|
|
7
|
+
type DataQueryParametersFormProps = {
|
|
8
|
+
selectedRecord: any;
|
|
9
|
+
closeModalFn: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const DataQueryParametersForm: React.FC<DataQueryParametersFormProps> = (
|
|
13
|
+
props
|
|
14
|
+
) => {
|
|
15
|
+
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
16
|
+
const [availableOptions, setAvailableOptions] = useState([]);
|
|
17
|
+
const { handlePostRequest, handleGetRequest } = useAxios();
|
|
18
|
+
|
|
19
|
+
const getOptions = async () => {
|
|
20
|
+
await handleGetRequest({
|
|
21
|
+
endPointURI: "api/v1/dev/dataquery/parameters",
|
|
22
|
+
showMask: true,
|
|
23
|
+
parameters: {
|
|
24
|
+
dataQueryId: props.selectedRecord.id,
|
|
25
|
+
},
|
|
26
|
+
successCallBkFn: (response: any) => {
|
|
27
|
+
setSelectedOptions(response.data.selectedOptions);
|
|
28
|
+
setAvailableOptions(response.data.availableOptions);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (props.selectedRecord) {
|
|
35
|
+
getOptions();
|
|
36
|
+
}
|
|
37
|
+
}, [props.selectedRecord]);
|
|
38
|
+
const saveOptions = async () => {
|
|
39
|
+
await handlePostRequest({
|
|
40
|
+
endPointURI: "api/v1/dev/dataquery/parameters",
|
|
41
|
+
showMask: true,
|
|
42
|
+
parameters: { dataQueryId: props.selectedRecord.id },
|
|
43
|
+
data: selectedOptions,
|
|
44
|
+
successCallBkFn: () => {
|
|
45
|
+
toast.success("Your request has been proccesed successfully");
|
|
46
|
+
if (props.closeModalFn) {
|
|
47
|
+
props.closeModalFn();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<TransferList
|
|
55
|
+
displayField="parameterCode"
|
|
56
|
+
options={availableOptions}
|
|
57
|
+
valueField="id"
|
|
58
|
+
selectedOptions={selectedOptions}
|
|
59
|
+
setSelection={setSelectedOptions}
|
|
60
|
+
/>
|
|
61
|
+
<Box
|
|
62
|
+
sx={{
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "flex-end",
|
|
66
|
+
width: "100%",
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<Button
|
|
70
|
+
variant="contained"
|
|
71
|
+
onClick={saveOptions}
|
|
72
|
+
sx={{ marginRight: 1, marginLeft: 1 }}
|
|
73
|
+
>
|
|
74
|
+
Save
|
|
75
|
+
</Button>
|
|
76
|
+
<Button variant="contained" color="error" onClick={props.closeModalFn}>
|
|
77
|
+
Cancel
|
|
78
|
+
</Button>
|
|
79
|
+
</Box>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default DataQueryParametersForm;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions, useAxios } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
|
+
import { toast } from "react-toastify";
|
|
8
|
+
|
|
9
|
+
const DatasourceConnectionGrid: React.FC = () => {
|
|
10
|
+
const { handleGetRequest } = useAxios();
|
|
11
|
+
const SystemDataSourceType = useSelector(
|
|
12
|
+
(state: any) => state.commonStores.stores.SystemDataSourceType.data
|
|
13
|
+
);
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const [data, setData] = useState([]);
|
|
16
|
+
const apiActions = useApiActions({
|
|
17
|
+
deleteById: "api/v1/dev/datasourceconnection",
|
|
18
|
+
save: "api/v1/dev/datasourceconnection",
|
|
19
|
+
findById: "api/v1/dev/datasourceconnection",
|
|
20
|
+
setData: setData,
|
|
21
|
+
commonStoreKey: "SystemDataSources",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const formElements: Array<FormElementProps> = [
|
|
25
|
+
{
|
|
26
|
+
type: "field",
|
|
27
|
+
mode: "props",
|
|
28
|
+
props: {
|
|
29
|
+
fieldLabel: "ID",
|
|
30
|
+
fieldName: "id",
|
|
31
|
+
hidden: true,
|
|
32
|
+
gridProps: {
|
|
33
|
+
hidden: true,
|
|
34
|
+
},
|
|
35
|
+
required: false,
|
|
36
|
+
fieldType: "number",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: "field",
|
|
41
|
+
mode: "props",
|
|
42
|
+
props: {
|
|
43
|
+
fieldLabel: "DATASOURCE_CONNECTION_CONNECTION_NAME",
|
|
44
|
+
fieldName: "connectionName",
|
|
45
|
+
required: true,
|
|
46
|
+
fieldType: "text",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: "field",
|
|
51
|
+
mode: "props",
|
|
52
|
+
props: {
|
|
53
|
+
fieldLabel: "DATASOURCE_CONNECTION_DATASOURCE_TYPE",
|
|
54
|
+
fieldName: "datasourceType",
|
|
55
|
+
required: true,
|
|
56
|
+
fieldType: "combobox",
|
|
57
|
+
options: SystemDataSourceType,
|
|
58
|
+
optionValueField: "value",
|
|
59
|
+
optionDisplayField: "value",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "field",
|
|
64
|
+
mode: "props",
|
|
65
|
+
props: {
|
|
66
|
+
fieldLabel: "DATASOURCE_CONNECTION_DATASOURCE_URL",
|
|
67
|
+
fieldName: "datasourceUrl",
|
|
68
|
+
required: true,
|
|
69
|
+
fieldType: "text",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "field",
|
|
74
|
+
mode: "props",
|
|
75
|
+
props: {
|
|
76
|
+
fieldLabel: "DATASOURCE_CONNECTION_DATASOURCE_USERNAME",
|
|
77
|
+
fieldName: "datasourceUsername",
|
|
78
|
+
required: true,
|
|
79
|
+
fieldType: "text",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "field",
|
|
84
|
+
mode: "props",
|
|
85
|
+
props: {
|
|
86
|
+
fieldLabel: "DATASOURCE_CONNECTION_DATASOURCE_PASSWORD",
|
|
87
|
+
fieldName: "datasourcePassword",
|
|
88
|
+
required: true,
|
|
89
|
+
fieldType: "text",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
type: "field",
|
|
95
|
+
mode: "props",
|
|
96
|
+
props: {
|
|
97
|
+
fieldLabel: "DATASOURCE_CONNECTION_ENABLED",
|
|
98
|
+
fieldName: "enabled",
|
|
99
|
+
required: false,
|
|
100
|
+
fieldType: "checkbox",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<TemplateGrid
|
|
107
|
+
apiActions={apiActions}
|
|
108
|
+
data={data}
|
|
109
|
+
setData={setData}
|
|
110
|
+
editMode={{
|
|
111
|
+
editMode: "modal",
|
|
112
|
+
specs: {
|
|
113
|
+
modalTitle: "Datasource Connection",
|
|
114
|
+
modalIcon: "plug",
|
|
115
|
+
modalWidth: 300,
|
|
116
|
+
},
|
|
117
|
+
}}
|
|
118
|
+
formElements={formElements}
|
|
119
|
+
keyColumnName={"id"}
|
|
120
|
+
gridTitle={t("DATASOURCE_CONNECTION_PLURAL")}
|
|
121
|
+
girdIcon="plug"
|
|
122
|
+
rowActions={[
|
|
123
|
+
{
|
|
124
|
+
icon: "plug",
|
|
125
|
+
label: "test connection",
|
|
126
|
+
actionFn: async (data) => {
|
|
127
|
+
await handleGetRequest({
|
|
128
|
+
endPointURI: "api/v1/dev/datasourceConnection/test",
|
|
129
|
+
showMask: true,
|
|
130
|
+
parameters: {
|
|
131
|
+
id: data.id,
|
|
132
|
+
},
|
|
133
|
+
// loadingMessage: "checking datasource connectivity",
|
|
134
|
+
successCallBkFn: (response: any) => {
|
|
135
|
+
toast.success(response.data);
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
]}
|
|
141
|
+
editAction={{ isEnabled: true, authority: "DATASOURCE_CONNECTION_EDIT" }}
|
|
142
|
+
deleteAction={{
|
|
143
|
+
isEnabled: true,
|
|
144
|
+
authority: "DATASOURCE_CONNECTION_DELETE",
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default DatasourceConnectionGrid;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
|
+
import { DATE_FORMAT, DATE_TIME_FORMAT } from "../../../util";
|
|
8
|
+
|
|
9
|
+
const EntityParameterGrid: React.FC = () => {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const SystemParameterTypes = useSelector(
|
|
12
|
+
(state: any) => state.commonStores.stores.SystemParameterTypes.data
|
|
13
|
+
);
|
|
14
|
+
const [data, setData] = useState([]);
|
|
15
|
+
const apiActions = useApiActions({
|
|
16
|
+
commonStoreKey: "SystemEntityParameters",
|
|
17
|
+
deleteById: "api/v1/dev/entityparameter",
|
|
18
|
+
save: "api/v1/dev/entityparameter",
|
|
19
|
+
findById: "api/v1/dev/entityparameter",
|
|
20
|
+
setData: setData,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const formElements: Array<FormElementProps> = [
|
|
24
|
+
{
|
|
25
|
+
type: "field",
|
|
26
|
+
mode: "props",
|
|
27
|
+
props: {
|
|
28
|
+
fieldLabel: "id",
|
|
29
|
+
fieldName: "id",
|
|
30
|
+
fieldType: "number",
|
|
31
|
+
hidden: true,
|
|
32
|
+
gridProps: {
|
|
33
|
+
hidden: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "field",
|
|
39
|
+
mode: "props",
|
|
40
|
+
props: {
|
|
41
|
+
fieldLabel: "createTime",
|
|
42
|
+
fieldName: "createTime",
|
|
43
|
+
fieldType: "datetime",
|
|
44
|
+
hidden: true,
|
|
45
|
+
gridProps: {
|
|
46
|
+
hidden: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "field",
|
|
52
|
+
mode: "props",
|
|
53
|
+
props: {
|
|
54
|
+
fieldLabel: "createdBy",
|
|
55
|
+
fieldName: "createdBy",
|
|
56
|
+
fieldType: "text",
|
|
57
|
+
hidden: true,
|
|
58
|
+
gridProps: {
|
|
59
|
+
hidden: true,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: "field",
|
|
65
|
+
mode: "props",
|
|
66
|
+
props: {
|
|
67
|
+
fieldLabel: "lastUpdateBy",
|
|
68
|
+
fieldName: "lastUpdateBy",
|
|
69
|
+
fieldType: "text",
|
|
70
|
+
hidden: true,
|
|
71
|
+
gridProps: {
|
|
72
|
+
hidden: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "field",
|
|
78
|
+
mode: "props",
|
|
79
|
+
props: {
|
|
80
|
+
fieldLabel: "lastUpdateTime",
|
|
81
|
+
fieldName: "lastUpdateTime",
|
|
82
|
+
fieldType: "datetime",
|
|
83
|
+
hidden: true,
|
|
84
|
+
gridProps: {
|
|
85
|
+
hidden: true,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
{
|
|
91
|
+
type: "field",
|
|
92
|
+
mode: "props",
|
|
93
|
+
props: {
|
|
94
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_CODE",
|
|
95
|
+
fieldName: "parameterCode",
|
|
96
|
+
required: true,
|
|
97
|
+
fieldType: "text",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "field",
|
|
102
|
+
mode: "props",
|
|
103
|
+
props: {
|
|
104
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_LABEL",
|
|
105
|
+
fieldName: "parameterLabel",
|
|
106
|
+
required: true,
|
|
107
|
+
fieldType: "text",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "field",
|
|
112
|
+
mode: "props",
|
|
113
|
+
props: {
|
|
114
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_TYPE",
|
|
115
|
+
fieldName: "parameterType",
|
|
116
|
+
required: true,
|
|
117
|
+
fieldType: "combobox",
|
|
118
|
+
options: SystemParameterTypes,
|
|
119
|
+
optionDisplayField: "value",
|
|
120
|
+
optionValueField: "value",
|
|
121
|
+
formProps: {
|
|
122
|
+
onValueChangeCallBack(
|
|
123
|
+
value,
|
|
124
|
+
formManager,
|
|
125
|
+
formActions,
|
|
126
|
+
selectedRecord
|
|
127
|
+
) {
|
|
128
|
+
if (value === "combobox") {
|
|
129
|
+
formManager.setValue("parameterValueFormat", null);
|
|
130
|
+
formActions.showField("parameterDataQueryId");
|
|
131
|
+
formActions.showField("parameterDataset");
|
|
132
|
+
formActions.showField("parameterDisplayField");
|
|
133
|
+
formActions.showField("parameterValueField");
|
|
134
|
+
formActions.hideField("parameterValueFormat");
|
|
135
|
+
} else if (value === "date" || value === "datetime") {
|
|
136
|
+
if (value === "date") {
|
|
137
|
+
formManager.setValue("parameterValueFormat", DATE_FORMAT);
|
|
138
|
+
} else if (value === "datetime") {
|
|
139
|
+
formManager.setValue("parameterValueFormat", DATE_TIME_FORMAT);
|
|
140
|
+
}
|
|
141
|
+
formActions.hideField("parameterDataQueryId");
|
|
142
|
+
formActions.hideField("parameterDataset");
|
|
143
|
+
formActions.hideField("parameterDisplayField");
|
|
144
|
+
formActions.hideField("parameterValueField");
|
|
145
|
+
formActions.showField("parameterValueFormat");
|
|
146
|
+
} else {
|
|
147
|
+
formManager.setValue("parameterValueFormat", null);
|
|
148
|
+
formActions.hideField("parameterDataQueryId");
|
|
149
|
+
formActions.hideField("parameterDataset");
|
|
150
|
+
formActions.hideField("parameterDisplayField");
|
|
151
|
+
formActions.hideField("parameterValueField");
|
|
152
|
+
formActions.hideField("parameterValueFormat");
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: "field",
|
|
160
|
+
mode: "props",
|
|
161
|
+
props: {
|
|
162
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_DATA_QUERY_ID",
|
|
163
|
+
fieldName: "parameterDataQueryId",
|
|
164
|
+
hidden: true,
|
|
165
|
+
required: false,
|
|
166
|
+
fieldType: "text",
|
|
167
|
+
formProps: {
|
|
168
|
+
onValueChangeCallBack(
|
|
169
|
+
value,
|
|
170
|
+
formManager,
|
|
171
|
+
formActions,
|
|
172
|
+
selectedRecord
|
|
173
|
+
) {
|
|
174
|
+
if (value != null && value != "") {
|
|
175
|
+
formManager.setValue("parameterDataset", null);
|
|
176
|
+
formActions.hideField("parameterDataset");
|
|
177
|
+
} else {
|
|
178
|
+
formActions.showField("parameterDataset");
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: "field",
|
|
186
|
+
mode: "props",
|
|
187
|
+
props: {
|
|
188
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_DATASET",
|
|
189
|
+
fieldName: "parameterDataset",
|
|
190
|
+
hidden: true,
|
|
191
|
+
required: false,
|
|
192
|
+
fieldType: "text",
|
|
193
|
+
formProps: {
|
|
194
|
+
onValueChangeCallBack(
|
|
195
|
+
value,
|
|
196
|
+
formManager,
|
|
197
|
+
formActions,
|
|
198
|
+
selectedRecord
|
|
199
|
+
) {
|
|
200
|
+
if (value != null && value != "") {
|
|
201
|
+
formManager.setValue("parameterDataQueryId", null);
|
|
202
|
+
formActions.hideField("parameterDataQueryId");
|
|
203
|
+
} else {
|
|
204
|
+
formActions.showField("parameterDataQueryId");
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: "field",
|
|
212
|
+
mode: "props",
|
|
213
|
+
props: {
|
|
214
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_DISPLAY_FIELD",
|
|
215
|
+
fieldName: "parameterDisplayField",
|
|
216
|
+
hidden: true,
|
|
217
|
+
required: false,
|
|
218
|
+
fieldType: "text",
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
{
|
|
223
|
+
type: "field",
|
|
224
|
+
mode: "props",
|
|
225
|
+
props: {
|
|
226
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_VALUE_FIELD",
|
|
227
|
+
fieldName: "parameterValueField",
|
|
228
|
+
hidden: true,
|
|
229
|
+
required: false,
|
|
230
|
+
fieldType: "text",
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: "field",
|
|
235
|
+
mode: "props",
|
|
236
|
+
props: {
|
|
237
|
+
fieldLabel: "ENTITY_PARAMETER_PARAMETER_VALUE_FORMAT",
|
|
238
|
+
fieldName: "parameterValueFormat",
|
|
239
|
+
required: false,
|
|
240
|
+
hidden: true,
|
|
241
|
+
fieldType: "text",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: "field",
|
|
246
|
+
mode: "props",
|
|
247
|
+
props: {
|
|
248
|
+
fieldLabel: "ENTITY_PARAMETER_ENABLED",
|
|
249
|
+
fieldName: "enabled",
|
|
250
|
+
required: false,
|
|
251
|
+
fieldType: "checkbox",
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<TemplateGrid
|
|
258
|
+
apiActions={apiActions}
|
|
259
|
+
data={data}
|
|
260
|
+
setData={setData}
|
|
261
|
+
editMode={{
|
|
262
|
+
editMode: "modal",
|
|
263
|
+
specs: {
|
|
264
|
+
modalTitle: "Entity Parameter",
|
|
265
|
+
modalIcon: "p",
|
|
266
|
+
modalWidth: 300,
|
|
267
|
+
},
|
|
268
|
+
}}
|
|
269
|
+
formElements={formElements}
|
|
270
|
+
keyColumnName={"id"}
|
|
271
|
+
gridTitle={t("ENTITY_PARAMETER_PLURAL")}
|
|
272
|
+
girdIcon="p"
|
|
273
|
+
editAction={{ isEnabled: true, authority: "ENTITY_PARAMETER_EDIT" }}
|
|
274
|
+
deleteAction={{ isEnabled: true, authority: "ENTITY_PARAMETER_DELETE" }}
|
|
275
|
+
/>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export default EntityParameterGrid;
|