@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.
Files changed (157) hide show
  1. package/dist/index.d.ts +20 -13
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +6 -6
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +15 -3
  7. package/src/components/App.tsx +1 -1
  8. package/src/components/BaseApp.tsx +2 -19
  9. package/src/components/administration/admin/OrgMemberRoleForm.tsx +83 -0
  10. package/src/components/administration/admin/OrganizationApplicationModuleGrid.tsx +131 -0
  11. package/src/components/administration/admin/OrganizationGrid.tsx +165 -0
  12. package/src/components/administration/admin/OrganizationMemberGrid.tsx +176 -0
  13. package/src/components/administration/admin/OrganizationMemberRoleGrid.tsx +87 -0
  14. package/src/components/{admin → administration/admin}/OrganizationRankGrid.tsx +49 -19
  15. package/src/components/administration/admin/OrganizationUnitGrid.tsx +139 -0
  16. package/src/components/administration/admin/OrganizationUnitTypeGrid.tsx +121 -0
  17. package/src/components/administration/admin/PersonGrid.tsx +195 -0
  18. package/src/components/{admin → administration/admin}/RoleAuthoritiesForm.tsx +30 -11
  19. package/src/components/administration/admin/SystemApplicationAuthorityGrid.tsx +142 -0
  20. package/src/components/administration/admin/SystemApplicationGrid.tsx +161 -0
  21. package/src/components/administration/admin/SystemApplicationModuleGrid.tsx +109 -0
  22. package/src/components/administration/admin/SystemApplicationRoleAuthorityGrid.tsx +67 -0
  23. package/src/components/administration/admin/SystemApplicationRoleGrid.tsx +130 -0
  24. package/src/components/administration/dev/BluePrintGrid.tsx +129 -0
  25. package/src/components/administration/dev/DashboardGrid.tsx +173 -0
  26. package/src/components/administration/dev/DashboardWidgetGrid.tsx +164 -0
  27. package/src/components/administration/dev/DataQueryGrid.tsx +206 -0
  28. package/src/components/administration/dev/DataQueryParameterGrid.tsx +191 -0
  29. package/src/components/administration/dev/DataQueryParametersForm.tsx +84 -0
  30. package/src/components/administration/dev/DatasourceConnectionGrid.tsx +150 -0
  31. package/src/components/administration/dev/EntityParameterGrid.tsx +279 -0
  32. package/src/components/administration/dev/LookupGrid.tsx +131 -0
  33. package/src/components/administration/dev/MailAttachmentGrid.tsx +155 -0
  34. package/src/components/administration/dev/MailBodyGrid.tsx +215 -0
  35. package/src/components/{admin → administration/dev}/MailNotificationQueueGrid.tsx +114 -26
  36. package/src/components/administration/dev/MailRecipientGrid.tsx +169 -0
  37. package/src/components/administration/dev/MailSenderConfigGrid.tsx +478 -0
  38. package/src/components/administration/dev/MailTemplateGrid.tsx +388 -0
  39. package/src/components/administration/dev/ReportGrid.tsx +504 -0
  40. package/src/components/administration/dev/ReportParameterGrid.tsx +186 -0
  41. package/src/components/administration/dev/ReportParametersForm.tsx +84 -0
  42. package/src/components/administration/dev/WidgetGrid.tsx +431 -0
  43. package/src/components/administration/dev/WorkflowDocumentActionGrid.tsx +264 -0
  44. package/src/components/administration/dev/WorkflowDocumentActionHistoryGrid.tsx +172 -0
  45. package/src/components/administration/dev/WorkflowDocumentActionMailGrid.tsx +161 -0
  46. package/src/components/administration/dev/WorkflowDocumentGrid.tsx +377 -0
  47. package/src/components/{admin → administration/dev}/WorkflowDocumentMailLogGrid.tsx +87 -10
  48. package/src/components/administration/dev/WorkflowDocumentStatusGrid.tsx +243 -0
  49. package/src/components/common/ChangeOrgForm.tsx +81 -0
  50. package/src/components/common/Home.tsx +28 -22
  51. package/src/components/common/LoadingMask.tsx +9 -4
  52. package/src/components/common/Login.tsx +9 -13
  53. package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +30 -6
  54. package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +46 -5
  55. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +64 -5
  56. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementGroup.tsx +11 -3
  57. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/CheckBox.tsx +2 -2
  58. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx +1 -2
  59. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/HtmlEditor.tsx +144 -0
  60. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/SystemLookupCombobox.tsx +55 -0
  61. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/TemplateTextField.tsx +9 -1
  62. package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +45 -5
  63. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx +8 -7
  64. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +38 -10
  65. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridRecordAction.tsx +4 -1
  66. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +3 -4
  67. package/src/components/templates/TransferList.tsx +16 -6
  68. package/src/components/templates/index.ts +0 -2
  69. package/src/components/templates/report/ExcelReportViewer.tsx +65 -0
  70. package/src/components/templates/report/ReportViewer.tsx +382 -0
  71. package/src/components/templates/visuals/DashboardRouteView.tsx +9 -0
  72. package/src/components/templates/visuals/DashboardViewer.tsx +148 -0
  73. package/src/components/templates/visuals/WidgetViewer.tsx +198 -0
  74. package/src/components/templates/visuals/charts/TemplateBarChart.tsx +9 -2
  75. package/src/components/templates/visuals/charts/TemplateDataCard.tsx +6 -31
  76. package/src/components/templates/visuals/charts/TemplateGauge.tsx +8 -3
  77. package/src/components/templates/visuals/charts/TemplateLineChart.tsx +8 -2
  78. package/src/components/templates/visuals/charts/TemplateLineProgress.tsx +5 -3
  79. package/src/components/templates/visuals/charts/TemplatePieChart.tsx +1 -2
  80. package/src/components/templates/workflow/WorkflowDocumentPanel.tsx +581 -0
  81. package/src/components/templates/workflow/WorkflowDocumentTimeLine.tsx +134 -0
  82. package/src/hooks/UseSession.tsx +3 -7
  83. package/src/hooks/UseWindow.tsx +2 -1
  84. package/src/hooks/useAxios.tsx +9 -27
  85. package/src/hooks/useLookupGridColumn.tsx +35 -0
  86. package/src/layout/Layout.tsx +2 -46
  87. package/src/layout/MainContent.tsx +60 -7
  88. package/src/layout/MobileDrawer.tsx +5 -5
  89. package/src/layout/NavigationTree.tsx +0 -1
  90. package/src/layout/RouteWrapper.tsx +36 -0
  91. package/src/layout/SideBar.tsx +15 -10
  92. package/src/layout/TopBar.tsx +139 -71
  93. package/src/locales/arabic/adminLocalsAr.json +81 -344
  94. package/src/locales/arabic/common.json +11 -1
  95. package/src/locales/arabic/devLocalsAr.json +280 -0
  96. package/src/locales/arabic/index.ts +2 -0
  97. package/src/locales/english/adminLocalsEn.json +86 -346
  98. package/src/locales/english/common.json +11 -1
  99. package/src/locales/english/devLocalsEn.json +281 -0
  100. package/src/locales/english/index.ts +3 -0
  101. package/src/main.tsx +5 -6
  102. package/src/navigationItems/Administration/adminNavigationItems.tsx +65 -99
  103. package/src/navigationItems/Administration/index.tsx +10 -65
  104. package/src/redux/features/administration/AdministrationStoresMetaData.ts +45 -12
  105. package/src/redux/features/common/AppLayoutSlice.ts +0 -8
  106. package/src/redux/features/common/CommonStoreSlice.ts +4 -0
  107. package/src/redux/features/common/SideBarSlice.ts +29 -0
  108. package/src/redux/features/common/UserSessionSlice.ts +15 -23
  109. package/src/redux/store.ts +1 -1
  110. package/src/routes/administration/adminRoutes.tsx +41 -222
  111. package/src/routes/administration/devRoutes.tsx +90 -0
  112. package/src/routes/administration/index.ts +5 -1
  113. package/src/routes/index.ts +1 -0
  114. package/src/styles/index.css +3 -3
  115. package/src/util/AppUtils.ts +5 -0
  116. package/vite.config.ts +14 -0
  117. package/src/components/admin/AttachmentGrid.tsx +0 -116
  118. package/src/components/admin/AuthorityGrid.tsx +0 -88
  119. package/src/components/admin/BluePrintGrid.tsx +0 -55
  120. package/src/components/admin/BluePrintPageGrid.tsx +0 -85
  121. package/src/components/admin/BluePrintPointGrid.tsx +0 -85
  122. package/src/components/admin/DashboardGrid.tsx +0 -95
  123. package/src/components/admin/DashboardWidgetGrid.tsx +0 -75
  124. package/src/components/admin/DataQueryGrid.tsx +0 -75
  125. package/src/components/admin/DataQueryParameterGrid.tsx +0 -98
  126. package/src/components/admin/DatasourceConnectionGrid.tsx +0 -98
  127. package/src/components/admin/EmployeeGrid.tsx +0 -105
  128. package/src/components/admin/EntityParameterGrid.tsx +0 -125
  129. package/src/components/admin/ExcelUploaderDetailGrid.tsx +0 -78
  130. package/src/components/admin/ExcelUploaderHeaderGrid.tsx +0 -78
  131. package/src/components/admin/LookupGrid.tsx +0 -95
  132. package/src/components/admin/MailAttachmentGrid.tsx +0 -65
  133. package/src/components/admin/MailBodyGrid.tsx +0 -105
  134. package/src/components/admin/MailRecipientGrid.tsx +0 -75
  135. package/src/components/admin/MailTemplateGrid.tsx +0 -145
  136. package/src/components/admin/NewTableGrid.tsx +0 -65
  137. package/src/components/admin/NotificationGrid.tsx +0 -115
  138. package/src/components/admin/NotificationQueueGrid.tsx +0 -125
  139. package/src/components/admin/OrganizationApplicationGrid.tsx +0 -81
  140. package/src/components/admin/OrganizationGrid.tsx +0 -65
  141. package/src/components/admin/OrganizationUnitGrid.tsx +0 -85
  142. package/src/components/admin/OrganizationUserGrid.tsx +0 -75
  143. package/src/components/admin/OrganizationUserRoleGrid.tsx +0 -98
  144. package/src/components/admin/ReportGrid.tsx +0 -155
  145. package/src/components/admin/ReportParameterGrid.tsx +0 -95
  146. package/src/components/admin/RoleAuthorityGrid.tsx +0 -65
  147. package/src/components/admin/RoleGrid.tsx +0 -132
  148. package/src/components/admin/UserAccountGrid.tsx +0 -65
  149. package/src/components/admin/UserRequestGrid.tsx +0 -145
  150. package/src/components/admin/WidgetGrid.tsx +0 -175
  151. package/src/components/admin/WorkflowDocumentActionGrid.tsx +0 -111
  152. package/src/components/admin/WorkflowDocumentActionHistoryGrid.tsx +0 -111
  153. package/src/components/admin/WorkflowDocumentActionMailGrid.tsx +0 -71
  154. package/src/components/admin/WorkflowDocumentGrid.tsx +0 -185
  155. package/src/components/admin/WorkflowDocumentStatusGrid.tsx +0 -121
  156. package/src/components/templates/visuals/TemplateDashboard.tsx +0 -126
  157. package/src/redux/features/CounterSlice.tsx +0 -13
