@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
|
@@ -1,24 +1,43 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import TransferList from "../../templates/TransferList";
|
|
2
3
|
import { Box, Button } from "@mui/material";
|
|
3
4
|
import { toast } from "react-toastify";
|
|
4
|
-
import { useAxios } from "
|
|
5
|
-
import { TransferList } from "../templates";
|
|
5
|
+
import { useAxios } from "../../../hooks";
|
|
6
6
|
|
|
7
7
|
type RoleAuthoritiesFormProps = {
|
|
8
8
|
roleId: number;
|
|
9
|
-
|
|
10
|
-
currentRoleAuthorities: Array<any>;
|
|
9
|
+
appId: number;
|
|
11
10
|
closeModalFn: () => void;
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
const RoleAuthoritiesForm: React.FC<RoleAuthoritiesFormProps> = (props) => {
|
|
15
|
-
const [selectedOptions, setSelectedOptions] = useState([
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
15
|
+
const [availableAuthorities, setAvailableAuthorities] = useState([]);
|
|
16
|
+
const { handlePostRequest, handleGetRequest } = useAxios();
|
|
17
|
+
|
|
18
|
+
const getRoleAuthorities = async () => {
|
|
19
|
+
await handleGetRequest({
|
|
20
|
+
endPointURI: "api/v1/admin/systemApplicationRoleAuthorities",
|
|
21
|
+
showMask: true,
|
|
22
|
+
parameters: {
|
|
23
|
+
appId: props.appId,
|
|
24
|
+
roleId: props.roleId,
|
|
25
|
+
},
|
|
26
|
+
successCallBkFn: (response: any) => {
|
|
27
|
+
setSelectedOptions(response.data.selectedAuthorities);
|
|
28
|
+
setAvailableAuthorities(response.data.availableAuthorities);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (props.roleId && props.appId) {
|
|
35
|
+
getRoleAuthorities();
|
|
36
|
+
}
|
|
37
|
+
}, [props.roleId, props.appId]);
|
|
19
38
|
const saveRoleAuthorities = async () => {
|
|
20
39
|
await handlePostRequest({
|
|
21
|
-
endPointURI: "api/v1/admin/
|
|
40
|
+
endPointURI: "api/v1/admin/systemApplicationRoleAuthorities",
|
|
22
41
|
showMask: true,
|
|
23
42
|
parameters: { roleId: props.roleId },
|
|
24
43
|
data: selectedOptions,
|
|
@@ -34,7 +53,7 @@ const RoleAuthoritiesForm: React.FC<RoleAuthoritiesFormProps> = (props) => {
|
|
|
34
53
|
<>
|
|
35
54
|
<TransferList
|
|
36
55
|
displayField="authorityName"
|
|
37
|
-
options={
|
|
56
|
+
options={availableAuthorities}
|
|
38
57
|
valueField="id"
|
|
39
58
|
selectedOptions={selectedOptions}
|
|
40
59
|
setSelection={setSelectedOptions}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { useEffect, 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
|
+
|
|
7
|
+
type SystemApplicationAuthorityGridProps = {
|
|
8
|
+
selectedApplication: any;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const SystemApplicationAuthorityGrid: React.FC<
|
|
12
|
+
SystemApplicationAuthorityGridProps
|
|
13
|
+
> = (props) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const [data, setData] = useState([]);
|
|
16
|
+
const apiActions = useApiActions({
|
|
17
|
+
findAll: "api/v1/admin/systemapplicationauthority/all",
|
|
18
|
+
deleteById: "api/v1/admin/systemapplicationauthority",
|
|
19
|
+
save: "api/v1/admin/systemapplicationauthority",
|
|
20
|
+
findById: "api/v1/admin/systemapplicationauthority",
|
|
21
|
+
setData: setData,
|
|
22
|
+
});
|
|
23
|
+
const [systemApplicationModules, setSystemApplicationModules] = useState([]);
|
|
24
|
+
|
|
25
|
+
const { handleGetRequest } = useAxios();
|
|
26
|
+
const getSystemApplicationModules = async () => {
|
|
27
|
+
await handleGetRequest({
|
|
28
|
+
endPointURI: "api/v1/admin/systemapplicationmodule/application/all",
|
|
29
|
+
showMask: true,
|
|
30
|
+
parameters: {
|
|
31
|
+
applicationId: props.selectedApplication.id,
|
|
32
|
+
},
|
|
33
|
+
successCallBkFn: (response: any) => {
|
|
34
|
+
setSystemApplicationModules(response.data);
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
getSystemApplicationModules();
|
|
41
|
+
}, []);
|
|
42
|
+
const formElements: Array<FormElementProps> = [
|
|
43
|
+
{
|
|
44
|
+
type: "field",
|
|
45
|
+
mode: "props",
|
|
46
|
+
props: {
|
|
47
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_SYSTEM_APPLICATION_ID",
|
|
48
|
+
fieldName: "systemApplicationId",
|
|
49
|
+
required: false,
|
|
50
|
+
hidden: true,
|
|
51
|
+
gridProps: { hidden: true },
|
|
52
|
+
fieldType: "number",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "field",
|
|
57
|
+
mode: "props",
|
|
58
|
+
props: {
|
|
59
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_SYSTEM_MODULE_ID",
|
|
60
|
+
fieldName: "systemModuleId",
|
|
61
|
+
required: false,
|
|
62
|
+
fieldType: "combobox",
|
|
63
|
+
options: systemApplicationModules,
|
|
64
|
+
optionValueField: "id",
|
|
65
|
+
optionDisplayField: "moduleName",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
type: "field",
|
|
71
|
+
mode: "props",
|
|
72
|
+
props: {
|
|
73
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_NAME",
|
|
74
|
+
fieldName: "authorityName",
|
|
75
|
+
required: true,
|
|
76
|
+
fieldType: "text",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "field",
|
|
81
|
+
mode: "props",
|
|
82
|
+
props: {
|
|
83
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_CODE",
|
|
84
|
+
fieldName: "authorityCode",
|
|
85
|
+
required: true,
|
|
86
|
+
fieldType: "text",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
{
|
|
91
|
+
type: "field",
|
|
92
|
+
mode: "props",
|
|
93
|
+
props: {
|
|
94
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_DESCRIPTION",
|
|
95
|
+
fieldName: "authorityDescription",
|
|
96
|
+
required: false,
|
|
97
|
+
fieldType: "text",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "field",
|
|
102
|
+
mode: "props",
|
|
103
|
+
props: {
|
|
104
|
+
fieldLabel: "SYSTEM_APPLICATION_AUTHORITY_IS_ACTIVE",
|
|
105
|
+
fieldName: "isActive",
|
|
106
|
+
required: false,
|
|
107
|
+
fieldType: "checkbox",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<TemplateGrid
|
|
114
|
+
apiActions={apiActions}
|
|
115
|
+
data={data}
|
|
116
|
+
hideInfoBar={true}
|
|
117
|
+
gridLoadParametersValues={{
|
|
118
|
+
applicationId: props?.selectedApplication?.id,
|
|
119
|
+
}}
|
|
120
|
+
setData={setData}
|
|
121
|
+
editMode={{ editMode: "row" }}
|
|
122
|
+
formElements={formElements}
|
|
123
|
+
keyColumnName={"id"}
|
|
124
|
+
gridTitle="SYSTEM_APPLICATION_AUTHORITY_PLURAL"
|
|
125
|
+
girdIcon="key"
|
|
126
|
+
editAction={{
|
|
127
|
+
isEnabled: true,
|
|
128
|
+
authority: "SYSTEM_APPLICATION_AUTHORITY_EDIT",
|
|
129
|
+
preActionValidation: async (data) => {
|
|
130
|
+
data.systemApplicationId = props?.selectedApplication?.id;
|
|
131
|
+
return true;
|
|
132
|
+
},
|
|
133
|
+
}}
|
|
134
|
+
deleteAction={{
|
|
135
|
+
isEnabled: true,
|
|
136
|
+
authority: "SYSTEM_APPLICATION_AUTHORITY_DELETE",
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default SystemApplicationAuthorityGrid;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import SystemApplicationModuleGrid from "./SystemApplicationModuleGrid";
|
|
7
|
+
import SystemApplicationAuthorityGrid from "./SystemApplicationAuthorityGrid";
|
|
8
|
+
import SystemApplicationRoleGrid from "./SystemApplicationRoleGrid";
|
|
9
|
+
import LookupGrid from "../dev/LookupGrid";
|
|
10
|
+
|
|
11
|
+
const SystemApplicationGrid: React.FC = () => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const [data, setData] = useState([]);
|
|
14
|
+
const apiActions = useApiActions({
|
|
15
|
+
findAll: "api/v1/admin/systemapplication/all",
|
|
16
|
+
deleteById: "api/v1/admin/systemapplication",
|
|
17
|
+
save: "api/v1/admin/systemapplication",
|
|
18
|
+
findById: "api/v1/admin/systemapplication",
|
|
19
|
+
setData: setData,
|
|
20
|
+
});
|
|
21
|
+
const {
|
|
22
|
+
Window: ApplicationModulesWindow,
|
|
23
|
+
setWindowState: setApplicationModulesWindowState,
|
|
24
|
+
} = useWindow({
|
|
25
|
+
windowTitle: "System Application Modules",
|
|
26
|
+
windowIcon: "layer-group",
|
|
27
|
+
});
|
|
28
|
+
const {
|
|
29
|
+
Window: ApplicationAuthoritiessWindow,
|
|
30
|
+
setWindowState: setApplicationAuthoritiesWindowState,
|
|
31
|
+
} = useWindow({
|
|
32
|
+
windowTitle: "System Application Authorities",
|
|
33
|
+
windowIcon: "key",
|
|
34
|
+
});
|
|
35
|
+
const {
|
|
36
|
+
Window: ApplicationRolesWindow,
|
|
37
|
+
setWindowState: setApplicationRolesWindowState,
|
|
38
|
+
} = useWindow({
|
|
39
|
+
windowTitle: "System Application Roles",
|
|
40
|
+
windowIcon: "tag",
|
|
41
|
+
});
|
|
42
|
+
const {
|
|
43
|
+
Window: ApplicationLookupsWindow,
|
|
44
|
+
setWindowState: setApplicationLookupsWindowState,
|
|
45
|
+
} = useWindow({
|
|
46
|
+
windowTitle: "System Application Lookups",
|
|
47
|
+
windowIcon: "list-check",
|
|
48
|
+
});
|
|
49
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
50
|
+
const formElements: Array<FormElementProps> = [
|
|
51
|
+
{
|
|
52
|
+
type: "field",
|
|
53
|
+
mode: "props",
|
|
54
|
+
props: {
|
|
55
|
+
fieldLabel: "SYSTEM_APPLICATION_APPLICATION_CODE",
|
|
56
|
+
fieldName: "applicationCode",
|
|
57
|
+
required: true,
|
|
58
|
+
fieldType: "text",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "field",
|
|
63
|
+
mode: "props",
|
|
64
|
+
props: {
|
|
65
|
+
fieldLabel: "SYSTEM_APPLICATION_APPLICATION_NAME",
|
|
66
|
+
fieldName: "applicationName",
|
|
67
|
+
required: true,
|
|
68
|
+
fieldType: "text",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "field",
|
|
73
|
+
mode: "props",
|
|
74
|
+
props: {
|
|
75
|
+
fieldLabel: "SYSTEM_APPLICATION_APPLICATION_DESCRIPTION",
|
|
76
|
+
fieldName: "applicationDescription",
|
|
77
|
+
required: false,
|
|
78
|
+
fieldType: "text",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
type: "field",
|
|
84
|
+
mode: "props",
|
|
85
|
+
props: {
|
|
86
|
+
fieldLabel: "SYSTEM_APPLICATION_IS_ACTIVE",
|
|
87
|
+
fieldName: "isActive",
|
|
88
|
+
required: false,
|
|
89
|
+
fieldType: "checkbox",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<ApplicationModulesWindow>
|
|
97
|
+
<SystemApplicationModuleGrid selectedApplication={selectedRecord} />
|
|
98
|
+
</ApplicationModulesWindow>
|
|
99
|
+
<ApplicationAuthoritiessWindow>
|
|
100
|
+
<SystemApplicationAuthorityGrid selectedApplication={selectedRecord} />
|
|
101
|
+
</ApplicationAuthoritiessWindow>
|
|
102
|
+
<ApplicationRolesWindow>
|
|
103
|
+
<SystemApplicationRoleGrid selectedApplication={selectedRecord} />
|
|
104
|
+
</ApplicationRolesWindow>
|
|
105
|
+
<ApplicationLookupsWindow>
|
|
106
|
+
<LookupGrid selectedApplication={selectedRecord} />
|
|
107
|
+
</ApplicationLookupsWindow>
|
|
108
|
+
<TemplateGrid
|
|
109
|
+
apiActions={apiActions}
|
|
110
|
+
rowActions={[
|
|
111
|
+
{
|
|
112
|
+
icon: "layer-group",
|
|
113
|
+
actionFn: async (data) => {
|
|
114
|
+
setSelectedRecord(data);
|
|
115
|
+
setApplicationModulesWindowState(true);
|
|
116
|
+
},
|
|
117
|
+
label: "modules",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
icon: "key",
|
|
121
|
+
actionFn: async (data) => {
|
|
122
|
+
setSelectedRecord(data);
|
|
123
|
+
setApplicationAuthoritiesWindowState(true);
|
|
124
|
+
},
|
|
125
|
+
label: "Authorities",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
icon: "tag",
|
|
129
|
+
actionFn: async (data) => {
|
|
130
|
+
setSelectedRecord(data);
|
|
131
|
+
setApplicationRolesWindowState(true);
|
|
132
|
+
},
|
|
133
|
+
label: "Roles",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
icon: "list-check",
|
|
137
|
+
actionFn: async (data) => {
|
|
138
|
+
setSelectedRecord(data);
|
|
139
|
+
setApplicationLookupsWindowState(true);
|
|
140
|
+
},
|
|
141
|
+
label: "Lookups",
|
|
142
|
+
},
|
|
143
|
+
]}
|
|
144
|
+
data={data}
|
|
145
|
+
setData={setData}
|
|
146
|
+
editMode={{ editMode: "row" }}
|
|
147
|
+
formElements={formElements}
|
|
148
|
+
keyColumnName={"id"}
|
|
149
|
+
gridTitle="SYSTEM_APPLICATION_PLURAL"
|
|
150
|
+
girdIcon="window-restore"
|
|
151
|
+
editAction={{ isEnabled: true, authority: "SYSTEM_APPLICATION_EDIT" }}
|
|
152
|
+
deleteAction={{
|
|
153
|
+
isEnabled: true,
|
|
154
|
+
authority: "SYSTEM_APPLICATION_DELETE",
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
</>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default SystemApplicationGrid;
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
|
|
7
|
+
type SystemApplicationModuleGridProps = {
|
|
8
|
+
selectedApplication: any;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const SystemApplicationModuleGrid: React.FC<
|
|
12
|
+
SystemApplicationModuleGridProps
|
|
13
|
+
> = (props) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const [data, setData] = useState([]);
|
|
16
|
+
const apiActions = useApiActions({
|
|
17
|
+
findAll: "api/v1/admin/systemapplicationmodule/application/all",
|
|
18
|
+
deleteById: "api/v1/admin/systemapplicationmodule",
|
|
19
|
+
save: "api/v1/admin/systemapplicationmodule",
|
|
20
|
+
findById: "api/v1/admin/systemapplicationmodule",
|
|
21
|
+
setData: setData,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const formElements: Array<FormElementProps> = [
|
|
25
|
+
{
|
|
26
|
+
type: "field",
|
|
27
|
+
mode: "props",
|
|
28
|
+
props: {
|
|
29
|
+
fieldLabel: "SYSTEM_APPLICATION_MODULE_MODULE_CODE",
|
|
30
|
+
fieldName: "moduleCode",
|
|
31
|
+
required: true,
|
|
32
|
+
fieldType: "text",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: "field",
|
|
37
|
+
mode: "props",
|
|
38
|
+
props: {
|
|
39
|
+
fieldLabel: "SYSTEM_APPLICATION_MODULE_MODULE_NAME",
|
|
40
|
+
fieldName: "moduleName",
|
|
41
|
+
required: true,
|
|
42
|
+
fieldType: "text",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "field",
|
|
47
|
+
mode: "props",
|
|
48
|
+
props: {
|
|
49
|
+
fieldLabel: "SYSTEM_APPLICATION_MODULE_MODULE_DESCRIPTION",
|
|
50
|
+
fieldName: "moduleDescription",
|
|
51
|
+
required: false,
|
|
52
|
+
fieldType: "text",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "field",
|
|
57
|
+
mode: "props",
|
|
58
|
+
props: {
|
|
59
|
+
fieldLabel: "SYSTEM_APPLICATION_IS_ACTIVE",
|
|
60
|
+
fieldName: "isActive",
|
|
61
|
+
required: false,
|
|
62
|
+
fieldType: "checkbox",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "field",
|
|
67
|
+
mode: "props",
|
|
68
|
+
props: {
|
|
69
|
+
fieldLabel: "SYSTEM_APPLICATION_MODULE_SYSTEM_APPLICATION_ID",
|
|
70
|
+
fieldName: "systemApplicationId",
|
|
71
|
+
hidden: true,
|
|
72
|
+
gridProps: { hidden: true },
|
|
73
|
+
required: false,
|
|
74
|
+
fieldType: "text",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<TemplateGrid
|
|
81
|
+
apiActions={apiActions}
|
|
82
|
+
data={data}
|
|
83
|
+
gridLoadParametersValues={{
|
|
84
|
+
applicationId: props?.selectedApplication?.id,
|
|
85
|
+
}}
|
|
86
|
+
setData={setData}
|
|
87
|
+
editMode={{ editMode: "row" }}
|
|
88
|
+
formElements={formElements}
|
|
89
|
+
keyColumnName={"id"}
|
|
90
|
+
hideInfoBar={true}
|
|
91
|
+
gridTitle="SYSTEM_APPLICATION_MODULE_PLURAL"
|
|
92
|
+
girdIcon="layer-group"
|
|
93
|
+
editAction={{
|
|
94
|
+
isEnabled: true,
|
|
95
|
+
authority: "SYSTEM_APPLICATION_MODULE_EDIT",
|
|
96
|
+
preActionValidation: async (data) => {
|
|
97
|
+
data.systemApplicationId = props?.selectedApplication?.id;
|
|
98
|
+
return true;
|
|
99
|
+
},
|
|
100
|
+
}}
|
|
101
|
+
deleteAction={{
|
|
102
|
+
isEnabled: true,
|
|
103
|
+
authority: "SYSTEM_APPLICATION_MODULE_DELETE",
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default SystemApplicationModuleGrid;
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
|
|
7
|
+
const SystemApplicationRoleAuthorityGrid: React.FC = () => {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const [data, setData] = useState([]);
|
|
10
|
+
const apiActions = useApiActions({
|
|
11
|
+
findAll: "api/v1/admin/systemapplicationroleauthority/all",
|
|
12
|
+
deleteById: "api/v1/admin/systemapplicationroleauthority",
|
|
13
|
+
save: "api/v1/admin/systemapplicationroleauthority",
|
|
14
|
+
findById: "api/v1/admin/systemapplicationroleauthority",
|
|
15
|
+
setData: setData,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const formElements: Array<FormElementProps> = [
|
|
19
|
+
{
|
|
20
|
+
type: "field",
|
|
21
|
+
mode: "props",
|
|
22
|
+
props: {
|
|
23
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_AUTHORITY_IS_ACTIVE",
|
|
24
|
+
fieldName: "isActive",
|
|
25
|
+
required: false,
|
|
26
|
+
fieldType: "checkbox",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: "field",
|
|
31
|
+
mode: "props",
|
|
32
|
+
props: {
|
|
33
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_AUTHORITY_ID",
|
|
34
|
+
fieldName: "systemApplicationAuthorityId",
|
|
35
|
+
required: true,
|
|
36
|
+
fieldType: "text",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: "field",
|
|
41
|
+
mode: "props",
|
|
42
|
+
props: {
|
|
43
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_ROLE_ID",
|
|
44
|
+
fieldName: "systemApplicationRoleId",
|
|
45
|
+
required: true,
|
|
46
|
+
fieldType: "text",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<TemplateGrid
|
|
53
|
+
apiActions={apiActions}
|
|
54
|
+
data={data}
|
|
55
|
+
setData={setData}
|
|
56
|
+
editMode={{ editMode: "row"}}
|
|
57
|
+
formElements={formElements}
|
|
58
|
+
keyColumnName={"id"}
|
|
59
|
+
gridTitle="SYSTEM_APPLICATION_ROLE_AUTHORITY_PLURAL"
|
|
60
|
+
girdIcon="table-cells"
|
|
61
|
+
editAction={{ isEnabled: true, authority: "SYSTEM_APPLICATION_ROLE_AUTHORITY_EDIT" }}
|
|
62
|
+
deleteAction={{ isEnabled: true, authority: "SYSTEM_APPLICATION_ROLE_AUTHORITY_DELETE" }}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default SystemApplicationRoleAuthorityGrid;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import RoleAuthoritiesForm from "./RoleAuthoritiesForm";
|
|
7
|
+
|
|
8
|
+
type SystemApplicationRoleGridProps = {
|
|
9
|
+
selectedApplication: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const SystemApplicationRoleGrid: React.FC<SystemApplicationRoleGridProps> = (
|
|
13
|
+
props
|
|
14
|
+
) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const [data, setData] = useState([]);
|
|
17
|
+
const [selectedRole, setSelectedRole] = useState(null);
|
|
18
|
+
const {
|
|
19
|
+
Window: RoleaAuthoritiesWindow,
|
|
20
|
+
setWindowState: setRoleAuthoritiesWindowState,
|
|
21
|
+
} = useWindow({
|
|
22
|
+
windowTitle: "System Application Role Authorities",
|
|
23
|
+
windowIcon: "key",
|
|
24
|
+
width: "50%",
|
|
25
|
+
});
|
|
26
|
+
const apiActions = useApiActions({
|
|
27
|
+
findAll: "api/v1/admin/systemapplicationrole/all",
|
|
28
|
+
deleteById: "api/v1/admin/systemapplicationrole",
|
|
29
|
+
save: "api/v1/admin/systemapplicationrole",
|
|
30
|
+
findById: "api/v1/admin/systemapplicationrole",
|
|
31
|
+
setData: setData,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const formElements: Array<FormElementProps> = [
|
|
35
|
+
{
|
|
36
|
+
type: "field",
|
|
37
|
+
mode: "props",
|
|
38
|
+
props: {
|
|
39
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_SYSTEM_APPLICATION_ID",
|
|
40
|
+
fieldName: "systemApplicationId",
|
|
41
|
+
required: false,
|
|
42
|
+
hidden: true,
|
|
43
|
+
gridProps: { hidden: true },
|
|
44
|
+
fieldType: "number",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "field",
|
|
49
|
+
mode: "props",
|
|
50
|
+
props: {
|
|
51
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_ROLE_NAME",
|
|
52
|
+
fieldName: "roleName",
|
|
53
|
+
required: true,
|
|
54
|
+
fieldType: "text",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "field",
|
|
59
|
+
mode: "props",
|
|
60
|
+
props: {
|
|
61
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_ROLE_DESCRIPTION",
|
|
62
|
+
fieldName: "roleDescription",
|
|
63
|
+
required: false,
|
|
64
|
+
fieldType: "text",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "field",
|
|
69
|
+
mode: "props",
|
|
70
|
+
props: {
|
|
71
|
+
fieldLabel: "SYSTEM_APPLICATION_ROLE_IS_ACTIVE",
|
|
72
|
+
fieldName: "isActive",
|
|
73
|
+
required: false,
|
|
74
|
+
fieldType: "checkbox",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<RoleaAuthoritiesWindow>
|
|
82
|
+
<RoleAuthoritiesForm
|
|
83
|
+
appId={props.selectedApplication.id}
|
|
84
|
+
roleId={selectedRole?.id}
|
|
85
|
+
closeModalFn={() => {
|
|
86
|
+
setRoleAuthoritiesWindowState(false);
|
|
87
|
+
}}
|
|
88
|
+
/>
|
|
89
|
+
</RoleaAuthoritiesWindow>
|
|
90
|
+
<TemplateGrid
|
|
91
|
+
apiActions={apiActions}
|
|
92
|
+
data={data}
|
|
93
|
+
hideInfoBar={true}
|
|
94
|
+
gridLoadParametersValues={{
|
|
95
|
+
applicationId: props?.selectedApplication?.id,
|
|
96
|
+
}}
|
|
97
|
+
setData={setData}
|
|
98
|
+
editMode={{ editMode: "row" }}
|
|
99
|
+
formElements={formElements}
|
|
100
|
+
keyColumnName={"id"}
|
|
101
|
+
gridTitle="SYSTEM_APPLICATION_ROLE_PLURAL"
|
|
102
|
+
girdIcon="tag"
|
|
103
|
+
rowActions={[
|
|
104
|
+
{
|
|
105
|
+
icon: "key",
|
|
106
|
+
actionFn: async (data) => {
|
|
107
|
+
setSelectedRole(data);
|
|
108
|
+
setRoleAuthoritiesWindowState(true);
|
|
109
|
+
},
|
|
110
|
+
label: "Authorities",
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
editAction={{
|
|
114
|
+
isEnabled: true,
|
|
115
|
+
authority: "SYSTEM_APPLICATION_ROLE_EDIT",
|
|
116
|
+
preActionValidation: async (data) => {
|
|
117
|
+
data.systemApplicationId = props?.selectedApplication?.id;
|
|
118
|
+
return true;
|
|
119
|
+
},
|
|
120
|
+
}}
|
|
121
|
+
deleteAction={{
|
|
122
|
+
isEnabled: true,
|
|
123
|
+
authority: "SYSTEM_APPLICATION_ROLE_DELETE",
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default SystemApplicationRoleGrid;
|