@asaleh37/ui-base 1.0.9 → 1.1.0

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.
Files changed (125) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/src/components/App.tsx +31 -0
  7. package/src/components/admin/AttachmentGrid.tsx +116 -0
  8. package/src/components/admin/AuthorityGrid.tsx +88 -0
  9. package/src/components/admin/BluePrintGrid.tsx +55 -0
  10. package/src/components/admin/BluePrintPageGrid.tsx +85 -0
  11. package/src/components/admin/BluePrintPointGrid.tsx +85 -0
  12. package/src/components/admin/DashboardGrid.tsx +95 -0
  13. package/src/components/admin/DashboardWidgetGrid.tsx +75 -0
  14. package/src/components/admin/DataQueryGrid.tsx +75 -0
  15. package/src/components/admin/DataQueryParameterGrid.tsx +98 -0
  16. package/src/components/admin/DatasourceConnectionGrid.tsx +98 -0
  17. package/src/components/admin/EmployeeGrid.tsx +105 -0
  18. package/src/components/admin/EntityParameterGrid.tsx +125 -0
  19. package/src/components/admin/ExcelUploaderDetailGrid.tsx +78 -0
  20. package/src/components/admin/ExcelUploaderHeaderGrid.tsx +78 -0
  21. package/src/components/admin/LookupGrid.tsx +95 -0
  22. package/src/components/admin/MailAttachmentGrid.tsx +65 -0
  23. package/src/components/admin/MailBodyGrid.tsx +105 -0
  24. package/src/components/admin/MailNotificationQueueGrid.tsx +131 -0
  25. package/src/components/admin/MailRecipientGrid.tsx +75 -0
  26. package/src/components/admin/MailTemplateGrid.tsx +145 -0
  27. package/src/components/admin/NewTableGrid.tsx +65 -0
  28. package/src/components/admin/NotificationGrid.tsx +115 -0
  29. package/src/components/admin/NotificationQueueGrid.tsx +125 -0
  30. package/src/components/admin/OrganizationApplicationGrid.tsx +81 -0
  31. package/src/components/admin/OrganizationGrid.tsx +65 -0
  32. package/src/components/admin/OrganizationRankGrid.tsx +85 -0
  33. package/src/components/admin/OrganizationUnitGrid.tsx +85 -0
  34. package/src/components/admin/OrganizationUserGrid.tsx +75 -0
  35. package/src/components/admin/OrganizationUserRoleGrid.tsx +98 -0
  36. package/src/components/admin/ReportGrid.tsx +155 -0
  37. package/src/components/admin/ReportParameterGrid.tsx +95 -0
  38. package/src/components/admin/RoleAuthorityGrid.tsx +65 -0
  39. package/src/components/admin/RoleGrid.tsx +78 -0
  40. package/src/components/admin/UserAccountGrid.tsx +65 -0
  41. package/src/components/admin/UserRequestGrid.tsx +145 -0
  42. package/src/components/admin/WidgetGrid.tsx +175 -0
  43. package/src/components/admin/WorkflowDocumentActionGrid.tsx +111 -0
  44. package/src/components/admin/WorkflowDocumentActionHistoryGrid.tsx +111 -0
  45. package/src/components/admin/WorkflowDocumentActionMailGrid.tsx +71 -0
  46. package/src/components/admin/WorkflowDocumentGrid.tsx +185 -0
  47. package/src/components/admin/WorkflowDocumentMailLogGrid.tsx +141 -0
  48. package/src/components/admin/WorkflowDocumentStatusGrid.tsx +121 -0
  49. package/src/components/common/Home.tsx +31 -0
  50. package/src/components/common/LanguageSwitcher.tsx +25 -0
  51. package/src/components/common/LayoutHandlers.tsx +12 -0
  52. package/src/components/common/LoadingMask.tsx +19 -0
  53. package/src/components/common/Login.tsx +183 -0
  54. package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +288 -0
  55. package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +201 -0
  56. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormAction.tsx +60 -0
  57. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +194 -0
  58. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementGroup.tsx +98 -0
  59. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/CheckBox.tsx +64 -0
  60. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx +94 -0
  61. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/Datefield.tsx +65 -0
  62. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/DatetimeField.tsx +64 -0
  63. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/FiltersPanel.tsx +237 -0
  64. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/TemplateTextField.tsx +9 -0
  65. package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +256 -0
  66. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx +188 -0
  67. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +844 -0
  68. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridMultiRecordAction.tsx +89 -0
  69. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridRecordAction.tsx +92 -0
  70. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +228 -0
  71. package/src/components/templates/DataEntryTemplates/useApiActions.ts +125 -0
  72. package/src/components/templates/TransferList.tsx +250 -0
  73. package/src/components/templates/Window/ConfirmationWindow.tsx +55 -0
  74. package/src/components/templates/visuals/TemplateDashboard.tsx +126 -0
  75. package/src/components/templates/visuals/charts/TemplateBarChart.tsx +16 -0
  76. package/src/components/templates/visuals/charts/TemplateDataCard.tsx +60 -0
  77. package/src/components/templates/visuals/charts/TemplateGauge.tsx +16 -0
  78. package/src/components/templates/visuals/charts/TemplateLineChart.tsx +16 -0
  79. package/src/components/templates/visuals/charts/TemplateLineProgress.tsx +40 -0
  80. package/src/components/templates/visuals/charts/TemplatePieChart.tsx +25 -0
  81. package/src/hooks/UseConfirmationWindow.tsx +54 -0
  82. package/src/hooks/UseMobile.tsx +13 -0
  83. package/src/hooks/UseSession.tsx +26 -0
  84. package/src/hooks/UseWindow.tsx +106 -0
  85. package/src/hooks/useAxios.tsx +271 -0
  86. package/src/hooks/useLoadingMask.tsx +16 -0
  87. package/src/layout/DrawerHeader.tsx +10 -0
  88. package/src/layout/Layout.tsx +122 -0
  89. package/src/layout/MainContent.tsx +43 -0
  90. package/src/layout/MobileDrawer.tsx +103 -0
  91. package/src/layout/NavigationTree.tsx +284 -0
  92. package/src/layout/SideBar.tsx +80 -0
  93. package/src/layout/TopBar.tsx +142 -0
  94. package/src/locales/arabic/adminLocalsAr.json +356 -0
  95. package/src/locales/arabic/common.json +34 -0
  96. package/src/locales/arabic/index.ts +7 -0
  97. package/src/locales/english/adminLocalsEn.json +356 -0
  98. package/src/locales/english/common.json +33 -0
  99. package/src/locales/english/index.ts +6 -0
  100. package/src/locales/english/index.tsx +0 -0
  101. package/src/locales/i18n.ts +15 -0
  102. package/src/locales/index.ts +9 -0
  103. package/src/navigationItems/Administration/adminNavigationItems.tsx +182 -0
  104. package/src/navigationItems/Administration/index.tsx +71 -0
  105. package/src/navigationItems/common/CommonNavigationItems.tsx +12 -0
  106. package/src/navigationItems/common/index.tsx +7 -0
  107. package/src/navigationItems/index.tsx +34 -0
  108. package/src/redux/features/administration/AdministrationStoresMetaData.ts +72 -0
  109. package/src/redux/features/business/BusinessStoresMetaData.ts +3 -0
  110. package/src/redux/features/business/CommonStoreSlice.ts +37 -0
  111. package/src/redux/features/common/AppInfoSlice.ts +30 -0
  112. package/src/redux/features/common/AppLayoutSlice.ts +37 -0
  113. package/src/redux/features/common/LoadingMaskSlice.ts +30 -0
  114. package/src/redux/features/common/UserSessionSlice.ts +62 -0
  115. package/src/redux/store.ts +10 -10
  116. package/src/routes/administration/adminRoutes.tsx +259 -0
  117. package/src/routes/administration/index.ts +4 -0
  118. package/src/routes/index.ts +11 -0
  119. package/src/routes/types/index.ts +5 -0
  120. package/src/theme/DarkThemeOptions.ts +30 -0
  121. package/src/theme/LightThemeOptions.ts +34 -0
  122. package/src/util/AppUtils.ts +18 -0
  123. package/src/util/constants.ts +2 -0
  124. package/tsconfig.json +2 -2
  125. package/src/redux/CounterSlice.ts +0 -17
