@asaleh37/ui-base 1.2.16 → 1.2.18
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/.env.development +1 -1
- package/dist/index.d.ts +27 -5
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/public/no_image.png +0 -0
- package/src/components/administration/admin/OrganizationApplicationModuleGrid.tsx +10 -34
- package/src/components/administration/admin/OrganizationGrid.tsx +4 -87
- package/src/components/administration/admin/OrganizationRankGrid.tsx +34 -16
- package/src/components/administration/admin/OrganizationUnitGrid.tsx +34 -30
- package/src/components/administration/admin/OrganizationUnitTypeGrid.tsx +3 -16
- package/src/components/administration/admin/PersonGrid.tsx +38 -1
- package/src/components/administration/admin/RoleAuthoritiesForm.tsx +2 -4
- package/src/components/administration/admin/SystemApplicationAuthorityGrid.tsx +2 -18
- package/src/components/administration/admin/SystemApplicationGrid.tsx +5 -83
- package/src/components/administration/admin/SystemApplicationModuleGrid.tsx +2 -15
- package/src/components/administration/admin/SystemApplicationRoleGrid.tsx +1 -15
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +213 -0
- package/src/components/administration/dev/AttachmentGrid.tsx +172 -0
- package/src/components/administration/dev/LookupGrid.tsx +1 -12
- package/src/components/common/Home.tsx +24 -22
- package/src/components/index.ts +0 -4
- package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +13 -1
- package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +6 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +1 -3
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/SystemLookupCombobox.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +100 -8
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +105 -4
- package/src/components/templates/attachment/AttachmentCard.tsx +126 -0
- package/src/components/templates/attachment/AttachmentImageViewer.tsx +44 -0
- package/src/components/templates/attachment/AttachmentPanel.tsx +269 -0
- package/src/components/templates/workflow/WorkflowDocumentPanel.tsx +4 -4
- package/src/hooks/UseSession.tsx +20 -2
- package/src/hooks/useAxios.tsx +71 -11
- package/src/hooks/useLookupGridColumn.tsx +2 -2
- package/src/layout/MainContent.tsx +49 -46
- package/src/layout/TopBar.tsx +6 -1
- package/src/locales/arabic/devLocalsAr.json +13 -1
- package/src/locales/english/devLocalsEn.json +13 -1
- package/src/main.tsx +3 -3
- package/src/navigationItems/Administration/adminNavigationItems.tsx +77 -3
- package/src/redux/features/administration/AdministrationStoresMetaData.ts +14 -6
- package/src/routes/administration/adminRoutes.tsx +21 -0
- package/src/routes/administration/devRoutes.tsx +24 -0
- package/public/icons/LICENSE.md +0 -5
- package/public/icons/arrow-clockwise.svg +0 -4
- package/public/icons/arrow-counterclockwise.svg +0 -4
- package/public/icons/journal-text.svg +0 -5
- package/public/icons/justify.svg +0 -3
- package/public/icons/text-center.svg +0 -3
- package/public/icons/text-left.svg +0 -3
- package/public/icons/text-paragraph.svg +0 -3
- package/public/icons/text-right.svg +0 -3
- package/public/icons/type-bold.svg +0 -3
- package/public/icons/type-italic.svg +0 -3
- package/public/icons/type-strikethrough.svg +0 -3
- package/public/icons/type-underline.svg +0 -3
package/package.json
CHANGED
|
Binary file
|
|
@@ -3,39 +3,22 @@ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/Te
|
|
|
3
3
|
import { useApiActions, useAxios } from "../../../hooks";
|
|
4
4
|
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
selectedOrganization: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const OrganizationApplicationModuleGrid: React.FC<
|
|
12
|
-
OrganizationApplicationModuleGridProps
|
|
13
|
-
> = (props) => {
|
|
8
|
+
const OrganizationApplicationModuleGrid: React.FC = () => {
|
|
14
9
|
const { t } = useTranslation();
|
|
15
10
|
const { handleGetRequest } = useAxios();
|
|
16
11
|
const [data, setData] = useState([]);
|
|
17
12
|
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",
|
|
13
|
+
findAll: "api/v1/org/admin/organizationapplicationmodule/all",
|
|
14
|
+
deleteById: "api/org/v1/admin/organizationapplicationmodule",
|
|
15
|
+
save: "api/v1/org/admin/organizationapplicationmodule",
|
|
16
|
+
findById: "api/org/v1/admin/organizationapplicationmodule",
|
|
22
17
|
setData: setData,
|
|
23
18
|
});
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
}, []);
|
|
19
|
+
const SystemApplicationModules = useSelector(
|
|
20
|
+
(state: any) => state.commonStores.stores.SystemApplicationModules.data
|
|
21
|
+
);
|
|
39
22
|
|
|
40
23
|
const formElements: Array<FormElementProps> = [
|
|
41
24
|
{
|
|
@@ -47,7 +30,7 @@ const OrganizationApplicationModuleGrid: React.FC<
|
|
|
47
30
|
fieldName: "systemApplicationModuleId",
|
|
48
31
|
required: false,
|
|
49
32
|
fieldType: "combobox",
|
|
50
|
-
options:
|
|
33
|
+
options: SystemApplicationModules,
|
|
51
34
|
optionDisplayField: "moduleName",
|
|
52
35
|
optionValueField: "id",
|
|
53
36
|
},
|
|
@@ -102,9 +85,6 @@ const OrganizationApplicationModuleGrid: React.FC<
|
|
|
102
85
|
<TemplateGrid
|
|
103
86
|
apiActions={apiActions}
|
|
104
87
|
data={data}
|
|
105
|
-
gridLoadParametersValues={{
|
|
106
|
-
organizationId: props?.selectedOrganization?.id,
|
|
107
|
-
}}
|
|
108
88
|
hideInfoBar={true}
|
|
109
89
|
setData={setData}
|
|
110
90
|
editMode={{ editMode: "row" }}
|
|
@@ -115,10 +95,6 @@ const OrganizationApplicationModuleGrid: React.FC<
|
|
|
115
95
|
editAction={{
|
|
116
96
|
isEnabled: true,
|
|
117
97
|
authority: "ORGANIZATION_APPLICATION_MODULE_EDIT",
|
|
118
|
-
preActionValidation: async (data) => {
|
|
119
|
-
data.organizationId = props?.selectedOrganization?.id;
|
|
120
|
-
return true;
|
|
121
|
-
},
|
|
122
98
|
}}
|
|
123
99
|
deleteAction={{
|
|
124
100
|
isEnabled: true,
|
|
@@ -12,37 +12,12 @@ const OrganizationGrid: React.FC = () => {
|
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const [data, setData] = useState([]);
|
|
14
14
|
const apiActions = useApiActions({
|
|
15
|
-
|
|
16
|
-
deleteById: "api/v1/admin/organization",
|
|
17
|
-
save: "api/v1/admin/organization",
|
|
18
|
-
findById: "api/v1/admin/organization",
|
|
15
|
+
commonStoreKey: "SystemOrganizations",
|
|
16
|
+
deleteById: "api/v1/org/admin/organization",
|
|
17
|
+
save: "api/v1/org/admin/organization",
|
|
18
|
+
findById: "api/v1/org/admin/organization",
|
|
19
19
|
setData: setData,
|
|
20
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
21
|
const formElements: Array<FormElementProps> = [
|
|
47
22
|
{
|
|
48
23
|
type: "field",
|
|
@@ -84,73 +59,15 @@ const OrganizationGrid: React.FC = () => {
|
|
|
84
59
|
fieldType: "checkbox",
|
|
85
60
|
},
|
|
86
61
|
},
|
|
87
|
-
{
|
|
88
|
-
type:'field',
|
|
89
|
-
mode:'props',
|
|
90
|
-
props:{
|
|
91
|
-
fieldLabel:'Status',
|
|
92
|
-
fieldName:'status',
|
|
93
|
-
fieldType:'lookup',
|
|
94
|
-
lookupType:'STATUS'
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
62
|
];
|
|
98
63
|
|
|
99
64
|
return (
|
|
100
65
|
<>
|
|
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
66
|
<TemplateGrid
|
|
116
67
|
apiActions={apiActions}
|
|
117
68
|
data={data}
|
|
118
69
|
setData={setData}
|
|
119
70
|
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
71
|
formElements={formElements}
|
|
155
72
|
keyColumnName={"id"}
|
|
156
73
|
gridTitle="ORGANIZATION_PLURAL"
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
-
import { useApiActions } from "../../../hooks";
|
|
3
|
+
import { useApiActions, useAxios } from "../../../hooks";
|
|
4
4
|
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
|
+
import { setStoreData } from "../../../redux/features/common/CommonStoreSlice";
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
selectedOrganization: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const OrganizationRankGrid: React.FC<OrganizationRankGridProps> = (props) => {
|
|
9
|
+
const OrganizationRankGrid: React.FC = () => {
|
|
12
10
|
const { t } = useTranslation();
|
|
13
11
|
const [data, setData] = useState([]);
|
|
14
12
|
const apiActions = useApiActions({
|
|
15
|
-
findAll: "api/v1/
|
|
13
|
+
findAll: "api/v1/public/organizationrank/all",
|
|
16
14
|
deleteById: "api/v1/admin/organizationrank",
|
|
17
15
|
save: "api/v1/admin/organizationrank",
|
|
18
16
|
findById: "api/v1/admin/organizationrank",
|
|
19
17
|
setData: setData,
|
|
20
18
|
});
|
|
21
19
|
|
|
20
|
+
const { handleGetRequest } = useAxios();
|
|
21
|
+
const SystemOrganizationRanks = useSelector(
|
|
22
|
+
(state: any) => state.commonStores.stores.SystemOrganizationRanks
|
|
23
|
+
);
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const loadOrganizationRanks = async () => {
|
|
26
|
+
await handleGetRequest({
|
|
27
|
+
endPointURI: SystemOrganizationRanks.url,
|
|
28
|
+
showMask: false,
|
|
29
|
+
successCallBkFn: (response) => {
|
|
30
|
+
dispatch(
|
|
31
|
+
setStoreData({
|
|
32
|
+
storeKey: "SystemOrganizationRanks",
|
|
33
|
+
data: response.data,
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
failureCallBkFn: () => {
|
|
38
|
+
dispatch(
|
|
39
|
+
setStoreData({ storeKey: "SystemOrganizationRanks", data: [] })
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
};
|
|
22
44
|
const formElements: Array<FormElementProps> = [
|
|
23
45
|
{
|
|
24
46
|
type: "field",
|
|
@@ -29,7 +51,7 @@ const OrganizationRankGrid: React.FC<OrganizationRankGridProps> = (props) => {
|
|
|
29
51
|
fieldLabel: "ORGANIZATION_RANK_ORGANIZATION_ID",
|
|
30
52
|
fieldName: "organizationId",
|
|
31
53
|
required: false,
|
|
32
|
-
fieldType: "
|
|
54
|
+
fieldType: "number",
|
|
33
55
|
},
|
|
34
56
|
},
|
|
35
57
|
{
|
|
@@ -39,7 +61,7 @@ const OrganizationRankGrid: React.FC<OrganizationRankGridProps> = (props) => {
|
|
|
39
61
|
fieldLabel: "ORGANIZATION_RANK_RANK_ORDER",
|
|
40
62
|
fieldName: "rankOrder",
|
|
41
63
|
required: true,
|
|
42
|
-
fieldType: "
|
|
64
|
+
fieldType: "number",
|
|
43
65
|
},
|
|
44
66
|
},
|
|
45
67
|
{
|
|
@@ -90,11 +112,8 @@ const OrganizationRankGrid: React.FC<OrganizationRankGridProps> = (props) => {
|
|
|
90
112
|
apiActions={apiActions}
|
|
91
113
|
data={data}
|
|
92
114
|
hideInfoBar={true}
|
|
93
|
-
gridLoadParametersValues={{
|
|
94
|
-
organizationId: props?.selectedOrganization?.id,
|
|
95
|
-
}}
|
|
96
115
|
setData={setData}
|
|
97
|
-
editMode={{ editMode: "row" }}
|
|
116
|
+
editMode={{ editMode: "row", reloadAfterSave: true }}
|
|
98
117
|
formElements={formElements}
|
|
99
118
|
keyColumnName={"id"}
|
|
100
119
|
gridTitle="ORGANIZATION_RANK_PLURAL"
|
|
@@ -102,9 +121,8 @@ const OrganizationRankGrid: React.FC<OrganizationRankGridProps> = (props) => {
|
|
|
102
121
|
editAction={{
|
|
103
122
|
isEnabled: true,
|
|
104
123
|
authority: "ORGANIZATION_RANK_EDIT",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return true;
|
|
124
|
+
postActionCallBack: () => {
|
|
125
|
+
loadOrganizationRanks();
|
|
108
126
|
},
|
|
109
127
|
}}
|
|
110
128
|
deleteAction={{ isEnabled: true, authority: "ORGANIZATION_RANK_DELETE" }}
|
|
@@ -3,39 +3,47 @@ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/Te
|
|
|
3
3
|
import { useApiActions, useAxios } from "../../../hooks";
|
|
4
4
|
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
|
+
import { setStoreData } from "../../../redux/features/common/CommonStoreSlice";
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
selectedOrganization: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const OrganizationUnitGrid: React.FC<OrganizationUnitGridProps> = (props) => {
|
|
9
|
+
const OrganizationUnitGrid: React.FC = () => {
|
|
12
10
|
const { t } = useTranslation();
|
|
13
11
|
const [data, setData] = useState([]);
|
|
14
|
-
const apiActions = useApiActions({
|
|
15
|
-
findAll: "api/v1/admin/organizationunit/all",
|
|
16
|
-
deleteById: "api/v1/admin/organizationunit",
|
|
17
|
-
save: "api/v1/admin/organizationunit",
|
|
18
|
-
findById: "api/v1/admin/organizationunit",
|
|
19
|
-
setData: setData,
|
|
20
|
-
});
|
|
21
|
-
const [organizationUnitTypes, setOrganizationUnitTypes] = useState([]);
|
|
22
12
|
const { handleGetRequest } = useAxios();
|
|
23
|
-
const
|
|
13
|
+
const SystemOrganizationUnits = useSelector(
|
|
14
|
+
(state: any) => state.commonStores.stores.SystemOrganizationUnits
|
|
15
|
+
);
|
|
16
|
+
const dispatch = useDispatch();
|
|
17
|
+
const loadOrganizationUnits = async () => {
|
|
24
18
|
await handleGetRequest({
|
|
25
|
-
endPointURI:
|
|
26
|
-
showMask:
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
endPointURI: SystemOrganizationUnits.url,
|
|
20
|
+
showMask: false,
|
|
21
|
+
successCallBkFn: (response) => {
|
|
22
|
+
dispatch(
|
|
23
|
+
setStoreData({
|
|
24
|
+
storeKey: "SystemOrganizationUnits",
|
|
25
|
+
data: response.data,
|
|
26
|
+
})
|
|
27
|
+
);
|
|
29
28
|
},
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
failureCallBkFn: () => {
|
|
30
|
+
dispatch(
|
|
31
|
+
setStoreData({ storeKey: "SystemOrganizationUnits", data: [] })
|
|
32
|
+
);
|
|
32
33
|
},
|
|
33
34
|
});
|
|
34
35
|
};
|
|
36
|
+
const apiActions = useApiActions({
|
|
37
|
+
findAll: "api/v1/public/organizationunit/all",
|
|
38
|
+
deleteById: "api/v1/admin/organizationunit",
|
|
39
|
+
save: "api/v1/admin/organizationunit",
|
|
40
|
+
findById: "api/v1/admin/organizationunit",
|
|
41
|
+
setData: setData,
|
|
42
|
+
});
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
const organizationUnitTypes = useSelector(
|
|
45
|
+
(state: any) => state.commonStores.stores.SystemOrganizationUnitType.data
|
|
46
|
+
);
|
|
39
47
|
|
|
40
48
|
const formElements: Array<FormElementProps> = [
|
|
41
49
|
{
|
|
@@ -47,7 +55,7 @@ const OrganizationUnitGrid: React.FC<OrganizationUnitGridProps> = (props) => {
|
|
|
47
55
|
fieldLabel: "ORGANIZATION_UNIT_ORGANIZATION_ID",
|
|
48
56
|
fieldName: "organizationId",
|
|
49
57
|
required: false,
|
|
50
|
-
fieldType: "
|
|
58
|
+
fieldType: "number",
|
|
51
59
|
},
|
|
52
60
|
},
|
|
53
61
|
|
|
@@ -114,9 +122,6 @@ const OrganizationUnitGrid: React.FC<OrganizationUnitGridProps> = (props) => {
|
|
|
114
122
|
apiActions={apiActions}
|
|
115
123
|
data={data}
|
|
116
124
|
hideInfoBar={true}
|
|
117
|
-
gridLoadParametersValues={{
|
|
118
|
-
organizationId: props?.selectedOrganization?.id,
|
|
119
|
-
}}
|
|
120
125
|
setData={setData}
|
|
121
126
|
editMode={{ editMode: "row" }}
|
|
122
127
|
formElements={formElements}
|
|
@@ -126,9 +131,8 @@ const OrganizationUnitGrid: React.FC<OrganizationUnitGridProps> = (props) => {
|
|
|
126
131
|
editAction={{
|
|
127
132
|
isEnabled: true,
|
|
128
133
|
authority: "ORGANIZATION_UNIT_EDIT",
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return true;
|
|
134
|
+
postActionCallBack: () => {
|
|
135
|
+
loadOrganizationUnits();
|
|
132
136
|
},
|
|
133
137
|
}}
|
|
134
138
|
deleteAction={{ isEnabled: true, authority: "ORGANIZATION_UNIT_DELETE" }}
|
|
@@ -4,17 +4,11 @@ import { useApiActions } from "../../../hooks";
|
|
|
4
4
|
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
selectedOrganization: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const OrganizationUnitTypeGrid: React.FC<OrganizationUnitTypeGridProps> = (
|
|
12
|
-
props
|
|
13
|
-
) => {
|
|
7
|
+
const OrganizationUnitTypeGrid: React.FC = () => {
|
|
14
8
|
const { t } = useTranslation();
|
|
15
9
|
const [data, setData] = useState([]);
|
|
16
10
|
const apiActions = useApiActions({
|
|
17
|
-
|
|
11
|
+
commonStoreKey: "SystemOrganizationUnitType",
|
|
18
12
|
deleteById: "api/v1/admin/organizationunittype",
|
|
19
13
|
save: "api/v1/admin/organizationunittype",
|
|
20
14
|
findById: "api/v1/admin/organizationunittype",
|
|
@@ -93,11 +87,8 @@ const OrganizationUnitTypeGrid: React.FC<OrganizationUnitTypeGridProps> = (
|
|
|
93
87
|
apiActions={apiActions}
|
|
94
88
|
data={data}
|
|
95
89
|
hideInfoBar={true}
|
|
96
|
-
gridLoadParametersValues={{
|
|
97
|
-
organizationId: props?.selectedOrganization?.id,
|
|
98
|
-
}}
|
|
99
90
|
setData={setData}
|
|
100
|
-
editMode={{ editMode: "row" }}
|
|
91
|
+
editMode={{ editMode: "row", reloadAfterSave: true }}
|
|
101
92
|
formElements={formElements}
|
|
102
93
|
keyColumnName={"id"}
|
|
103
94
|
gridTitle="ORGANIZATION_UNIT_TYPE_PLURAL"
|
|
@@ -105,10 +96,6 @@ const OrganizationUnitTypeGrid: React.FC<OrganizationUnitTypeGridProps> = (
|
|
|
105
96
|
editAction={{
|
|
106
97
|
isEnabled: true,
|
|
107
98
|
authority: "ORGANIZATION_UNIT_TYPE_EDIT",
|
|
108
|
-
preActionValidation: async (data) => {
|
|
109
|
-
data.organizationId = props?.selectedOrganization?.id;
|
|
110
|
-
return true;
|
|
111
|
-
},
|
|
112
99
|
}}
|
|
113
100
|
deleteAction={{
|
|
114
101
|
isEnabled: true,
|
|
@@ -5,13 +5,15 @@ import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTy
|
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { toast } from "react-toastify";
|
|
7
7
|
import OrganizationMemberGrid from "./OrganizationMemberGrid";
|
|
8
|
+
import { Box } from "@mui/material";
|
|
9
|
+
import AttachmentImageViewer from "../../templates/attachment/AttachmentImageViewer";
|
|
8
10
|
|
|
9
11
|
const PersonGrid: React.FC = () => {
|
|
10
12
|
const { t } = useTranslation();
|
|
11
13
|
const [selectedPerson, setSelectedPerson] = useState<any>(null);
|
|
12
14
|
const [data, setData] = useState([]);
|
|
13
15
|
const apiActions = useApiActions({
|
|
14
|
-
findAll: "api/v1/
|
|
16
|
+
findAll: "api/v1/public/person/all",
|
|
15
17
|
deleteById: "api/v1/admin/person",
|
|
16
18
|
save: "api/v1/admin/person",
|
|
17
19
|
findById: "api/v1/admin/person",
|
|
@@ -37,6 +39,39 @@ const PersonGrid: React.FC = () => {
|
|
|
37
39
|
fieldType: "text",
|
|
38
40
|
},
|
|
39
41
|
},
|
|
42
|
+
{
|
|
43
|
+
type: "field",
|
|
44
|
+
mode: "props",
|
|
45
|
+
props: {
|
|
46
|
+
fieldLabel: "",
|
|
47
|
+
fieldName: "custom",
|
|
48
|
+
fieldType: "custom",
|
|
49
|
+
gridProps: {
|
|
50
|
+
muiProps: {
|
|
51
|
+
align: "center",
|
|
52
|
+
headerAlign: "center",
|
|
53
|
+
renderCell: (params) => {
|
|
54
|
+
return (
|
|
55
|
+
<Box
|
|
56
|
+
sx={{
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center",
|
|
60
|
+
height: "100%",
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<AttachmentImageViewer
|
|
64
|
+
showAsAvatar={true}
|
|
65
|
+
attachmentCode="PERSON_IMG"
|
|
66
|
+
refKey={params.id + ""}
|
|
67
|
+
/>
|
|
68
|
+
</Box>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
40
75
|
{
|
|
41
76
|
type: "field",
|
|
42
77
|
mode: "props",
|
|
@@ -128,6 +163,8 @@ const PersonGrid: React.FC = () => {
|
|
|
128
163
|
<OrganizationMemberGrid selectedPerson={selectedPerson} />
|
|
129
164
|
</OrganizationMembersWindow>
|
|
130
165
|
<TemplateGrid
|
|
166
|
+
attachment={{ attachmentCode: "PERSON_IMG" }}
|
|
167
|
+
workFlowDocumentCode="DOC"
|
|
131
168
|
apiActions={apiActions}
|
|
132
169
|
data={data}
|
|
133
170
|
setData={setData}
|
|
@@ -6,7 +6,6 @@ import { useAxios } from "../../../hooks";
|
|
|
6
6
|
|
|
7
7
|
type RoleAuthoritiesFormProps = {
|
|
8
8
|
roleId: number;
|
|
9
|
-
appId: number;
|
|
10
9
|
closeModalFn: () => void;
|
|
11
10
|
};
|
|
12
11
|
|
|
@@ -20,7 +19,6 @@ const RoleAuthoritiesForm: React.FC<RoleAuthoritiesFormProps> = (props) => {
|
|
|
20
19
|
endPointURI: "api/v1/admin/systemApplicationRoleAuthorities",
|
|
21
20
|
showMask: true,
|
|
22
21
|
parameters: {
|
|
23
|
-
appId: props.appId,
|
|
24
22
|
roleId: props.roleId,
|
|
25
23
|
},
|
|
26
24
|
successCallBkFn: (response: any) => {
|
|
@@ -31,10 +29,10 @@ const RoleAuthoritiesForm: React.FC<RoleAuthoritiesFormProps> = (props) => {
|
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
useEffect(() => {
|
|
34
|
-
if (props.roleId
|
|
32
|
+
if (props.roleId) {
|
|
35
33
|
getRoleAuthorities();
|
|
36
34
|
}
|
|
37
|
-
}, [props.roleId
|
|
35
|
+
}, [props.roleId]);
|
|
38
36
|
const saveRoleAuthorities = async () => {
|
|
39
37
|
await handlePostRequest({
|
|
40
38
|
endPointURI: "api/v1/admin/systemApplicationRoleAuthorities",
|
|
@@ -4,13 +4,7 @@ import { useApiActions, useAxios } from "../../../hooks";
|
|
|
4
4
|
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
selectedApplication: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const SystemApplicationAuthorityGrid: React.FC<
|
|
12
|
-
SystemApplicationAuthorityGridProps
|
|
13
|
-
> = (props) => {
|
|
7
|
+
const SystemApplicationAuthorityGrid: React.FC = () => {
|
|
14
8
|
const { t } = useTranslation();
|
|
15
9
|
const [data, setData] = useState([]);
|
|
16
10
|
const apiActions = useApiActions({
|
|
@@ -27,9 +21,6 @@ const SystemApplicationAuthorityGrid: React.FC<
|
|
|
27
21
|
await handleGetRequest({
|
|
28
22
|
endPointURI: "api/v1/admin/systemapplicationmodule/application/all",
|
|
29
23
|
showMask: true,
|
|
30
|
-
parameters: {
|
|
31
|
-
applicationId: props.selectedApplication.id,
|
|
32
|
-
},
|
|
33
24
|
successCallBkFn: (response: any) => {
|
|
34
25
|
setSystemApplicationModules(response.data);
|
|
35
26
|
},
|
|
@@ -65,7 +56,7 @@ const SystemApplicationAuthorityGrid: React.FC<
|
|
|
65
56
|
optionDisplayField: "moduleName",
|
|
66
57
|
},
|
|
67
58
|
},
|
|
68
|
-
|
|
59
|
+
|
|
69
60
|
{
|
|
70
61
|
type: "field",
|
|
71
62
|
mode: "props",
|
|
@@ -114,9 +105,6 @@ const SystemApplicationAuthorityGrid: React.FC<
|
|
|
114
105
|
apiActions={apiActions}
|
|
115
106
|
data={data}
|
|
116
107
|
hideInfoBar={true}
|
|
117
|
-
gridLoadParametersValues={{
|
|
118
|
-
applicationId: props?.selectedApplication?.id,
|
|
119
|
-
}}
|
|
120
108
|
setData={setData}
|
|
121
109
|
editMode={{ editMode: "row" }}
|
|
122
110
|
formElements={formElements}
|
|
@@ -126,10 +114,6 @@ const SystemApplicationAuthorityGrid: React.FC<
|
|
|
126
114
|
editAction={{
|
|
127
115
|
isEnabled: true,
|
|
128
116
|
authority: "SYSTEM_APPLICATION_AUTHORITY_EDIT",
|
|
129
|
-
preActionValidation: async (data) => {
|
|
130
|
-
data.systemApplicationId = props?.selectedApplication?.id;
|
|
131
|
-
return true;
|
|
132
|
-
},
|
|
133
117
|
}}
|
|
134
118
|
deleteAction={{
|
|
135
119
|
isEnabled: true,
|