@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asaleh37/ui-base",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Ahmed Saleh Mohamed",
|
|
@@ -67,7 +67,13 @@
|
|
|
67
67
|
"typescript": "~5.7.2",
|
|
68
68
|
"typescript-eslint": "^8.22.0",
|
|
69
69
|
"vite": "^6.1.0",
|
|
70
|
-
"zod": "^3.24.2"
|
|
70
|
+
"zod": "^3.24.2",
|
|
71
|
+
"@mui/lab": "^7.0.0-beta.13",
|
|
72
|
+
"draft-js": "^0.11.7",
|
|
73
|
+
"draft-js-import-html": "^1.4.1",
|
|
74
|
+
"draftjs-to-html": "^0.9.1",
|
|
75
|
+
"react-draft-wysiwyg": "^1.15.0",
|
|
76
|
+
"rollup-plugin-polyfill-node": "^0.13.0"
|
|
71
77
|
},
|
|
72
78
|
"peerDependencies": {
|
|
73
79
|
"@emotion/cache": "^11.14.0",
|
|
@@ -105,7 +111,13 @@
|
|
|
105
111
|
"rollup-plugin-postcss": "^4.0.2",
|
|
106
112
|
"stylis": "^4.3.6",
|
|
107
113
|
"stylis-plugin-rtl": "^2.1.1",
|
|
108
|
-
"zod": "^3.24.2"
|
|
114
|
+
"zod": "^3.24.2",
|
|
115
|
+
"@mui/lab": "^7.0.0-beta.13",
|
|
116
|
+
"draft-js": "^0.11.7",
|
|
117
|
+
"draft-js-import-html": "^1.4.1",
|
|
118
|
+
"draftjs-to-html": "^0.9.1",
|
|
119
|
+
"react-draft-wysiwyg": "^1.15.0",
|
|
120
|
+
"rollup-plugin-polyfill-node": "^0.13.0"
|
|
109
121
|
},
|
|
110
122
|
"dependencies": {
|
|
111
123
|
"@rollup/plugin-json": "^6.1.0"
|
package/src/components/App.tsx
CHANGED
|
@@ -98,7 +98,7 @@ const App: React.FC<AppInfo> = (props: AppInfo) => {
|
|
|
98
98
|
...commonStores,
|
|
99
99
|
...props.businessCommonStoresMetaData,
|
|
100
100
|
};
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
dispatch(setStoresMetaData(commonStores));
|
|
103
103
|
const AppLayoutState = useSelector((state: any) => state.AppLayout);
|
|
104
104
|
let themeOptions = { ...LightThemeOptions };
|
|
@@ -12,6 +12,7 @@ import UserSessionReducer from "../redux/features/common/UserSessionSlice";
|
|
|
12
12
|
import LoadingMaskReducer from "../redux/features/common/LoadingMaskSlice";
|
|
13
13
|
import CommonStoreReducer from "../redux/features/common/CommonStoreSlice";
|
|
14
14
|
import AppInfoReducer from "../redux/features/common/AppInfoSlice";
|
|
15
|
+
import SideBarReducer from "../redux/features/common/SideBarSlice";
|
|
15
16
|
import { configureStore } from "@reduxjs/toolkit";
|
|
16
17
|
|
|
17
18
|
library.add(fab);
|
|
@@ -24,31 +25,13 @@ export const BaseApp: React.FC<AppInfo> = (props) => {
|
|
|
24
25
|
UserSession: UserSessionReducer,
|
|
25
26
|
loadingMask: LoadingMaskReducer,
|
|
26
27
|
commonStores: CommonStoreReducer,
|
|
28
|
+
SideBar: SideBarReducer,
|
|
27
29
|
AppInfo: AppInfoReducer,
|
|
28
30
|
...props.businessReduxReducers,
|
|
29
31
|
};
|
|
30
32
|
const store = configureStore({
|
|
31
33
|
reducer: systemReducers,
|
|
32
34
|
});
|
|
33
|
-
// let csInitialState: CommonStoresInterface = {};
|
|
34
|
-
// if (props.enableAdministrationModule) {
|
|
35
|
-
// for (let adminStoreKey of Object.keys(ADMINISTRATION_STORES)) {
|
|
36
|
-
// csInitialState[adminStoreKey] = ADMINISTRATION_STORES[adminStoreKey];
|
|
37
|
-
// addCommonStore(adminStoreKey, ADMINISTRATION_STORES[adminStoreKey]);
|
|
38
|
-
// }
|
|
39
|
-
// }
|
|
40
|
-
// if (props?.businessCommonStoresMetaData) {
|
|
41
|
-
// for (let businessStoreKey of Object.keys(
|
|
42
|
-
// props.businessCommonStoresMetaData
|
|
43
|
-
// )) {
|
|
44
|
-
// csInitialState[businessStoreKey] =
|
|
45
|
-
// props.businessCommonStoresMetaData[businessStoreKey];
|
|
46
|
-
// addCommonStore(
|
|
47
|
-
// businessStoreKey,
|
|
48
|
-
// props.businessCommonStoresMetaData[businessStoreKey]
|
|
49
|
-
// );
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
35
|
|
|
53
36
|
return (
|
|
54
37
|
<Provider store={store}>
|
|
@@ -0,0 +1,83 @@
|
|
|
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 OrgMemberRoleFormProps = {
|
|
8
|
+
selectedRecord: any;
|
|
9
|
+
closeModalFn: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const OrgMemberRoleForm: React.FC<OrgMemberRoleFormProps> = (props) => {
|
|
13
|
+
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
14
|
+
const [availableOptions, setAvailableOptions] = useState([]);
|
|
15
|
+
const { handlePostRequest, handleGetRequest } = useAxios();
|
|
16
|
+
|
|
17
|
+
const getOrgMemberRoles = async () => {
|
|
18
|
+
await handleGetRequest({
|
|
19
|
+
endPointURI: "api/v1/admin/organization/member/roles",
|
|
20
|
+
showMask: true,
|
|
21
|
+
parameters: {
|
|
22
|
+
orgMemberId: props.selectedRecord.id,
|
|
23
|
+
organizationId: props.selectedRecord.organizationId,
|
|
24
|
+
},
|
|
25
|
+
successCallBkFn: (response: any) => {
|
|
26
|
+
setSelectedOptions(response.data.currentRoles);
|
|
27
|
+
setAvailableOptions(response.data.availableRoles);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (props.selectedRecord) {
|
|
34
|
+
getOrgMemberRoles();
|
|
35
|
+
}
|
|
36
|
+
}, [props.selectedRecord]);
|
|
37
|
+
const saveOrgMemberRoles = async () => {
|
|
38
|
+
await handlePostRequest({
|
|
39
|
+
endPointURI: "api/v1/admin/organization/member/roles",
|
|
40
|
+
showMask: true,
|
|
41
|
+
parameters: { orgMemberId: props.selectedRecord.id },
|
|
42
|
+
data: selectedOptions,
|
|
43
|
+
successCallBkFn: () => {
|
|
44
|
+
toast.success("Your request has been proccesed successfully");
|
|
45
|
+
if (props.closeModalFn) {
|
|
46
|
+
props.closeModalFn();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
return (
|
|
52
|
+
<>
|
|
53
|
+
<TransferList
|
|
54
|
+
displayField="appRoleDisplay"
|
|
55
|
+
options={availableOptions}
|
|
56
|
+
valueField="id"
|
|
57
|
+
selectedOptions={selectedOptions}
|
|
58
|
+
setSelection={setSelectedOptions}
|
|
59
|
+
/>
|
|
60
|
+
<Box
|
|
61
|
+
sx={{
|
|
62
|
+
display: "flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "flex-end",
|
|
65
|
+
width: "100%",
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<Button
|
|
69
|
+
variant="contained"
|
|
70
|
+
onClick={saveOrgMemberRoles}
|
|
71
|
+
sx={{ marginRight: 1, marginLeft: 1 }}
|
|
72
|
+
>
|
|
73
|
+
Save
|
|
74
|
+
</Button>
|
|
75
|
+
<Button variant="contained" color="error" onClick={props.closeModalFn}>
|
|
76
|
+
Cancel
|
|
77
|
+
</Button>
|
|
78
|
+
</Box>
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default OrgMemberRoleForm;
|
|
@@ -0,0 +1,131 @@
|
|
|
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 OrganizationApplicationModuleGridProps = {
|
|
8
|
+
selectedOrganization: any;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const OrganizationApplicationModuleGrid: React.FC<
|
|
12
|
+
OrganizationApplicationModuleGridProps
|
|
13
|
+
> = (props) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const { handleGetRequest } = useAxios();
|
|
16
|
+
const [data, setData] = useState([]);
|
|
17
|
+
const apiActions = useApiActions({
|
|
18
|
+
findAll: "api/v1/admin/organizationapplicationmodule/all",
|
|
19
|
+
deleteById: "api/v1/admin/organizationapplicationmodule",
|
|
20
|
+
save: "api/v1/admin/organizationapplicationmodule",
|
|
21
|
+
findById: "api/v1/admin/organizationapplicationmodule",
|
|
22
|
+
setData: setData,
|
|
23
|
+
});
|
|
24
|
+
const [systemApplicationModules, setSystemApplicationModules] = useState([]);
|
|
25
|
+
|
|
26
|
+
const getSystemApplicationModules = async () => {
|
|
27
|
+
await handleGetRequest({
|
|
28
|
+
endPointURI: "api/v1/admin/systemapplicationmodule/all",
|
|
29
|
+
showMask: true,
|
|
30
|
+
successCallBkFn: (response: any) => {
|
|
31
|
+
setSystemApplicationModules(response.data);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
getSystemApplicationModules();
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const formElements: Array<FormElementProps> = [
|
|
41
|
+
{
|
|
42
|
+
type: "field",
|
|
43
|
+
mode: "props",
|
|
44
|
+
props: {
|
|
45
|
+
fieldLabel:
|
|
46
|
+
"ORGANIZATION_APPLICATION_MODULE_SYSTEM_APPLICATION_MODULE_ID",
|
|
47
|
+
fieldName: "systemApplicationModuleId",
|
|
48
|
+
required: false,
|
|
49
|
+
fieldType: "combobox",
|
|
50
|
+
options: systemApplicationModules,
|
|
51
|
+
optionDisplayField: "moduleName",
|
|
52
|
+
optionValueField: "id",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "field",
|
|
57
|
+
mode: "props",
|
|
58
|
+
props: {
|
|
59
|
+
hidden: true,
|
|
60
|
+
gridProps: {
|
|
61
|
+
hidden: true,
|
|
62
|
+
},
|
|
63
|
+
fieldLabel: "ORGANIZATION_APPLICATION_MODULE_ORGANIZATION_ID",
|
|
64
|
+
fieldName: "organizationId",
|
|
65
|
+
required: false,
|
|
66
|
+
fieldType: "number",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "field",
|
|
71
|
+
mode: "props",
|
|
72
|
+
props: {
|
|
73
|
+
fieldLabel: "ORGANIZATION_APPLICATION_MODULE_SUBSCRIPTION_DATE",
|
|
74
|
+
fieldName: "subscriptionDate",
|
|
75
|
+
required: true,
|
|
76
|
+
fieldType: "date",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "field",
|
|
81
|
+
mode: "props",
|
|
82
|
+
props: {
|
|
83
|
+
fieldLabel: "ORGANIZATION_APPLICATION_MODULE_EXPIRATION_DATE",
|
|
84
|
+
fieldName: "expirationDate",
|
|
85
|
+
required: false,
|
|
86
|
+
fieldType: "date",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "field",
|
|
91
|
+
mode: "props",
|
|
92
|
+
props: {
|
|
93
|
+
fieldLabel: "ORGANIZATION_APPLICATION_MODULE_IS_ACTIVE",
|
|
94
|
+
fieldName: "isActive",
|
|
95
|
+
required: false,
|
|
96
|
+
fieldType: "checkbox",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<TemplateGrid
|
|
103
|
+
apiActions={apiActions}
|
|
104
|
+
data={data}
|
|
105
|
+
gridLoadParametersValues={{
|
|
106
|
+
organizationId: props?.selectedOrganization?.id,
|
|
107
|
+
}}
|
|
108
|
+
hideInfoBar={true}
|
|
109
|
+
setData={setData}
|
|
110
|
+
editMode={{ editMode: "row" }}
|
|
111
|
+
formElements={formElements}
|
|
112
|
+
keyColumnName={"id"}
|
|
113
|
+
gridTitle="ORGANIZATION_APPLICATION_MODULE_PLURAL"
|
|
114
|
+
girdIcon="layer-group"
|
|
115
|
+
editAction={{
|
|
116
|
+
isEnabled: true,
|
|
117
|
+
authority: "ORGANIZATION_APPLICATION_MODULE_EDIT",
|
|
118
|
+
preActionValidation: async (data) => {
|
|
119
|
+
data.organizationId = props?.selectedOrganization?.id;
|
|
120
|
+
return true;
|
|
121
|
+
},
|
|
122
|
+
}}
|
|
123
|
+
deleteAction={{
|
|
124
|
+
isEnabled: true,
|
|
125
|
+
authority: "ORGANIZATION_APPLICATION_MODULE_DELETE",
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default OrganizationApplicationModuleGrid;
|
|
@@ -0,0 +1,165 @@
|
|
|
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 OrganizationApplicationModuleGrid from "./OrganizationApplicationModuleGrid";
|
|
7
|
+
import OrganizationUnitTypeGrid from "./OrganizationUnitTypeGrid";
|
|
8
|
+
import OrganizationUnitGrid from "./OrganizationUnitGrid";
|
|
9
|
+
import OrganizationRankGrid from "./OrganizationRankGrid";
|
|
10
|
+
|
|
11
|
+
const OrganizationGrid: React.FC = () => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const [data, setData] = useState([]);
|
|
14
|
+
const apiActions = useApiActions({
|
|
15
|
+
findAll: "api/v1/admin/organization/all",
|
|
16
|
+
deleteById: "api/v1/admin/organization",
|
|
17
|
+
save: "api/v1/admin/organization",
|
|
18
|
+
findById: "api/v1/admin/organization",
|
|
19
|
+
setData: setData,
|
|
20
|
+
});
|
|
21
|
+
const {
|
|
22
|
+
Window: ApplicationModulesWindow,
|
|
23
|
+
setWindowState: setApplicationWindowState,
|
|
24
|
+
} = useWindow({
|
|
25
|
+
windowTitle: "Organization Subscriped Application Modules",
|
|
26
|
+
windowIcon: "layer-group",
|
|
27
|
+
});
|
|
28
|
+
const {
|
|
29
|
+
Window: OrgUnitTypesWindow,
|
|
30
|
+
setWindowState: setOrgUnitTypesWindowState,
|
|
31
|
+
} = useWindow({
|
|
32
|
+
windowTitle: "Organization Unit Types",
|
|
33
|
+
windowIcon: "tags",
|
|
34
|
+
});
|
|
35
|
+
const { Window: OrgUnitsWindow, setWindowState: setOrgUnitsWindowState } =
|
|
36
|
+
useWindow({
|
|
37
|
+
windowTitle: "Organization Units",
|
|
38
|
+
windowIcon: "folder-tree",
|
|
39
|
+
});
|
|
40
|
+
const { Window: OrgRanksWindow, setWindowState: setOrgRanksWindowState } =
|
|
41
|
+
useWindow({
|
|
42
|
+
windowTitle: "Organization Ranks",
|
|
43
|
+
windowIcon: "street-view",
|
|
44
|
+
});
|
|
45
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
46
|
+
const formElements: Array<FormElementProps> = [
|
|
47
|
+
{
|
|
48
|
+
type: "field",
|
|
49
|
+
mode: "props",
|
|
50
|
+
props: {
|
|
51
|
+
fieldLabel: "ORGANIZATION_ORGANIZATION_CODE",
|
|
52
|
+
fieldName: "organizationCode",
|
|
53
|
+
required: true,
|
|
54
|
+
fieldType: "text",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "field",
|
|
59
|
+
mode: "props",
|
|
60
|
+
props: {
|
|
61
|
+
fieldLabel: "ORGANIZATION_ORGANIZATION_AR_NAME",
|
|
62
|
+
fieldName: "organizationArName",
|
|
63
|
+
required: true,
|
|
64
|
+
fieldType: "text",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "field",
|
|
69
|
+
mode: "props",
|
|
70
|
+
props: {
|
|
71
|
+
fieldLabel: "ORGANIZATION_ORGANIZATION_EN_NAME",
|
|
72
|
+
fieldName: "organizationEnName",
|
|
73
|
+
required: true,
|
|
74
|
+
fieldType: "text",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "field",
|
|
79
|
+
mode: "props",
|
|
80
|
+
props: {
|
|
81
|
+
fieldLabel: "ORGANIZATION_IS_ACTIVE",
|
|
82
|
+
fieldName: "isActive",
|
|
83
|
+
required: false,
|
|
84
|
+
fieldType: "checkbox",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type:'field',
|
|
89
|
+
mode:'props',
|
|
90
|
+
props:{
|
|
91
|
+
fieldLabel:'Status',
|
|
92
|
+
fieldName:'status',
|
|
93
|
+
fieldType:'lookup',
|
|
94
|
+
lookupType:'STATUS'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<>
|
|
101
|
+
<ApplicationModulesWindow>
|
|
102
|
+
<OrganizationApplicationModuleGrid
|
|
103
|
+
selectedOrganization={selectedRecord}
|
|
104
|
+
/>
|
|
105
|
+
</ApplicationModulesWindow>
|
|
106
|
+
<OrgUnitTypesWindow>
|
|
107
|
+
<OrganizationUnitTypeGrid selectedOrganization={selectedRecord} />
|
|
108
|
+
</OrgUnitTypesWindow>
|
|
109
|
+
<OrgUnitsWindow>
|
|
110
|
+
<OrganizationUnitGrid selectedOrganization={selectedRecord} />
|
|
111
|
+
</OrgUnitsWindow>
|
|
112
|
+
<OrgRanksWindow>
|
|
113
|
+
<OrganizationRankGrid selectedOrganization={selectedRecord} />
|
|
114
|
+
</OrgRanksWindow>
|
|
115
|
+
<TemplateGrid
|
|
116
|
+
apiActions={apiActions}
|
|
117
|
+
data={data}
|
|
118
|
+
setData={setData}
|
|
119
|
+
editMode={{ editMode: "row" }}
|
|
120
|
+
rowActions={[
|
|
121
|
+
{
|
|
122
|
+
icon: "layer-group",
|
|
123
|
+
actionFn: async (data) => {
|
|
124
|
+
setSelectedRecord(data);
|
|
125
|
+
setApplicationWindowState(true);
|
|
126
|
+
},
|
|
127
|
+
label: "modules",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
icon: "tags",
|
|
131
|
+
actionFn: async (data) => {
|
|
132
|
+
setSelectedRecord(data);
|
|
133
|
+
setOrgUnitTypesWindowState(true);
|
|
134
|
+
},
|
|
135
|
+
label: "Organization Unit Types",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
icon: "folder-tree",
|
|
139
|
+
actionFn: async (data) => {
|
|
140
|
+
setSelectedRecord(data);
|
|
141
|
+
setOrgUnitsWindowState(true);
|
|
142
|
+
},
|
|
143
|
+
label: "Organization Units",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
icon: "street-view",
|
|
147
|
+
actionFn: async (data) => {
|
|
148
|
+
setSelectedRecord(data);
|
|
149
|
+
setOrgRanksWindowState(true);
|
|
150
|
+
},
|
|
151
|
+
label: "Organization Ranks",
|
|
152
|
+
},
|
|
153
|
+
]}
|
|
154
|
+
formElements={formElements}
|
|
155
|
+
keyColumnName={"id"}
|
|
156
|
+
gridTitle="ORGANIZATION_PLURAL"
|
|
157
|
+
girdIcon="globe"
|
|
158
|
+
editAction={{ isEnabled: true, authority: "ORGANIZATION_EDIT" }}
|
|
159
|
+
deleteAction={{ isEnabled: true, authority: "ORGANIZATION_DELETE" }}
|
|
160
|
+
/>
|
|
161
|
+
</>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export default OrganizationGrid;
|
|
@@ -0,0 +1,176 @@
|
|
|
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 { useSelector } from "react-redux";
|
|
7
|
+
import OrgMemberRoleForm from "./OrgMemberRoleForm";
|
|
8
|
+
|
|
9
|
+
type OrganizationMemberGridProps = {
|
|
10
|
+
selectedPerson: any;
|
|
11
|
+
};
|
|
12
|
+
const OrganizationMemberGrid: React.FC<OrganizationMemberGridProps> = (
|
|
13
|
+
props
|
|
14
|
+
) => {
|
|
15
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
16
|
+
const {
|
|
17
|
+
Window: OrganizationMemberRolesWindow,
|
|
18
|
+
setWindowState: setOrganizationMemberRolesWindowState,
|
|
19
|
+
} = useWindow({
|
|
20
|
+
windowIcon: "tag",
|
|
21
|
+
windowTitle: "Organization Member Roles",
|
|
22
|
+
width: "50%",
|
|
23
|
+
});
|
|
24
|
+
const SystemOrganizations = useSelector(
|
|
25
|
+
(state: any) => state.commonStores.stores.SystemOrganizations.data
|
|
26
|
+
);
|
|
27
|
+
const SystemOrganizationRanks = useSelector(
|
|
28
|
+
(state: any) => state.commonStores.stores.SystemOrganizationRanks.data
|
|
29
|
+
);
|
|
30
|
+
const SystemOrganizationUnits = useSelector(
|
|
31
|
+
(state: any) => state.commonStores.stores.SystemOrganizationUnits.data
|
|
32
|
+
);
|
|
33
|
+
const { t } = useTranslation();
|
|
34
|
+
const [data, setData] = useState([]);
|
|
35
|
+
const apiActions = useApiActions({
|
|
36
|
+
findAll: "api/v1/admin/organizationmember/all",
|
|
37
|
+
deleteById: "api/v1/admin/organizationmember",
|
|
38
|
+
save: "api/v1/admin/organizationmember",
|
|
39
|
+
findById: "api/v1/admin/organizationmember",
|
|
40
|
+
setData: setData,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const formElements: Array<FormElementProps> = [
|
|
44
|
+
{
|
|
45
|
+
type: "field",
|
|
46
|
+
mode: "props",
|
|
47
|
+
props: {
|
|
48
|
+
fieldLabel: "ORGANIZATION_MEMBER_IS_ACTIVE",
|
|
49
|
+
fieldName: "isActive",
|
|
50
|
+
required: false,
|
|
51
|
+
fieldType: "checkbox",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: "field",
|
|
56
|
+
mode: "props",
|
|
57
|
+
props: {
|
|
58
|
+
fieldLabel: "ORGANIZATION_MEMBER_IS_DEFAULT",
|
|
59
|
+
fieldName: "isDefault",
|
|
60
|
+
required: false,
|
|
61
|
+
fieldType: "checkbox",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "field",
|
|
66
|
+
mode: "props",
|
|
67
|
+
props: {
|
|
68
|
+
fieldLabel: "ORGANIZATION_MEMBER_ORGANIZATION_ID",
|
|
69
|
+
fieldName: "organizationId",
|
|
70
|
+
required: true,
|
|
71
|
+
fieldType: "combobox",
|
|
72
|
+
options: SystemOrganizations,
|
|
73
|
+
optionValueField: "id",
|
|
74
|
+
optionDisplayField: "organizationEnName",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "field",
|
|
79
|
+
mode: "props",
|
|
80
|
+
props: {
|
|
81
|
+
fieldLabel: "ORGANIZATION_MEMBER_ORGANIZATION_RANK_ID",
|
|
82
|
+
fieldName: "organizationRankId",
|
|
83
|
+
required: false,
|
|
84
|
+
fieldType: "combobox",
|
|
85
|
+
options: SystemOrganizationRanks,
|
|
86
|
+
optionValueField: "id",
|
|
87
|
+
optionDisplayField: "rankDisplay",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: "field",
|
|
92
|
+
mode: "props",
|
|
93
|
+
props: {
|
|
94
|
+
fieldLabel: "ORGANIZATION_MEMBER_ORGANIZATION_UNIT_ID",
|
|
95
|
+
fieldName: "organizationUnitId",
|
|
96
|
+
required: false,
|
|
97
|
+
fieldType: "combobox",
|
|
98
|
+
options: SystemOrganizationUnits,
|
|
99
|
+
optionValueField: "id",
|
|
100
|
+
optionDisplayField: "fullPath",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "field",
|
|
105
|
+
mode: "props",
|
|
106
|
+
props: {
|
|
107
|
+
fieldLabel: "Membership number",
|
|
108
|
+
fieldName: "organizationMembershipNumber",
|
|
109
|
+
fieldType: "text",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "field",
|
|
114
|
+
mode: "props",
|
|
115
|
+
props: {
|
|
116
|
+
hidden: true,
|
|
117
|
+
gridProps: {
|
|
118
|
+
hidden: true,
|
|
119
|
+
},
|
|
120
|
+
fieldLabel: "ORGANIZATION_MEMBER_PERSON_ID",
|
|
121
|
+
fieldName: "personId",
|
|
122
|
+
required: false,
|
|
123
|
+
fieldType: "number",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<>
|
|
130
|
+
<OrganizationMemberRolesWindow>
|
|
131
|
+
<OrgMemberRoleForm
|
|
132
|
+
selectedRecord={selectedRecord}
|
|
133
|
+
closeModalFn={() => {
|
|
134
|
+
setOrganizationMemberRolesWindowState(false);
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</OrganizationMemberRolesWindow>
|
|
138
|
+
<TemplateGrid
|
|
139
|
+
apiActions={apiActions}
|
|
140
|
+
hideInfoBar={true}
|
|
141
|
+
data={data}
|
|
142
|
+
setData={setData}
|
|
143
|
+
editMode={{ editMode: "row" }}
|
|
144
|
+
formElements={formElements}
|
|
145
|
+
rowActions={[
|
|
146
|
+
{
|
|
147
|
+
icon: "tag",
|
|
148
|
+
label: "Roles",
|
|
149
|
+
actionFn: async (data) => {
|
|
150
|
+
setSelectedRecord(data);
|
|
151
|
+
setOrganizationMemberRolesWindowState(true);
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
]}
|
|
155
|
+
gridLoadParametersValues={{ personId: props.selectedPerson.id }}
|
|
156
|
+
keyColumnName={"id"}
|
|
157
|
+
gridTitle="ORGANIZATION_MEMBER_PLURAL"
|
|
158
|
+
girdIcon="table-cells"
|
|
159
|
+
editAction={{
|
|
160
|
+
isEnabled: true,
|
|
161
|
+
authority: "ORGANIZATION_MEMBER_EDIT",
|
|
162
|
+
preActionValidation: async (data) => {
|
|
163
|
+
data.personId = props.selectedPerson.id;
|
|
164
|
+
return true;
|
|
165
|
+
},
|
|
166
|
+
}}
|
|
167
|
+
deleteAction={{
|
|
168
|
+
isEnabled: true,
|
|
169
|
+
authority: "ORGANIZATION_MEMBER_DELETE",
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
</>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export default OrganizationMemberGrid;
|