@asaleh37/ui-base 1.2.3 → 1.2.4
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 +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
- 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
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useApiActions, useWindow } from "../../../hooks";
|
|
7
|
+
import { useSelector } from "react-redux";
|
|
8
|
+
import { toast } from "react-toastify";
|
|
9
|
+
import MailRecipientGrid from "./MailRecipientGrid";
|
|
10
|
+
import MailBodyGrid from "./MailBodyGrid";
|
|
11
|
+
import MailAttachmentGrid from "./MailAttachmentGrid";
|
|
12
|
+
|
|
13
|
+
const MailTemplateGrid: React.FC = () => {
|
|
14
|
+
const SystemDataQueries = useSelector(
|
|
15
|
+
(state: any) => state.commonStores.stores.SystemDataQueries.data
|
|
16
|
+
);
|
|
17
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
18
|
+
const {
|
|
19
|
+
Window: MailRecipentsWindow,
|
|
20
|
+
setWindowState: setMailRecipientsWindowState,
|
|
21
|
+
} = useWindow({ windowTitle: "Mail Receipents", windowIcon: "users" });
|
|
22
|
+
const { Window: MailBodiesWindow, setWindowState: setMailBodiesWindowState } =
|
|
23
|
+
useWindow({
|
|
24
|
+
windowTitle: "Mail Bodies",
|
|
25
|
+
windowIcon: { prefix: "fas", iconName: "envelope-open-text" },
|
|
26
|
+
});
|
|
27
|
+
const {
|
|
28
|
+
Window: MailAttachmentWindow,
|
|
29
|
+
setWindowState: setMailAttachmentWindowState,
|
|
30
|
+
} = useWindow({
|
|
31
|
+
windowTitle: "Mail Attachment",
|
|
32
|
+
windowIcon: "paperclip",
|
|
33
|
+
width: 500,
|
|
34
|
+
});
|
|
35
|
+
const { t } = useTranslation();
|
|
36
|
+
const [data, setData] = useState([]);
|
|
37
|
+
const apiActions = useApiActions({
|
|
38
|
+
commonStoreKey: "SystemMailTemplates",
|
|
39
|
+
deleteById: "api/v1/dev/mailtemplate",
|
|
40
|
+
save: "api/v1/dev/mailtemplate",
|
|
41
|
+
findById: "api/v1/dev/mailtemplate",
|
|
42
|
+
setData: setData,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const formElements: Array<FormElementProps> = [
|
|
46
|
+
{
|
|
47
|
+
type: "field",
|
|
48
|
+
mode: "props",
|
|
49
|
+
props: {
|
|
50
|
+
fieldLabel: "id",
|
|
51
|
+
fieldName: "id",
|
|
52
|
+
fieldType: "number",
|
|
53
|
+
hidden: true,
|
|
54
|
+
gridProps: {
|
|
55
|
+
hidden: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "field",
|
|
61
|
+
mode: "props",
|
|
62
|
+
props: {
|
|
63
|
+
fieldLabel: "createTime",
|
|
64
|
+
fieldName: "createTime",
|
|
65
|
+
fieldType: "datetime",
|
|
66
|
+
hidden: true,
|
|
67
|
+
gridProps: {
|
|
68
|
+
hidden: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "field",
|
|
74
|
+
mode: "props",
|
|
75
|
+
props: {
|
|
76
|
+
fieldLabel: "createdBy",
|
|
77
|
+
fieldName: "createdBy",
|
|
78
|
+
fieldType: "text",
|
|
79
|
+
hidden: true,
|
|
80
|
+
gridProps: {
|
|
81
|
+
hidden: true,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: "field",
|
|
87
|
+
mode: "props",
|
|
88
|
+
props: {
|
|
89
|
+
fieldLabel: "lastUpdateBy",
|
|
90
|
+
fieldName: "lastUpdateBy",
|
|
91
|
+
fieldType: "text",
|
|
92
|
+
hidden: true,
|
|
93
|
+
gridProps: {
|
|
94
|
+
hidden: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "field",
|
|
100
|
+
mode: "props",
|
|
101
|
+
props: {
|
|
102
|
+
fieldLabel: "lastUpdateTime",
|
|
103
|
+
fieldName: "lastUpdateTime",
|
|
104
|
+
fieldType: "datetime",
|
|
105
|
+
hidden: true,
|
|
106
|
+
gridProps: {
|
|
107
|
+
hidden: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "field",
|
|
113
|
+
mode: "props",
|
|
114
|
+
props: {
|
|
115
|
+
fieldLabel: "MAIL_TEMPLATE_MAIL_TEMPLATE_CODE",
|
|
116
|
+
fieldName: "mailTemplateCode",
|
|
117
|
+
required: true,
|
|
118
|
+
fieldType: "text",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "field",
|
|
123
|
+
mode: "props",
|
|
124
|
+
props: {
|
|
125
|
+
fieldLabel: "MAIL_TEMPLATE_MAIL_TEMPLATE_NAME",
|
|
126
|
+
fieldName: "mailTemplateName",
|
|
127
|
+
required: true,
|
|
128
|
+
fieldType: "text",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
{
|
|
133
|
+
type: "field",
|
|
134
|
+
mode: "props",
|
|
135
|
+
props: {
|
|
136
|
+
fieldLabel: "MAIL_TEMPLATE_ENABLED",
|
|
137
|
+
fieldName: "enabled",
|
|
138
|
+
required: false,
|
|
139
|
+
fieldType: "checkbox",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: "group",
|
|
144
|
+
props: {
|
|
145
|
+
label: "subject",
|
|
146
|
+
icon: "users",
|
|
147
|
+
style: { padding: 1, border: "0.5px dashed black", margin: 1 },
|
|
148
|
+
elements: [
|
|
149
|
+
{
|
|
150
|
+
type: "field",
|
|
151
|
+
mode: "props",
|
|
152
|
+
props: {
|
|
153
|
+
fieldLabel: "MAIL_TEMPLATE_MAIL_SUBJECT",
|
|
154
|
+
fieldName: "mailSubject",
|
|
155
|
+
required: true,
|
|
156
|
+
fieldType: "text",
|
|
157
|
+
gridProps: {
|
|
158
|
+
hidden: true,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: "field",
|
|
164
|
+
mode: "props",
|
|
165
|
+
props: {
|
|
166
|
+
fieldLabel: "MAIL_TEMPLATE_SUBJECT_DATA_QUERY_ID",
|
|
167
|
+
fieldName: "subjectDataQueryId",
|
|
168
|
+
required: false,
|
|
169
|
+
fieldType: "combobox",
|
|
170
|
+
options: SystemDataQueries,
|
|
171
|
+
optionDisplayField: "queryName",
|
|
172
|
+
optionValueField: "id",
|
|
173
|
+
gridProps: {
|
|
174
|
+
hidden: true,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
{
|
|
183
|
+
type: "group",
|
|
184
|
+
props: {
|
|
185
|
+
label: "Recipients",
|
|
186
|
+
icon: "users",
|
|
187
|
+
style: { padding: 1, border: "0.5px dashed black", margin: 1 },
|
|
188
|
+
elements: [
|
|
189
|
+
{
|
|
190
|
+
type: "field",
|
|
191
|
+
mode: "props",
|
|
192
|
+
props: {
|
|
193
|
+
fieldLabel:
|
|
194
|
+
"To Recipient Query (must return list of objects with property email)",
|
|
195
|
+
fieldName: "mailToDataQueryId",
|
|
196
|
+
required: false,
|
|
197
|
+
fieldType: "combobox",
|
|
198
|
+
options: SystemDataQueries,
|
|
199
|
+
optionDisplayField: "queryName",
|
|
200
|
+
optionValueField: "id",
|
|
201
|
+
gridProps: {
|
|
202
|
+
hidden: true,
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
type: "field",
|
|
208
|
+
mode: "props",
|
|
209
|
+
props: {
|
|
210
|
+
fieldLabel:
|
|
211
|
+
"CC Recipient Query (must return list of objects with property email)",
|
|
212
|
+
fieldName: "mailCcDataQueryId",
|
|
213
|
+
required: false,
|
|
214
|
+
fieldType: "combobox",
|
|
215
|
+
options: SystemDataQueries,
|
|
216
|
+
optionDisplayField: "queryName",
|
|
217
|
+
optionValueField: "id",
|
|
218
|
+
gridProps: {
|
|
219
|
+
hidden: true,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: "group",
|
|
228
|
+
props: {
|
|
229
|
+
label: "Periodical Configuration",
|
|
230
|
+
icon: "history",
|
|
231
|
+
style: { padding: 1, border: "0.5px dashed black", margin: 1 },
|
|
232
|
+
elements: [
|
|
233
|
+
{
|
|
234
|
+
type: "field",
|
|
235
|
+
mode: "props",
|
|
236
|
+
props: {
|
|
237
|
+
fieldLabel: "MAIL_TEMPLATE_PERIODICAL",
|
|
238
|
+
fieldName: "periodical",
|
|
239
|
+
required: false,
|
|
240
|
+
fieldType: "checkbox",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: "field",
|
|
245
|
+
mode: "props",
|
|
246
|
+
props: {
|
|
247
|
+
fieldLabel: "MAIL_TEMPLATE_PERIOD_TYPE",
|
|
248
|
+
fieldName: "periodType",
|
|
249
|
+
options: [
|
|
250
|
+
{ value: "Year" },
|
|
251
|
+
{ value: "Month" },
|
|
252
|
+
{ value: "Day" },
|
|
253
|
+
{ value: "Hour" },
|
|
254
|
+
{ value: "Minute" },
|
|
255
|
+
{ value: "Second" },
|
|
256
|
+
],
|
|
257
|
+
optionDisplayField: "value",
|
|
258
|
+
optionValueField: "value",
|
|
259
|
+
required: false,
|
|
260
|
+
fieldType: "combobox",
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
type: "field",
|
|
265
|
+
mode: "props",
|
|
266
|
+
props: {
|
|
267
|
+
fieldLabel: "MAIL_TEMPLATE_PERIOD_VALUE",
|
|
268
|
+
fieldName: "periodValue",
|
|
269
|
+
required: false,
|
|
270
|
+
fieldType: "number",
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
type: "field",
|
|
275
|
+
mode: "props",
|
|
276
|
+
props: {
|
|
277
|
+
fieldLabel: "MAIL_TEMPLATE_START_SENDING_AT",
|
|
278
|
+
fieldName: "startSendingAt",
|
|
279
|
+
required: false,
|
|
280
|
+
fieldType: "datetime",
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
return (
|
|
289
|
+
<>
|
|
290
|
+
<MailRecipentsWindow>
|
|
291
|
+
<MailRecipientGrid
|
|
292
|
+
selectedRecord={selectedRecord}
|
|
293
|
+
callBkFn={() => {
|
|
294
|
+
setMailRecipientsWindowState(false);
|
|
295
|
+
}}
|
|
296
|
+
/>
|
|
297
|
+
</MailRecipentsWindow>
|
|
298
|
+
<MailBodiesWindow>
|
|
299
|
+
<MailBodyGrid
|
|
300
|
+
selectedRecord={selectedRecord}
|
|
301
|
+
callBkFn={() => {
|
|
302
|
+
setMailRecipientsWindowState(false);
|
|
303
|
+
}}
|
|
304
|
+
/>
|
|
305
|
+
</MailBodiesWindow>
|
|
306
|
+
<MailAttachmentWindow>
|
|
307
|
+
<MailAttachmentGrid
|
|
308
|
+
selectedRecord={selectedRecord}
|
|
309
|
+
callBkFn={() => {
|
|
310
|
+
setMailAttachmentWindowState(false);
|
|
311
|
+
}}
|
|
312
|
+
/>
|
|
313
|
+
</MailAttachmentWindow>
|
|
314
|
+
<TemplateGrid
|
|
315
|
+
apiActions={apiActions}
|
|
316
|
+
data={data}
|
|
317
|
+
setData={setData}
|
|
318
|
+
editMode={{
|
|
319
|
+
editMode: "modal",
|
|
320
|
+
specs: {
|
|
321
|
+
modalWidth: 300,
|
|
322
|
+
modalTitle: "Mail Template",
|
|
323
|
+
modalIcon: "envelope",
|
|
324
|
+
},
|
|
325
|
+
}}
|
|
326
|
+
formElements={formElements}
|
|
327
|
+
keyColumnName={"id"}
|
|
328
|
+
gridTitle={t("MAIL_TEMPLATE_PLURAL")}
|
|
329
|
+
girdIcon="envelope"
|
|
330
|
+
rowActions={[
|
|
331
|
+
{
|
|
332
|
+
icon: "users",
|
|
333
|
+
label: "Recipients",
|
|
334
|
+
actionFn: async (data) => {
|
|
335
|
+
setSelectedRecord(data);
|
|
336
|
+
setMailRecipientsWindowState(true);
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
icon: { prefix: "fas", iconName: "envelope-open-text" },
|
|
341
|
+
label: "Mail Body",
|
|
342
|
+
actionFn: async (data) => {
|
|
343
|
+
setSelectedRecord(data);
|
|
344
|
+
setMailBodiesWindowState(true);
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
icon: "paperclip",
|
|
349
|
+
label: "Mail Attachments",
|
|
350
|
+
actionFn: async (data) => {
|
|
351
|
+
setSelectedRecord(data);
|
|
352
|
+
setMailAttachmentWindowState(true);
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
]}
|
|
356
|
+
editAction={{
|
|
357
|
+
isEnabled: true,
|
|
358
|
+
authority: "MAIL_TEMPLATE_EDIT",
|
|
359
|
+
preActionValidation: (record) => {
|
|
360
|
+
if (record?.periodical === true && !record?.periodType) {
|
|
361
|
+
toast.error(
|
|
362
|
+
"You must specifiy the period type since this email is periodical"
|
|
363
|
+
);
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
if (record?.periodical === true && !record?.periodValue) {
|
|
367
|
+
toast.error(
|
|
368
|
+
"You must specifiy the period value since this email is periodical"
|
|
369
|
+
);
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
if (record?.periodical === true && !record?.startSendingAt) {
|
|
373
|
+
toast.error(
|
|
374
|
+
"You must specifiy the start sending time since this email is periodical"
|
|
375
|
+
);
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return true;
|
|
380
|
+
},
|
|
381
|
+
}}
|
|
382
|
+
deleteAction={{ isEnabled: true, authority: "MAIL_TEMPLATE_DELETE" }}
|
|
383
|
+
/>
|
|
384
|
+
</>
|
|
385
|
+
);
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
export default MailTemplateGrid;
|