@@ -0,0 +1,264 @@
1
+ import { useEffect, useState } from "react";
2
+ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
4
+ import { useTranslation } from "react-i18next";
5
+ import { useApiActions, useAxios, useWindow } from "../../../hooks";
6
+ import WorkflowDocumentActionMailGrid from "./WorkflowDocumentActionMailGrid";
7
+
8
+ type WorkflowDocumentActionGridProps = {
9
+ selectedRecord: any;
10
+ };
11
+
12
+ const WorkflowDocumentActionGrid: React.FC<WorkflowDocumentActionGridProps> = (
13
+ props
14
+ ) => {
15
+ const [selectedRecord, setSelectedRecord] = useState<any>(null);
16
+ const {
17
+ Window: ActionMailsWindow,
18
+ setWindowState: setActionMailWindowState,
19
+ } = useWindow({
20
+ windowTitle: "Action Mail Notification",
21
+ windowIcon: "envelope",
22
+ width: "50%",
23
+ });
24
+ const { t } = useTranslation();
25
+ const { handleGetRequest } = useAxios();
26
+ const [workflowStates, setWorkflowStates] = useState<Array<any>>([]);
27
+ const loadWorkFlowDocumentStates = async () => {
28
+ await handleGetRequest({
29
+ endPointURI: "api/v1/dev/workflowdocumentstatus/all",
30
+ showMask: true,
31
+ parameters: {
32
+ workflowDocumentId: props.selectedRecord.id,
33
+ },
34
+ successCallBkFn: (response: any) => {
35
+ setWorkflowStates(response.data);
36
+ },
37
+ });
38
+ };
39
+ useEffect(() => {
40
+ loadWorkFlowDocumentStates();
41
+ }, [props.selectedRecord]);
42
+ const [data, setData] = useState([]);
43
+ const apiActions = useApiActions({
44
+ findAll: "api/v1/dev/workflowdocumentaction/all",
45
+ deleteById: "api/v1/dev/workflowdocumentaction",
46
+ save: "api/v1/dev/workflowdocumentaction",
47
+ findById: "api/v1/dev/workflowdocumentaction",
48
+ setData: setData,
49
+ });
50
+
51
+ const formElements: Array<FormElementProps> = [
52
+ {
53
+ type: "field",
54
+ mode: "props",
55
+ props: {
56
+ fieldLabel: "id",
57
+ fieldName: "id",
58
+ fieldType: "number",
59
+ hidden: true,
60
+ gridProps: {
61
+ hidden: true,
62
+ },
63
+ },
64
+ },
65
+ {
66
+ type: "field",
67
+ mode: "props",
68
+ props: {
69
+ fieldLabel: "createTime",
70
+ fieldName: "createTime",
71
+ fieldType: "datetime",
72
+ hidden: true,
73
+ gridProps: {
74
+ hidden: true,
75
+ },
76
+ },
77
+ },
78
+ {
79
+ type: "field",
80
+ mode: "props",
81
+ props: {
82
+ fieldLabel: "createdBy",
83
+ fieldName: "createdBy",
84
+ fieldType: "text",
85
+ hidden: true,
86
+ gridProps: {
87
+ hidden: true,
88
+ },
89
+ },
90
+ },
91
+ {
92
+ type: "field",
93
+ mode: "props",
94
+ props: {
95
+ fieldLabel: "lastUpdateBy",
96
+ fieldName: "lastUpdateBy",
97
+ fieldType: "text",
98
+ hidden: true,
99
+ gridProps: {
100
+ hidden: true,
101
+ },
102
+ },
103
+ },
104
+ {
105
+ type: "field",
106
+ mode: "props",
107
+ props: {
108
+ fieldLabel: "lastUpdateTime",
109
+ fieldName: "lastUpdateTime",
110
+ fieldType: "datetime",
111
+ hidden: true,
112
+ gridProps: {
113
+ hidden: true,
114
+ },
115
+ },
116
+ },
117
+ {
118
+ type: "field",
119
+ mode: "props",
120
+ props: {
121
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_DOCUMENT_ACTION_CODE",
122
+ fieldName: "documentActionCode",
123
+ required: true,
124
+ fieldType: "text",
125
+ },
126
+ },
127
+ {
128
+ type: "field",
129
+ mode: "props",
130
+ props: {
131
+ fieldLabel: "Action Arabic Name",
132
+ fieldName: "documentActionArName",
133
+ required: true,
134
+ fieldType: "text",
135
+ },
136
+ },
137
+ {
138
+ type: "field",
139
+ mode: "props",
140
+ props: {
141
+ fieldLabel: "Action English Name",
142
+ fieldName: "documentActionEnName",
143
+ required: true,
144
+ fieldType: "text",
145
+ },
146
+ },
147
+ {
148
+ type: "field",
149
+ mode: "props",
150
+ props: {
151
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_NEXT_DOCUMENT_STATUS_ID",
152
+ fieldName: "nextDocumentStatusId",
153
+ required: true,
154
+ fieldType: "combobox",
155
+ options: workflowStates,
156
+ optionDisplayField: "documentStatusCode",
157
+ optionValueField: "id",
158
+ },
159
+ },
160
+ {
161
+ type: "field",
162
+ mode: "props",
163
+ props: {
164
+ fieldLabel:
165
+ "Post Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",
166
+ fieldName: "postActionEndpoint",
167
+ required: false,
168
+ fieldType: "text",
169
+ gridProps: {
170
+ hidden: true,
171
+ },
172
+ },
173
+ },
174
+ {
175
+ type: "field",
176
+ mode: "props",
177
+ props: {
178
+ fieldLabel:
179
+ "Pre Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",
180
+ fieldName: "preActionEndpoint",
181
+ required: false,
182
+ fieldType: "text",
183
+ gridProps: {
184
+ hidden: true,
185
+ },
186
+ },
187
+ },
188
+ {
189
+ type: "field",
190
+ mode: "props",
191
+ props: {
192
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_REQUIRE_COMMENT",
193
+ fieldName: "requireComment",
194
+ required: false,
195
+ fieldType: "checkbox",
196
+ },
197
+ },
198
+ {
199
+ type: "field",
200
+ mode: "props",
201
+ props: {
202
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_WORKFLOW_DOCUMENT_ID",
203
+ fieldName: "workflowDocumentId",
204
+ required: false,
205
+ fieldType: "number",
206
+ hidden: true,
207
+ gridProps: { hidden: true },
208
+ },
209
+ },
210
+ ];
211
+
212
+ return (
213
+ <>
214
+ <ActionMailsWindow>
215
+ <WorkflowDocumentActionMailGrid selectedRecord={selectedRecord} />
216
+ </ActionMailsWindow>
217
+ <TemplateGrid
218
+ apiActions={apiActions}
219
+ data={data}
220
+ hideInfoBar={true}
221
+ gridLoadParametersValues={{
222
+ workflowDocumentId: props.selectedRecord.id,
223
+ }}
224
+ setData={setData}
225
+ editMode={{
226
+ editMode: "modal",
227
+ specs: {
228
+ modalIcon: "stamp",
229
+ modalTitle: "Workflow Document Action",
230
+ modalWidth: 700,
231
+ },
232
+ }}
233
+ rowActions={[
234
+ {
235
+ label: "Action Mail Notifications",
236
+ icon: "envelope",
237
+ actionFn: async (data) => {
238
+ setSelectedRecord(data);
239
+ setActionMailWindowState(true);
240
+ },
241
+ },
242
+ ]}
243
+ formElements={formElements}
244
+ keyColumnName={"id"}
245
+ gridTitle={t("WORKFLOW_DOCUMENT_ACTION_PLURAL")}
246
+ girdIcon="stamp"
247
+ editAction={{
248
+ isEnabled: true,
249
+ authority: "WORKFLOW_DOCUMENT_ACTION_EDIT",
250
+ preActionValidation: (record) => {
251
+ record.workflowDocumentId = props.selectedRecord.id;
252
+ return true;
253
+ },
254
+ }}
255
+ deleteAction={{
256
+ isEnabled: true,
257
+ authority: "WORKFLOW_DOCUMENT_ACTION_DELETE",
258
+ }}
259
+ />
260
+ </>
261
+ );
262
+ };
263
+
264
+ export default WorkflowDocumentActionGrid;
@@ -0,0 +1,172 @@
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
+ import { useTranslation } from "react-i18next";
6
+
7
+ const WorkflowDocumentActionHistoryGrid: React.FC = () => {
8
+ const { t } = useTranslation();
9
+ const [data, setData] = useState([]);
10
+ const apiActions = useApiActions({
11
+ findAll: "api/v1/dev/workflowdocumentactionhistory/all",
12
+ deleteById: "api/v1/dev/workflowdocumentactionhistory",
13
+ save: "api/v1/dev/workflowdocumentactionhistory",
14
+ findById: "api/v1/dev/workflowdocumentactionhistory",
15
+ setData: setData,
16
+ });
17
+
18
+ const formElements: Array<FormElementProps> = [
19
+ {
20
+ type: "field",
21
+ mode: "props",
22
+ props: {
23
+ fieldLabel: "id",
24
+ fieldName: "id",
25
+ fieldType: "number",
26
+ hidden: true,
27
+ gridProps: {
28
+ hidden: true,
29
+ },
30
+ },
31
+ },
32
+ {
33
+ type: "field",
34
+ mode: "props",
35
+ props: {
36
+ fieldLabel: "createTime",
37
+ fieldName: "createTime",
38
+ fieldType: "datetime",
39
+ hidden: true,
40
+ gridProps: {
41
+ hidden: true,
42
+ },
43
+ },
44
+ },
45
+ {
46
+ type: "field",
47
+ mode: "props",
48
+ props: {
49
+ fieldLabel: "createdBy",
50
+ fieldName: "createdBy",
51
+ fieldType: "text",
52
+ hidden: true,
53
+ gridProps: {
54
+ hidden: true,
55
+ },
56
+ },
57
+ },
58
+ {
59
+ type: "field",
60
+ mode: "props",
61
+ props: {
62
+ fieldLabel: "lastUpdateBy",
63
+ fieldName: "lastUpdateBy",
64
+ fieldType: "text",
65
+ hidden: true,
66
+ gridProps: {
67
+ hidden: true,
68
+ },
69
+ },
70
+ },
71
+ {
72
+ type: "field",
73
+ mode: "props",
74
+ props: {
75
+ fieldLabel: "lastUpdateTime",
76
+ fieldName: "lastUpdateTime",
77
+ fieldType: "datetime",
78
+ hidden: true,
79
+ gridProps: {
80
+ hidden: true,
81
+ },
82
+ },
83
+ },
84
+ {
85
+ type: "field",
86
+ mode: "props",
87
+ props: {
88
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_ACTION_BY",
89
+ fieldName: "actionBy",
90
+ required: false,
91
+ fieldType: "text",
92
+ },
93
+ },
94
+ {
95
+ type: "field",
96
+ mode: "props",
97
+ props: {
98
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_ACTION_COMMENT",
99
+ fieldName: "actionComment",
100
+ required: false,
101
+ fieldType: "text",
102
+ },
103
+ },
104
+ {
105
+ type: "field",
106
+ mode: "props",
107
+ props: {
108
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_ACTION_METHOD",
109
+ fieldName: "actionMethod",
110
+ required: false,
111
+ fieldType: "text",
112
+ },
113
+ },
114
+ {
115
+ type: "field",
116
+ mode: "props",
117
+ props: {
118
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_ACTION_TIME",
119
+ fieldName: "actionTime",
120
+ required: false,
121
+ fieldType: "datetime",
122
+ },
123
+ },
124
+ {
125
+ type: "field",
126
+ mode: "props",
127
+ props: {
128
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_DOCUMENT_ACTION_ID",
129
+ fieldName: "documentActionId",
130
+ required: false,
131
+ fieldType: "number",
132
+ },
133
+ },
134
+ {
135
+ type: "field",
136
+ mode: "props",
137
+ props: {
138
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_DOCUMENT_REF_ID",
139
+ fieldName: "documentRefId",
140
+ required: false,
141
+ fieldType: "text",
142
+ },
143
+ },
144
+ {
145
+ type: "field",
146
+ mode: "props",
147
+ props: {
148
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_HISTORY_WORKFLOW_DOCUMENT_ID",
149
+ fieldName: "workflowDocumentId",
150
+ required: false,
151
+ fieldType: "number",
152
+ },
153
+ },
154
+ ];
155
+
156
+ return (
157
+ <TemplateGrid
158
+ apiActions={apiActions}
159
+ data={data}
160
+ setData={setData}
161
+ editMode={{ editMode: "row"}}
162
+ formElements={formElements}
163
+ keyColumnName={"id"}
164
+ gridTitle={t("WORKFLOW_DOCUMENT_ACTION_HISTORY_PLURAL")}
165
+ girdIcon="table-cells"
166
+ editAction={{ isEnabled: true, authority: "WORKFLOW_DOCUMENT_ACTION_HISTORY_EDIT" }}
167
+ deleteAction={{ isEnabled: true, authority: "WORKFLOW_DOCUMENT_ACTION_HISTORY_DELETE" }}
168
+ />
169
+ );
170
+ };
171
+
172
+ export default WorkflowDocumentActionHistoryGrid;
@@ -0,0 +1,161 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
4
+ import { useTranslation } from "react-i18next";
5
+ import { useApiActions } from "../../../hooks";
6
+ import { useSelector } from "react-redux";
7
+
8
+ type WorkflowDocumentActionMailGridProps = {
9
+ selectedRecord: any;
10
+ };
11
+
12
+ const WorkflowDocumentActionMailGrid: React.FC<
13
+ WorkflowDocumentActionMailGridProps
14
+ > = (props) => {
15
+ const { t } = useTranslation();
16
+ const [data, setData] = useState([]);
17
+ const apiActions = useApiActions({
18
+ findAll: "api/v1/dev/workflowdocumentactionmail/all",
19
+ deleteById: "api/v1/dev/workflowdocumentactionmail",
20
+ save: "api/v1/dev/workflowdocumentactionmail",
21
+ findById: "api/v1/dev/workflowdocumentactionmail",
22
+ setData: setData,
23
+ });
24
+
25
+ const SystemMailTemplates = useSelector(
26
+ (state: any) => state.commonStores.stores.SystemMailTemplates.data
27
+ );
28
+ const formElements: Array<FormElementProps> = [
29
+ {
30
+ type: "field",
31
+ mode: "props",
32
+ props: {
33
+ fieldLabel: "id",
34
+ fieldName: "id",
35
+ fieldType: "number",
36
+ hidden: true,
37
+ gridProps: {
38
+ hidden: true,
39
+ },
40
+ },
41
+ },
42
+ {
43
+ type: "field",
44
+ mode: "props",
45
+ props: {
46
+ fieldLabel: "createTime",
47
+ fieldName: "createTime",
48
+ fieldType: "datetime",
49
+ hidden: true,
50
+ gridProps: {
51
+ hidden: true,
52
+ },
53
+ },
54
+ },
55
+ {
56
+ type: "field",
57
+ mode: "props",
58
+ props: {
59
+ fieldLabel: "createdBy",
60
+ fieldName: "createdBy",
61
+ fieldType: "text",
62
+ hidden: true,
63
+ gridProps: {
64
+ hidden: true,
65
+ },
66
+ },
67
+ },
68
+ {
69
+ type: "field",
70
+ mode: "props",
71
+ props: {
72
+ fieldLabel: "lastUpdateBy",
73
+ fieldName: "lastUpdateBy",
74
+ fieldType: "text",
75
+ hidden: true,
76
+ gridProps: {
77
+ hidden: true,
78
+ },
79
+ },
80
+ },
81
+ {
82
+ type: "field",
83
+ mode: "props",
84
+ props: {
85
+ fieldLabel: "lastUpdateTime",
86
+ fieldName: "lastUpdateTime",
87
+ fieldType: "datetime",
88
+ hidden: true,
89
+ gridProps: {
90
+ hidden: true,
91
+ },
92
+ },
93
+ },
94
+ {
95
+ type: "field",
96
+ mode: "props",
97
+ props: {
98
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_MAIL_DOCUMENT_ACTION_ID",
99
+ fieldName: "documentActionId",
100
+ required: false,
101
+ fieldType: "number",
102
+ hidden: true,
103
+ gridProps: {
104
+ hidden: true,
105
+ },
106
+ },
107
+ },
108
+ {
109
+ type: "field",
110
+ mode: "props",
111
+ props: {
112
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_MAIL_MAIL_TEMPLATE_ID",
113
+ fieldName: "mailTemplateId",
114
+ required: true,
115
+ fieldType: "combobox",
116
+ options: SystemMailTemplates,
117
+ optionDisplayField: "mailTemplateName",
118
+ optionValueField: "id",
119
+ },
120
+ },
121
+ {
122
+ type: "field",
123
+ mode: "props",
124
+ props: {
125
+ fieldLabel: "WORKFLOW_DOCUMENT_ACTION_MAIL_ENABLED",
126
+ fieldName: "enabled",
127
+ required: false,
128
+ fieldType: "checkbox",
129
+ },
130
+ },
131
+ ];
132
+
133
+ return (
134
+ <TemplateGrid
135
+ apiActions={apiActions}
136
+ data={data}
137
+ hideInfoBar={true}
138
+ gridLoadParametersValues={{ actionId: props.selectedRecord.id }}
139
+ setData={setData}
140
+ editMode={{ editMode: "row" }}
141
+ formElements={formElements}
142
+ keyColumnName={"id"}
143
+ gridTitle={t("WORKFLOW_DOCUMENT_ACTION_MAIL_PLURAL")}
144
+ girdIcon="table-cells"
145
+ editAction={{
146
+ isEnabled: true,
147
+ authority: "WORKFLOW_DOCUMENT_ACTION_MAIL_EDIT",
148
+ preActionValidation: (record) => {
149
+ record.documentActionId = props.selectedRecord.id;
150
+ return true;
151
+ },
152
+ }}
153
+ deleteAction={{
154
+ isEnabled: true,
155
+ authority: "WORKFLOW_DOCUMENT_ACTION_MAIL_DELETE",
156
+ }}
157
+ />
158
+ );
159
+ };
160
+
161
+ export default WorkflowDocumentActionMailGrid;