@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,169 @@
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 { isValidEmail } from "../../../util";
7
+ import { toast } from "react-toastify";
8
+
9
+ type MailRecipientGridProps = {
10
+ selectedRecord: any;
11
+ callBkFn: () => void;
12
+ };
13
+
14
+ const MailRecipientGrid: React.FC<MailRecipientGridProps> = (props) => {
15
+ const { t } = useTranslation();
16
+ const [data, setData] = useState([]);
17
+ const apiActions = useApiActions({
18
+ findAll: "api/v1/dev/mailrecipient/all",
19
+ deleteById: "api/v1/dev/mailrecipient",
20
+ save: "api/v1/dev/mailrecipient",
21
+ findById: "api/v1/dev/mailrecipient",
22
+ setData: setData,
23
+ });
24
+
25
+ const formElements: Array<FormElementProps> = [
26
+ {
27
+ type: "field",
28
+ mode: "props",
29
+ props: {
30
+ fieldLabel: "id",
31
+ fieldName: "id",
32
+ fieldType: "number",
33
+ hidden: true,
34
+ gridProps: {
35
+ hidden: true,
36
+ },
37
+ },
38
+ },
39
+ {
40
+ type: "field",
41
+ mode: "props",
42
+ props: {
43
+ fieldLabel: "createTime",
44
+ fieldName: "createTime",
45
+ fieldType: "datetime",
46
+ hidden: true,
47
+ gridProps: {
48
+ hidden: true,
49
+ },
50
+ },
51
+ },
52
+ {
53
+ type: "field",
54
+ mode: "props",
55
+ props: {
56
+ fieldLabel: "createdBy",
57
+ fieldName: "createdBy",
58
+ fieldType: "text",
59
+ hidden: true,
60
+ gridProps: {
61
+ hidden: true,
62
+ },
63
+ },
64
+ },
65
+ {
66
+ type: "field",
67
+ mode: "props",
68
+ props: {
69
+ fieldLabel: "lastUpdateBy",
70
+ fieldName: "lastUpdateBy",
71
+ fieldType: "text",
72
+ hidden: true,
73
+ gridProps: {
74
+ hidden: true,
75
+ },
76
+ },
77
+ },
78
+ {
79
+ type: "field",
80
+ mode: "props",
81
+ props: {
82
+ fieldLabel: "lastUpdateTime",
83
+ fieldName: "lastUpdateTime",
84
+ fieldType: "datetime",
85
+ hidden: true,
86
+ gridProps: {
87
+ hidden: true,
88
+ },
89
+ },
90
+ },
91
+ {
92
+ type: "field",
93
+ mode: "props",
94
+ props: {
95
+ fieldLabel: "MAIL_RECIPIENT_MAIL_TEMPLATE_ID",
96
+ fieldName: "mailTemplateId",
97
+ hidden: true,
98
+ gridProps: {
99
+ hidden: true,
100
+ },
101
+ required: false,
102
+ fieldType: "number",
103
+ },
104
+ },
105
+ {
106
+ type: "field",
107
+ mode: "props",
108
+ props: {
109
+ fieldLabel: "MAIL_RECIPIENT_RECIPIENT_TYPE",
110
+ fieldName: "recipientType",
111
+ required: true,
112
+ fieldType: "combobox",
113
+ options: [{ value: "To" }, { value: "CC" }],
114
+ optionDisplayField: "value",
115
+ optionValueField: "value",
116
+ },
117
+ },
118
+ {
119
+ type: "field",
120
+ mode: "props",
121
+ props: {
122
+ fieldLabel: "MAIL_RECIPIENT_RECIPIENT_MAIL",
123
+ fieldName: "recipientMail",
124
+ required: true,
125
+ fieldType: "text",
126
+ },
127
+ },
128
+ {
129
+ type: "field",
130
+ mode: "props",
131
+ props: {
132
+ fieldLabel: "MAIL_RECIPIENT_ENABLED",
133
+ fieldName: "enabled",
134
+ required: false,
135
+ fieldType: "checkbox",
136
+ },
137
+ },
138
+ ];
139
+
140
+ return (
141
+ <TemplateGrid
142
+ apiActions={apiActions}
143
+ data={data}
144
+ hideInfoBar={true}
145
+ gridLoadParametersValues={{mailTemplateId:props.selectedRecord.id}}
146
+ setData={setData}
147
+ editMode={{ editMode: "row" }}
148
+ formElements={formElements}
149
+ keyColumnName={"id"}
150
+ gridTitle={t("MAIL_RECIPIENT_PLURAL")}
151
+ girdIcon="users"
152
+ editAction={{
153
+ isEnabled: true,
154
+ authority: "MAIL_RECIPIENT_EDIT",
155
+ preActionValidation: (record) => {
156
+ if (record?.recipientMail && !isValidEmail(record.recipientMail)) {
157
+ toast.error("You must enter a valid email address");
158
+ return false;
159
+ }
160
+ record.mailTemplateId = props.selectedRecord.id;
161
+ return true;
162
+ },
163
+ }}
164
+ deleteAction={{ isEnabled: true, authority: "MAIL_RECIPIENT_DELETE" }}
165
+ />
166
+ );
167
+ };
168
+
169
+ export default MailRecipientGrid;
@@ -0,0 +1,478 @@
1
+ import { useState } from "react";
2
+ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
+ import {
4
+ FormActionProps,
5
+ FormElementProps,
6
+ } from "../../templates/DataEntryTemplates/DataEntryTypes";
7
+ import { useTranslation } from "react-i18next";
8
+ import { useApiActions } from "../../../hooks";
9
+ import { UseFormReturn } from "react-hook-form";
10
+
11
+ type ValidationCritria = {
12
+ isVisible: boolean;
13
+ isMandatory: boolean;
14
+ };
15
+
16
+ export type EngineType = "Gmail" | "Azure";
17
+
18
+ type ReportValidationOptions = {
19
+ mailHost: ValidationCritria;
20
+ mailPort: ValidationCritria;
21
+ mailUsername: ValidationCritria;
22
+ mailPassword: ValidationCritria;
23
+ mailProtocol: ValidationCritria;
24
+ isMailSmtpAuthEnabled: ValidationCritria;
25
+ isMailStarttlsEnabled: ValidationCritria;
26
+ isSmtpSSlEnabled: ValidationCritria;
27
+ azureGraphApiClientId: ValidationCritria;
28
+ azureGraphApiClientSecret: ValidationCritria;
29
+ azureGraphApiTenantId: ValidationCritria;
30
+ azureGraphApiScope: ValidationCritria;
31
+ azureGraphApiEmailId: ValidationCritria;
32
+ };
33
+
34
+ type validationObjectType = {
35
+ [key in EngineType]: ReportValidationOptions;
36
+ };
37
+
38
+ const validationObject: validationObjectType = {
39
+ Gmail: {
40
+ mailHost: { isMandatory: true, isVisible: true },
41
+ mailPort: { isMandatory: true, isVisible: true },
42
+ mailUsername: { isMandatory: true, isVisible: true },
43
+ mailPassword: { isMandatory: true, isVisible: true },
44
+ mailProtocol: { isMandatory: true, isVisible: true },
45
+ isMailSmtpAuthEnabled: { isMandatory: true, isVisible: true },
46
+ isMailStarttlsEnabled: { isMandatory: true, isVisible: true },
47
+ isSmtpSSlEnabled: { isMandatory: true, isVisible: true },
48
+ azureGraphApiClientId: { isMandatory: false, isVisible: false },
49
+ azureGraphApiClientSecret: { isMandatory: false, isVisible: false },
50
+ azureGraphApiTenantId: { isMandatory: false, isVisible: false },
51
+ azureGraphApiScope: { isMandatory: false, isVisible: false },
52
+ azureGraphApiEmailId: { isMandatory: false, isVisible: false },
53
+ },
54
+ Azure: {
55
+ mailHost: { isMandatory: false, isVisible: false },
56
+ mailPort: { isMandatory: false, isVisible: false },
57
+ mailUsername: { isMandatory: false, isVisible: false },
58
+ mailPassword: { isMandatory: false, isVisible: false },
59
+ mailProtocol: { isMandatory: false, isVisible: false },
60
+ isMailSmtpAuthEnabled: { isMandatory: false, isVisible: false },
61
+ isMailStarttlsEnabled: { isMandatory: false, isVisible: false },
62
+ isSmtpSSlEnabled: { isMandatory: false, isVisible: false },
63
+ azureGraphApiClientId: { isMandatory: true, isVisible: true },
64
+ azureGraphApiClientSecret: { isMandatory: true, isVisible: true },
65
+ azureGraphApiTenantId: { isMandatory: true, isVisible: true },
66
+ azureGraphApiScope: { isMandatory: true, isVisible: true },
67
+ azureGraphApiEmailId: { isMandatory: true, isVisible: true },
68
+ },
69
+ };
70
+
71
+ const adjustFormAccordingToEngineType = (
72
+ value: any,
73
+ formActions: FormActionProps,
74
+ formManager: UseFormReturn
75
+ ) => {
76
+ if (value && validationObject[value]) {
77
+ const validationObjects: ReportValidationOptions = validationObject[value];
78
+ const fields = Object.keys(validationObjects);
79
+ for (const field of fields) {
80
+ const validationCritria: ValidationCritria = validationObjects[field];
81
+ if (validationCritria.isVisible) {
82
+ formActions.showField(field);
83
+ } else {
84
+ formActions.hideField(field);
85
+ formManager.setValue(field, null);
86
+ }
87
+ }
88
+ } else {
89
+ formActions.hideField("mailHost");
90
+ formManager.setValue("mailHost", null);
91
+ formActions.hideField("mailPort");
92
+ formManager.setValue("mailPort", null);
93
+ formActions.hideField("mailUsername");
94
+ formManager.setValue("mailUsername", null);
95
+ formActions.hideField("mailPassword");
96
+ formManager.setValue("mailPassword", null);
97
+ formActions.hideField("mailProtocol");
98
+ formManager.setValue("mailProtocol", null);
99
+ formActions.hideField("isMailSmtpAuthEnabled");
100
+ formManager.setValue("isMailSmtpAuthEnabled", null);
101
+ formActions.hideField("isMailStarttlsEnabled");
102
+ formManager.setValue("isMailStarttlsEnabled", null);
103
+ formActions.hideField("isSmtpSSlEnabled");
104
+ formManager.setValue("isSmtpSSlEnabled", null);
105
+ formActions.hideField("azureGraphApiClientId");
106
+ formManager.setValue("azureGraphApiClientId", null);
107
+ formActions.hideField("azureGraphApiClientSecret");
108
+ formManager.setValue("azureGraphApiClientSecret", null);
109
+ formActions.hideField("azureGraphApiTenantId");
110
+ formManager.setValue("azureGraphApiTenantId", null);
111
+ formActions.hideField("azureGraphApiScope");
112
+ formManager.setValue("azureGraphApiScope", null);
113
+ formActions.hideField("azureGraphApiEmailId");
114
+ formManager.setValue("azureGraphApiEmailId", null);
115
+ }
116
+ };
117
+
118
+ const MailSenderConfigGrid: React.FC = () => {
119
+ const { t } = useTranslation();
120
+ const [data, setData] = useState([]);
121
+ const apiActions = useApiActions({
122
+ findAll: "api/v1/dev/mailsenderconfig/all",
123
+ deleteById: "api/v1/dev/mailsenderconfig",
124
+ save: "api/v1/dev/mailsenderconfig",
125
+ findById: "api/v1/dev/mailsenderconfig",
126
+ setData: setData,
127
+ });
128
+
129
+ const formElements: Array<FormElementProps> = [
130
+ {
131
+ type: "field",
132
+ mode: "props",
133
+ props: {
134
+ fieldLabel: "id",
135
+ fieldName: "id",
136
+ fieldType: "number",
137
+ hidden: true,
138
+ gridProps: {
139
+ hidden: true,
140
+ },
141
+ },
142
+ },
143
+ {
144
+ type: "field",
145
+ mode: "props",
146
+ props: {
147
+ fieldLabel: "createTime",
148
+ fieldName: "createTime",
149
+ fieldType: "datetime",
150
+ hidden: true,
151
+ gridProps: {
152
+ hidden: true,
153
+ },
154
+ },
155
+ },
156
+ {
157
+ type: "field",
158
+ mode: "props",
159
+ props: {
160
+ fieldLabel: "createdBy",
161
+ fieldName: "createdBy",
162
+ fieldType: "text",
163
+ hidden: true,
164
+ gridProps: {
165
+ hidden: true,
166
+ },
167
+ },
168
+ },
169
+ {
170
+ type: "field",
171
+ mode: "props",
172
+ props: {
173
+ fieldLabel: "lastUpdateBy",
174
+ fieldName: "lastUpdateBy",
175
+ fieldType: "text",
176
+ hidden: true,
177
+ gridProps: {
178
+ hidden: true,
179
+ },
180
+ },
181
+ },
182
+ {
183
+ type: "field",
184
+ mode: "props",
185
+ props: {
186
+ fieldLabel: "lastUpdateTime",
187
+ fieldName: "lastUpdateTime",
188
+ fieldType: "datetime",
189
+ hidden: true,
190
+ gridProps: {
191
+ hidden: true,
192
+ },
193
+ },
194
+ },
195
+ {
196
+ type: "field",
197
+ mode: "props",
198
+ props: {
199
+ fieldLabel: "Name",
200
+ fieldName: "configName",
201
+ required: true,
202
+ fieldType: "text",
203
+ },
204
+ },
205
+ {
206
+ type: "field",
207
+ mode: "props",
208
+ props: {
209
+ fieldLabel: "Engine",
210
+ fieldName: "mailEngine",
211
+ required: true,
212
+ fieldType: "combobox",
213
+ options: [{ value: "Gmail" }, { value: "Azure" }],
214
+ optionDisplayField: "value",
215
+ optionValueField: "value",
216
+ formProps: {
217
+ onValueChangeCallBack(
218
+ value,
219
+ formManager,
220
+ formActions,
221
+ selectedRecord
222
+ ) {
223
+ adjustFormAccordingToEngineType(value, formActions, formManager);
224
+ },
225
+ },
226
+ },
227
+ },
228
+ {
229
+ type: "field",
230
+ mode: "props",
231
+ props: {
232
+ fieldLabel: "Hostname",
233
+ fieldName: "mailHost",
234
+ required: false,
235
+ fieldType: "text",
236
+ hidden: true,
237
+ gridProps: {
238
+ hidden: true,
239
+ },
240
+ },
241
+ },
242
+ {
243
+ type: "field",
244
+ mode: "props",
245
+ props: {
246
+ fieldLabel: "port",
247
+ fieldName: "mailPort",
248
+ required: false,
249
+ fieldType: "number",
250
+ hidden: true,
251
+ gridProps: {
252
+ hidden: true,
253
+ },
254
+ },
255
+ },
256
+ {
257
+ type: "field",
258
+ mode: "props",
259
+ props: {
260
+ fieldLabel: "username",
261
+ fieldName: "mailUsername",
262
+ required: false,
263
+ fieldType: "text",
264
+ hidden: true,
265
+ gridProps: {
266
+ hidden: true,
267
+ },
268
+ },
269
+ },
270
+ {
271
+ type: "field",
272
+ mode: "props",
273
+ props: {
274
+ fieldLabel: "password",
275
+ fieldName: "mailPassword",
276
+ required: false,
277
+ fieldType: "text",
278
+ hidden: true,
279
+ gridProps: {
280
+ hidden: true,
281
+ },
282
+ },
283
+ },
284
+
285
+ {
286
+ type: "field",
287
+ mode: "props",
288
+ props: {
289
+ fieldLabel: "Workflow Approval Receive Email",
290
+ fieldName: "workFlowApprovalReceiveEmail",
291
+ required: true,
292
+ fieldType: "text",
293
+ },
294
+ },
295
+ {
296
+ type: "field",
297
+ mode: "props",
298
+ props: {
299
+ fieldLabel: "Protocol",
300
+ fieldName: "mailProtocol",
301
+ required: false,
302
+ fieldType: "text",
303
+ hidden: true,
304
+ gridProps: {
305
+ hidden: true,
306
+ },
307
+ },
308
+ },
309
+
310
+ {
311
+ type: "field",
312
+ mode: "props",
313
+ props: {
314
+ fieldLabel: "Enable Smtp Auth",
315
+ fieldName: "isMailSmtpAuthEnabled",
316
+ required: false,
317
+ fieldType: "checkbox",
318
+ hidden: true,
319
+ gridProps: {
320
+ hidden: true,
321
+ },
322
+ },
323
+ },
324
+ {
325
+ type: "field",
326
+ mode: "props",
327
+ props: {
328
+ fieldLabel: "Enable Start TLS",
329
+ fieldName: "isMailStarttlsEnabled",
330
+ required: false,
331
+ fieldType: "checkbox",
332
+ hidden: true,
333
+ gridProps: {
334
+ hidden: true,
335
+ },
336
+ },
337
+ },
338
+ {
339
+ type: "field",
340
+ mode: "props",
341
+ props: {
342
+ fieldLabel: "Enable SSL",
343
+ fieldName: "isSmtpSSlEnabled",
344
+ required: false,
345
+ fieldType: "checkbox",
346
+ hidden: true,
347
+ gridProps: {
348
+ hidden: true,
349
+ },
350
+ },
351
+ },
352
+ {
353
+ type: "field",
354
+ mode: "props",
355
+ props: {
356
+ fieldLabel: "Azure Graph API Client Id",
357
+ fieldName: "azureGraphApiClientId",
358
+ required: false,
359
+ fieldType: "text",
360
+ hidden: true,
361
+ gridProps: {
362
+ hidden: true,
363
+ },
364
+ },
365
+ },
366
+ {
367
+ type: "field",
368
+ mode: "props",
369
+ props: {
370
+ fieldLabel: "Azure Graph API Secret",
371
+ fieldName: "azureGraphApiClientSecret",
372
+ required: false,
373
+ fieldType: "text",
374
+ hidden: true,
375
+ gridProps: {
376
+ hidden: true,
377
+ },
378
+ },
379
+ },
380
+ {
381
+ type: "field",
382
+ mode: "props",
383
+ props: {
384
+ fieldLabel: "Azure Graph API Tenant Id",
385
+ fieldName: "azureGraphApiTenantId",
386
+ required: false,
387
+ fieldType: "text",
388
+ hidden: true,
389
+ gridProps: {
390
+ hidden: true,
391
+ },
392
+ },
393
+ },
394
+ {
395
+ type: "field",
396
+ mode: "props",
397
+ props: {
398
+ fieldLabel: "Azure Graph API Scope",
399
+ fieldName: "azureGraphApiScope",
400
+ required: false,
401
+ fieldType: "text",
402
+ hidden: true,
403
+ gridProps: {
404
+ hidden: true,
405
+ },
406
+ },
407
+ },
408
+ {
409
+ type: "field",
410
+ mode: "props",
411
+ props: {
412
+ fieldLabel: "Azure Graph API Email Id",
413
+ fieldName: "azureGraphApiEmailId",
414
+ required: false,
415
+ fieldType: "text",
416
+ hidden: true,
417
+ gridProps: {
418
+ hidden: true,
419
+ },
420
+ },
421
+ },
422
+ {
423
+ type: "field",
424
+ mode: "props",
425
+ props: {
426
+ fieldLabel: "Default",
427
+ fieldName: "isDefault",
428
+ required: false,
429
+ fieldType: "checkbox",
430
+ },
431
+ },
432
+ {
433
+ type: "field",
434
+ mode: "props",
435
+ props: {
436
+ fieldLabel: "Active",
437
+ fieldName: "isActive",
438
+ required: false,
439
+ fieldType: "checkbox",
440
+ },
441
+ },
442
+ ];
443
+
444
+ return (
445
+ <TemplateGrid
446
+ apiActions={apiActions}
447
+ data={data}
448
+ setData={setData}
449
+ editMode={{
450
+ editMode: "modal",
451
+ specs: {
452
+ modalIcon: { iconName: "paper-plane", prefix: "fas" },
453
+ modalTitle: "Mail Sender Configuration",
454
+ modalWidth: 300,
455
+ },
456
+ }}
457
+ formElements={formElements}
458
+ keyColumnName={"id"}
459
+ gridTitle={t("Mail Sender Configuration")}
460
+ girdIcon={{ iconName: "paper-plane", prefix: "fas" }}
461
+ editAction={{ isEnabled: true, authority: "MAIL_SENDER_CONFIG_EDIT" }}
462
+ deleteAction={{ isEnabled: true, authority: "MAIL_SENDER_CONFIG_DELETE" }}
463
+ formLoadCallBk={(
464
+ formActions: FormActionProps,
465
+ formManager: UseFormReturn,
466
+ record: any
467
+ ) => {
468
+ adjustFormAccordingToEngineType(
469
+ record.mailEngine,
470
+ formActions,
471
+ formManager
472
+ );
473
+ }}
474
+ />
475
+ );
476
+ };
477
+
478
+ export default MailSenderConfigGrid;