@@ -0,0 +1,85 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const OrganizationUnitGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/organizationunit/all",
10
+ deleteById: "api/v1/admin/organizationunit",
11
+ save: "api/v1/admin/organizationunit",
12
+ findById: "api/v1/admin/organizationunit",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "ORGANIZATION_UNIT_ENABLED",
22
+ fieldName: "enabled",
23
+ required: false,
24
+ fieldType: "checkbox",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "ORGANIZATION_UNIT_ORGANIZATION_CODE",
32
+ fieldName: "organizationCode",
33
+ required: false,
34
+ fieldType: "text",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "ORGANIZATION_UNIT_ORGANIZATION_UNIT_AR_NAME",
42
+ fieldName: "organizationUnitArName",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "ORGANIZATION_UNIT_ORGANIZATION_UNIT_EN_NAME",
52
+ fieldName: "organizationUnitEnName",
53
+ required: false,
54
+ fieldType: "text",
55
+ },
56
+ },
57
+ {
58
+ type: "field",
59
+ mode: "props",
60
+ props: {
61
+ fieldLabel: "ORGANIZATION_UNIT_ORGANIZATION_UNIT_PARENT_ID",
62
+ fieldName: "organizationUnitParentId",
63
+ required: false,
64
+ fieldType: "text",
65
+ },
66
+ },
67
+ ];
68
+
69
+ return (
70
+ <TemplateGrid
71
+ apiActions={apiActions}
72
+ data={data}
73
+ setData={setData}
74
+ editMode={{ editMode: "row" }}
75
+ formElements={formElements}
76
+ keyColumnName={"id"}
77
+ gridTitle="ORGANIZATION_UNIT_PLURAL"
78
+ girdIcon="table-cells"
79
+ editAction={{ isEnabled: true, authority: "ORGANIZATION_UNIT_EDIT" }}
80
+ deleteAction={{ isEnabled: true, authority: "ORGANIZATION_UNIT_DELETE" }}
81
+ />
82
+ );
83
+ };
84
+
85
+ export default OrganizationUnitGrid;
@@ -0,0 +1,75 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const OrganizationUserGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/organizationuser/all",
10
+ deleteById: "api/v1/admin/organizationuser",
11
+ save: "api/v1/admin/organizationuser",
12
+ findById: "api/v1/admin/organizationuser",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "ORGANIZATION_USER_IS_ACTIVE",
22
+ fieldName: "isActive",
23
+ required: false,
24
+ fieldType: "checkbox",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "ORGANIZATION_USER_IS_DEFAULT",
32
+ fieldName: "isDefault",
33
+ required: false,
34
+ fieldType: "checkbox",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "ORGANIZATION_USER_ORGANIZATION_CODE",
42
+ fieldName: "organizationCode",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "ORGANIZATION_USER_USERNAME",
52
+ fieldName: "username",
53
+ required: false,
54
+ fieldType: "text",
55
+ },
56
+ },
57
+ ];
58
+
59
+ return (
60
+ <TemplateGrid
61
+ apiActions={apiActions}
62
+ data={data}
63
+ setData={setData}
64
+ editMode={{ editMode: "row" }}
65
+ formElements={formElements}
66
+ keyColumnName={"id"}
67
+ gridTitle="ORGANIZATION_USER_PLURAL"
68
+ girdIcon="table-cells"
69
+ editAction={{ isEnabled: true, authority: "ORGANIZATION_USER_EDIT" }}
70
+ deleteAction={{ isEnabled: true, authority: "ORGANIZATION_USER_DELETE" }}
71
+ />
72
+ );
73
+ };
74
+
75
+ export default OrganizationUserGrid;
@@ -0,0 +1,98 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const OrganizationUserRoleGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/organizationuserrole/all",
10
+ deleteById: "api/v1/admin/organizationuserrole",
11
+ save: "api/v1/admin/organizationuserrole",
12
+ findById: "api/v1/admin/organizationuserrole",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "ORGANIZATION_USER_ROLE_END_DATE",
22
+ fieldName: "endDate",
23
+ required: false,
24
+ fieldType: "datetime",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "ORGANIZATION_USER_ROLE_IS_ACTIVE",
32
+ fieldName: "isActive",
33
+ required: false,
34
+ fieldType: "checkbox",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "ORGANIZATION_USER_ROLE_ORGANIZATION_CODE",
42
+ fieldName: "organizationCode",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "ORGANIZATION_USER_ROLE_ROLE_ID",
52
+ fieldName: "roleId",
53
+ required: false,
54
+ fieldType: "text",
55
+ },
56
+ },
57
+ {
58
+ type: "field",
59
+ mode: "props",
60
+ props: {
61
+ fieldLabel: "ORGANIZATION_USER_ROLE_START_DATE",
62
+ fieldName: "startDate",
63
+ required: false,
64
+ fieldType: "datetime",
65
+ },
66
+ },
67
+ {
68
+ type: "field",
69
+ mode: "props",
70
+ props: {
71
+ fieldLabel: "ORGANIZATION_USER_ROLE_USERNAME",
72
+ fieldName: "username",
73
+ required: false,
74
+ fieldType: "text",
75
+ },
76
+ },
77
+ ];
78
+
79
+ return (
80
+ <TemplateGrid
81
+ apiActions={apiActions}
82
+ data={data}
83
+ setData={setData}
84
+ editMode={{ editMode: "row" }}
85
+ formElements={formElements}
86
+ keyColumnName={"id"}
87
+ gridTitle="ORGANIZATION_USER_ROLE_PLURAL"
88
+ girdIcon="table-cells"
89
+ editAction={{ isEnabled: true, authority: "ORGANIZATION_USER_ROLE_EDIT" }}
90
+ deleteAction={{
91
+ isEnabled: true,
92
+ authority: "ORGANIZATION_USER_ROLE_DELETE",
93
+ }}
94
+ />
95
+ );
96
+ };
97
+
98
+ export default OrganizationUserRoleGrid;
@@ -0,0 +1,155 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const ReportGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/report/all",
10
+ deleteById: "api/v1/admin/report",
11
+ save: "api/v1/admin/report",
12
+ findById: "api/v1/admin/report",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "REPORT_DATASOURCE_CON_ID",
22
+ fieldName: "datasourceConId",
23
+ required: false,
24
+ fieldType: "text",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "REPORT_REPORT_BLUE_PRINT_ID",
32
+ fieldName: "reportBluePrintId",
33
+ required: false,
34
+ fieldType: "text",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "REPORT_REPORT_CATEGORY",
42
+ fieldName: "reportCategory",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "REPORT_REPORT_CODE",
52
+ fieldName: "reportCode",
53
+ required: false,
54
+ fieldType: "text",
55
+ },
56
+ },
57
+ {
58
+ type: "field",
59
+ mode: "props",
60
+ props: {
61
+ fieldLabel: "REPORT_REPORT_EXCEL_DATA_QUERY_ID",
62
+ fieldName: "reportExcelDataQueryId",
63
+ required: false,
64
+ fieldType: "text",
65
+ },
66
+ },
67
+ {
68
+ type: "field",
69
+ mode: "props",
70
+ props: {
71
+ fieldLabel: "REPORT_REPORT_EXPORT_NAME",
72
+ fieldName: "reportExportName",
73
+ required: false,
74
+ fieldType: "text",
75
+ },
76
+ },
77
+ {
78
+ type: "field",
79
+ mode: "props",
80
+ props: {
81
+ fieldLabel: "REPORT_REPORT_JASPER_NAME",
82
+ fieldName: "reportJasperName",
83
+ required: false,
84
+ fieldType: "text",
85
+ },
86
+ },
87
+ {
88
+ type: "field",
89
+ mode: "props",
90
+ props: {
91
+ fieldLabel: "REPORT_REPORT_JASPER_PATH",
92
+ fieldName: "reportJasperPath",
93
+ required: false,
94
+ fieldType: "text",
95
+ },
96
+ },
97
+ {
98
+ type: "field",
99
+ mode: "props",
100
+ props: {
101
+ fieldLabel: "REPORT_REPORT_MENU_CODE",
102
+ fieldName: "reportMenuCode",
103
+ required: false,
104
+ fieldType: "text",
105
+ },
106
+ },
107
+ {
108
+ type: "field",
109
+ mode: "props",
110
+ props: {
111
+ fieldLabel: "REPORT_REPORT_NAME",
112
+ fieldName: "reportName",
113
+ required: false,
114
+ fieldType: "text",
115
+ },
116
+ },
117
+ {
118
+ type: "field",
119
+ mode: "props",
120
+ props: {
121
+ fieldLabel: "REPORT_REPORT_TYPE",
122
+ fieldName: "reportType",
123
+ required: false,
124
+ fieldType: "text",
125
+ },
126
+ },
127
+ {
128
+ type: "field",
129
+ mode: "props",
130
+ props: {
131
+ fieldLabel: "REPORT_USE_SYS_DATASOURCE",
132
+ fieldName: "useSysDatasource",
133
+ required: false,
134
+ fieldType: "checkbox",
135
+ },
136
+ },
137
+ ];
138
+
139
+ return (
140
+ <TemplateGrid
141
+ apiActions={apiActions}
142
+ data={data}
143
+ setData={setData}
144
+ editMode={{ editMode: "row" }}
145
+ formElements={formElements}
146
+ keyColumnName={"id"}
147
+ gridTitle="REPORT_PLURAL"
148
+ girdIcon="table-cells"
149
+ editAction={{ isEnabled: true, authority: "REPORT_EDIT" }}
150
+ deleteAction={{ isEnabled: true, authority: "REPORT_DELETE" }}
151
+ />
152
+ );
153
+ };
154
+
155
+ export default ReportGrid;
@@ -0,0 +1,95 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const ReportParameterGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/reportparameter/all",
10
+ deleteById: "api/v1/admin/reportparameter",
11
+ save: "api/v1/admin/reportparameter",
12
+ findById: "api/v1/admin/reportparameter",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "REPORT_PARAMETER_DEFAULT_VALUE",
22
+ fieldName: "defaultValue",
23
+ required: false,
24
+ fieldType: "text",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "REPORT_PARAMETER_ENABLED",
32
+ fieldName: "enabled",
33
+ required: false,
34
+ fieldType: "checkbox",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "REPORT_PARAMETER_ENTITY_PARAMETER_ID",
42
+ fieldName: "entityParameterId",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "REPORT_PARAMETER_HIDDEN",
52
+ fieldName: "hidden",
53
+ required: false,
54
+ fieldType: "checkbox",
55
+ },
56
+ },
57
+ {
58
+ type: "field",
59
+ mode: "props",
60
+ props: {
61
+ fieldLabel: "REPORT_PARAMETER_MANDATORY",
62
+ fieldName: "mandatory",
63
+ required: false,
64
+ fieldType: "checkbox",
65
+ },
66
+ },
67
+ {
68
+ type: "field",
69
+ mode: "props",
70
+ props: {
71
+ fieldLabel: "REPORT_PARAMETER_REPORT_ID",
72
+ fieldName: "reportId",
73
+ required: false,
74
+ fieldType: "text",
75
+ },
76
+ },
77
+ ];
78
+
79
+ return (
80
+ <TemplateGrid
81
+ apiActions={apiActions}
82
+ data={data}
83
+ setData={setData}
84
+ editMode={{ editMode: "row" }}
85
+ formElements={formElements}
86
+ keyColumnName={"id"}
87
+ gridTitle="REPORT_PARAMETER_PLURAL"
88
+ girdIcon="table-cells"
89
+ editAction={{ isEnabled: true, authority: "REPORT_PARAMETER_EDIT" }}
90
+ deleteAction={{ isEnabled: true, authority: "REPORT_PARAMETER_DELETE" }}
91
+ />
92
+ );
93
+ };
94
+
95
+ export default ReportParameterGrid;
@@ -0,0 +1,65 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const RoleAuthorityGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ findAll: "api/v1/admin/roleauthority/all",
10
+ deleteById: "api/v1/admin/roleauthority",
11
+ save: "api/v1/admin/roleauthority",
12
+ findById: "api/v1/admin/roleauthority",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "ROLE_AUTHORITY_AUTHORITY_ID",
22
+ fieldName: "authorityId",
23
+ required: false,
24
+ fieldType: "text",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "ROLE_AUTHORITY_IS_ACTIVE",
32
+ fieldName: "isActive",
33
+ required: false,
34
+ fieldType: "checkbox",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "ROLE_AUTHORITY_ROLE_ID",
42
+ fieldName: "roleId",
43
+ required: false,
44
+ fieldType: "text",
45
+ },
46
+ },
47
+ ];
48
+
49
+ return (
50
+ <TemplateGrid
51
+ apiActions={apiActions}
52
+ data={data}
53
+ setData={setData}
54
+ editMode={{ editMode: "row" }}
55
+ formElements={formElements}
56
+ keyColumnName={"id"}
57
+ gridTitle="ROLE_AUTHORITY_PLURAL"
58
+ girdIcon="table-cells"
59
+ editAction={{ isEnabled: true, authority: "ROLE_AUTHORITY_EDIT" }}
60
+ deleteAction={{ isEnabled: true, authority: "ROLE_AUTHORITY_DELETE" }}
61
+ />
62
+ );
63
+ };
64
+
65
+ export default RoleAuthorityGrid;
@@ -0,0 +1,78 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import useApiActions from "../templates/DataEntryTemplates/useApiActions";
4
+ import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
5
+
6
+ const RoleGrid: React.FC = () => {
7
+ const [data, setData] = useState([]);
8
+ const apiActions = useApiActions({
9
+ commonStoreKey: "SystemRoles",
10
+ deleteById: "api/v1/admin/role",
11
+ save: "api/v1/admin/role",
12
+ findById: "api/v1/admin/role",
13
+ setData: setData,
14
+ });
15
+
16
+ const formElements: Array<FormElementProps> = [
17
+ {
18
+ type: "field",
19
+ mode: "props",
20
+ props: {
21
+ fieldLabel: "ROLE_ROLE_NAME",
22
+ fieldName: "roleName",
23
+ required: true,
24
+ fieldType: "text",
25
+ },
26
+ },
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "ROLE_DESCRIPTION",
32
+ fieldName: "description",
33
+ required: true,
34
+ fieldType: "text",
35
+ },
36
+ },
37
+ {
38
+ type: "field",
39
+ mode: "props",
40
+ props: {
41
+ fieldLabel: "ROLE_IS_ACTIVE",
42
+ fieldName: "isActive",
43
+ required: false,
44
+ fieldType: "checkbox",
45
+ },
46
+ },
47
+ {
48
+ type: "field",
49
+ mode: "props",
50
+ props: {
51
+ fieldLabel: "ROLE_ORGANIZATION_APPLICATION_ID",
52
+ fieldName: "organizationApplicationId",
53
+ required: false,
54
+ fieldType: "text",
55
+ gridProps: {
56
+ hidden: true,
57
+ },
58
+ },
59
+ },
60
+ ];
61
+
62
+ return (
63
+ <TemplateGrid
64
+ apiActions={apiActions}
65
+ data={data}
66
+ setData={setData}
67
+ editMode={{ editMode: "row", reloadAfterSave: true }}
68
+ formElements={formElements}
69
+ keyColumnName={"id"}
70
+ gridTitle="ROLE_PLURAL"
71
+ girdIcon="table-cells"
72
+ editAction={{ isEnabled: true, authority: "ROLE_EDIT" }}
73
+ deleteAction={{ isEnabled: true, authority: "ROLE_DELETE" }}
74
+ />
75
+ );
76
+ };
77
+
78
+ export default RoleGrid;