@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,131 @@
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 LookupGridProps = {
9
+ selectedApplication: any;
10
+ };
11
+
12
+ const LookupGrid: React.FC<LookupGridProps> = (props) => {
13
+ const SystemOrganizations = useSelector(
14
+ (state: any) => state.commonStores.stores.SystemOrganizations.data
15
+ );
16
+ const { t } = useTranslation();
17
+ const [data, setData] = useState([]);
18
+ const apiActions = useApiActions({
19
+ findAll: "api/v1/dev/lookup/all",
20
+ deleteById: "api/v1/dev/lookup",
21
+ save: "api/v1/dev/lookup",
22
+ findById: "api/v1/dev/lookup",
23
+ setData: setData,
24
+ });
25
+
26
+ const formElements: Array<FormElementProps> = [
27
+ {
28
+ type: "field",
29
+ mode: "props",
30
+ props: {
31
+ fieldLabel: "Organization",
32
+ fieldName: "organizationId",
33
+ options: SystemOrganizations,
34
+ optionDisplayField: "organizationEnName",
35
+ optionValueField: "id",
36
+ required: false,
37
+ fieldType: "combobox",
38
+ },
39
+ },
40
+ {
41
+ type: "field",
42
+ mode: "props",
43
+ props: {
44
+ fieldLabel: "LOOKUP_LOOKUP_TYPE",
45
+ fieldName: "lookupType",
46
+ required: false,
47
+ fieldType: "text",
48
+ },
49
+ },
50
+ {
51
+ type: "field",
52
+ mode: "props",
53
+ props: {
54
+ fieldLabel: "LOOKUP_LOOKUP_AR_DISPLAY",
55
+ fieldName: "lookupArDisplay",
56
+ required: false,
57
+ fieldType: "text",
58
+ },
59
+ },
60
+ {
61
+ type: "field",
62
+ mode: "props",
63
+ props: {
64
+ fieldLabel: "LOOKUP_LOOKUP_EN_DISPLAY",
65
+ fieldName: "lookupEnDisplay",
66
+ required: false,
67
+ fieldType: "text",
68
+ },
69
+ },
70
+ {
71
+ type: "field",
72
+ mode: "props",
73
+ props: {
74
+ fieldLabel: "LOOKUP_LOOKUP_VALUE",
75
+ fieldName: "lookupValue",
76
+ required: false,
77
+ fieldType: "text",
78
+ },
79
+ },
80
+ {
81
+ type: "field",
82
+ mode: "props",
83
+ props: {
84
+ fieldLabel: "LOOKUP_ENABLED",
85
+ fieldName: "enabled",
86
+ required: false,
87
+ fieldType: "checkbox",
88
+ },
89
+ },
90
+ {
91
+ type: "field",
92
+ mode: "props",
93
+ props: {
94
+ fieldLabel: "System Application",
95
+ fieldName: "systemApplicationId",
96
+ hidden: true,
97
+ gridProps: { hidden: true },
98
+ required: false,
99
+ fieldType: "number",
100
+ },
101
+ },
102
+ ];
103
+
104
+ return (
105
+ <TemplateGrid
106
+ apiActions={apiActions}
107
+ data={data}
108
+ setData={setData}
109
+ hideInfoBar={true}
110
+ gridLoadParametersValues={{
111
+ systemApplicationId: props.selectedApplication.id,
112
+ }}
113
+ editMode={{ editMode: "row" }}
114
+ formElements={formElements}
115
+ keyColumnName={"id"}
116
+ gridTitle={t("LOOKUP_PLURAL")}
117
+ girdIcon="list-check"
118
+ editAction={{
119
+ isEnabled: true,
120
+ authority: "LOOKUP_EDIT",
121
+ preActionValidation: (data: any) => {
122
+ data.systemApplicationId = props.selectedApplication.id;
123
+ return true;
124
+ },
125
+ }}
126
+ deleteAction={{ isEnabled: true, authority: "LOOKUP_DELETE" }}
127
+ />
128
+ );
129
+ };
130
+
131
+ export default LookupGrid;
@@ -0,0 +1,155 @@
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 MailAttachmentGridProps = {
9
+ selectedRecord: any;
10
+ callBkFn: () => void;
11
+ };
12
+
13
+ const MailAttachmentGrid: React.FC<MailAttachmentGridProps> = (props) => {
14
+ const SystemReports = useSelector(
15
+ (state: any) => state.commonStores.stores.SystemReports.data
16
+ );
17
+ const { t } = useTranslation();
18
+ const [data, setData] = useState([]);
19
+ const apiActions = useApiActions({
20
+ findAll: "api/v1/dev/mailattachment/all",
21
+ deleteById: "api/v1/dev/mailattachment",
22
+ save: "api/v1/dev/mailattachment",
23
+ findById: "api/v1/dev/mailattachment",
24
+ setData: setData,
25
+ });
26
+
27
+ const formElements: Array<FormElementProps> = [
28
+ {
29
+ type: "field",
30
+ mode: "props",
31
+ props: {
32
+ fieldLabel: "id",
33
+ fieldName: "id",
34
+ fieldType: "number",
35
+ hidden: true,
36
+ gridProps: {
37
+ hidden: true,
38
+ },
39
+ },
40
+ },
41
+ {
42
+ type: "field",
43
+ mode: "props",
44
+ props: {
45
+ fieldLabel: "createTime",
46
+ fieldName: "createTime",
47
+ fieldType: "datetime",
48
+ hidden: true,
49
+ gridProps: {
50
+ hidden: true,
51
+ },
52
+ },
53
+ },
54
+ {
55
+ type: "field",
56
+ mode: "props",
57
+ props: {
58
+ fieldLabel: "createdBy",
59
+ fieldName: "createdBy",
60
+ fieldType: "text",
61
+ hidden: true,
62
+ gridProps: {
63
+ hidden: true,
64
+ },
65
+ },
66
+ },
67
+ {
68
+ type: "field",
69
+ mode: "props",
70
+ props: {
71
+ fieldLabel: "lastUpdateBy",
72
+ fieldName: "lastUpdateBy",
73
+ fieldType: "text",
74
+ hidden: true,
75
+ gridProps: {
76
+ hidden: true,
77
+ },
78
+ },
79
+ },
80
+ {
81
+ type: "field",
82
+ mode: "props",
83
+ props: {
84
+ fieldLabel: "lastUpdateTime",
85
+ fieldName: "lastUpdateTime",
86
+ fieldType: "datetime",
87
+ hidden: true,
88
+ gridProps: {
89
+ hidden: true,
90
+ },
91
+ },
92
+ },
93
+ {
94
+ type: "field",
95
+ mode: "props",
96
+ props: {
97
+ options: SystemReports,
98
+ optionValueField: "id",
99
+ optionDisplayField: "reportName",
100
+ fieldLabel: "REPORT_REPORT_NAME",
101
+ fieldName: "reportId",
102
+ required: true,
103
+ fieldType: "combobox",
104
+ },
105
+ },
106
+ {
107
+ type: "field",
108
+ mode: "props",
109
+ props: {
110
+ fieldLabel: "MAIL_ATTACHMENT_ENABLED",
111
+ fieldName: "enabled",
112
+ required: false,
113
+ fieldType: "checkbox",
114
+ },
115
+ },
116
+ {
117
+ type: "field",
118
+ mode: "props",
119
+ props: {
120
+ fieldLabel: "MAIL_ATTACHMENT_MAIL_TEMPLATE_ID",
121
+ fieldName: "mailTemplateId",
122
+ required: false,
123
+ hidden: true,
124
+ gridProps: { hidden: true },
125
+ fieldType: "number",
126
+ },
127
+ },
128
+ ];
129
+
130
+ return (
131
+ <TemplateGrid
132
+ apiActions={apiActions}
133
+ data={data}
134
+ hideInfoBar={true}
135
+ gridLoadParametersValues={{ mailTemplateId: props.selectedRecord.id }}
136
+ setData={setData}
137
+ editMode={{ editMode: "row" }}
138
+ formElements={formElements}
139
+ keyColumnName={"id"}
140
+ gridTitle={t("MAIL_ATTACHMENT_PLURAL")}
141
+ girdIcon="paperclip"
142
+ editAction={{
143
+ isEnabled: true,
144
+ authority: "MAIL_ATTACHMENT_EDIT",
145
+ preActionValidation: (record) => {
146
+ record.mailTemplateId = props.selectedRecord.id;
147
+ return true;
148
+ },
149
+ }}
150
+ deleteAction={{ isEnabled: true, authority: "MAIL_ATTACHMENT_DELETE" }}
151
+ />
152
+ );
153
+ };
154
+
155
+ export default MailAttachmentGrid;
@@ -0,0 +1,215 @@
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 MailBodyGridProps = {
9
+ selectedRecord: any;
10
+ callBkFn: () => void;
11
+ };
12
+
13
+ const MailBodyGrid: React.FC<MailBodyGridProps> = (props) => {
14
+ const { t } = useTranslation();
15
+ const [data, setData] = useState([]);
16
+ const SystemDataQueries = useSelector(
17
+ (state: any) => state.commonStores.stores.SystemDataQueries.data
18
+ );
19
+ const apiActions = useApiActions({
20
+ findAll: "api/v1/dev/mailbody/all",
21
+ deleteById: "api/v1/dev/mailbody",
22
+ save: "api/v1/dev/mailbody",
23
+ findById: "api/v1/dev/mailbody",
24
+ setData: setData,
25
+ });
26
+
27
+ const formElements: Array<FormElementProps> = [
28
+ {
29
+ type: "field",
30
+ mode: "props",
31
+ props: {
32
+ fieldLabel: "id",
33
+ fieldName: "id",
34
+ fieldType: "number",
35
+ hidden: true,
36
+ gridProps: {
37
+ hidden: true,
38
+ },
39
+ },
40
+ },
41
+ {
42
+ type: "field",
43
+ mode: "props",
44
+ props: {
45
+ fieldLabel: "createTime",
46
+ fieldName: "createTime",
47
+ fieldType: "datetime",
48
+ hidden: true,
49
+ gridProps: {
50
+ hidden: true,
51
+ },
52
+ },
53
+ },
54
+ {
55
+ type: "field",
56
+ mode: "props",
57
+ props: {
58
+ fieldLabel: "createdBy",
59
+ fieldName: "createdBy",
60
+ fieldType: "text",
61
+ hidden: true,
62
+ gridProps: {
63
+ hidden: true,
64
+ },
65
+ },
66
+ },
67
+ {
68
+ type: "field",
69
+ mode: "props",
70
+ props: {
71
+ fieldLabel: "lastUpdateBy",
72
+ fieldName: "lastUpdateBy",
73
+ fieldType: "text",
74
+ hidden: true,
75
+ gridProps: {
76
+ hidden: true,
77
+ },
78
+ },
79
+ },
80
+ {
81
+ type: "field",
82
+ mode: "props",
83
+ props: {
84
+ fieldLabel: "lastUpdateTime",
85
+ fieldName: "lastUpdateTime",
86
+ fieldType: "datetime",
87
+ hidden: true,
88
+ gridProps: {
89
+ hidden: true,
90
+ },
91
+ },
92
+ },
93
+ {
94
+ type: "field",
95
+ mode: "props",
96
+ props: {
97
+ fieldLabel: "MAIL_BODY_BODY_NAME",
98
+ fieldName: "bodyName",
99
+ required: true,
100
+ fieldType: "text",
101
+ },
102
+ },
103
+ {
104
+ type: "field",
105
+ mode: "props",
106
+ props: {
107
+ fieldLabel: "MAIL_BODY_BODY_ORDER",
108
+ fieldName: "bodyOrder",
109
+ required: false,
110
+ fieldType: "number",
111
+ },
112
+ },
113
+ {
114
+ type: "field",
115
+ mode: "props",
116
+ props: {
117
+ fieldLabel: "MAIL_BODY_BODY_CONTENT",
118
+ fieldName: "bodyContent",
119
+ required: true,
120
+ fieldType: "html",
121
+ },
122
+ },
123
+
124
+ {
125
+ type: "field",
126
+ mode: "props",
127
+ props: {
128
+ fieldLabel: "MAIL_BODY_BODY_CONTENT_DATA_QUERY_ID",
129
+ fieldName: "bodyContentDataQueryId",
130
+ required: false,
131
+ fieldType: "combobox",
132
+ options: SystemDataQueries,
133
+ optionDisplayField: "queryName",
134
+ optionValueField: "id",
135
+ },
136
+ },
137
+ {
138
+ type: "field",
139
+ mode: "props",
140
+ props: {
141
+ fieldLabel: "MAIL_BODY_PRINT_FOR_EACH_RECORD",
142
+ fieldName: "printForEachRecord",
143
+ required: false,
144
+ fieldType: "checkbox",
145
+ },
146
+ },
147
+ {
148
+ type: "field",
149
+ mode: "props",
150
+ props: {
151
+ fieldLabel: "MAIL_BODY_IS_MAIN",
152
+ fieldName: "isMain",
153
+ required: false,
154
+ fieldType: "checkbox",
155
+ },
156
+ },
157
+ {
158
+ type: "field",
159
+ mode: "props",
160
+ props: {
161
+ fieldLabel: "MAIL_BODY_ENABLED",
162
+ fieldName: "enabled",
163
+ required: false,
164
+ fieldType: "checkbox",
165
+ },
166
+ },
167
+ {
168
+ type: "field",
169
+ mode: "props",
170
+ props: {
171
+ fieldLabel: "MAIL_BODY_MAIL_TEMPLATE_ID",
172
+ fieldName: "mailTemplateId",
173
+ required: false,
174
+ hidden: true,
175
+ gridProps: {
176
+ hidden: true,
177
+ },
178
+ fieldType: "number",
179
+ },
180
+ },
181
+ ];
182
+
183
+ return (
184
+ <TemplateGrid
185
+ apiActions={apiActions}
186
+ data={data}
187
+ hideInfoBar={true}
188
+ gridLoadParametersValues={{ mailTemplateId: props.selectedRecord.id }}
189
+ setData={setData}
190
+ editMode={{
191
+ editMode: "modal",
192
+ specs: {
193
+ modalIcon: { prefix: "fas", iconName: "envelope-open-text" },
194
+ modalTitle: "Mail Body",
195
+ modalWidth: "50%",
196
+ },
197
+ }}
198
+ formElements={formElements}
199
+ keyColumnName={"id"}
200
+ gridTitle={t("MAIL_BODY_PLURAL")}
201
+ girdIcon={{ prefix: "fas", iconName: "envelope-open-text" }}
202
+ editAction={{
203
+ isEnabled: true,
204
+ authority: "MAIL_BODY_EDIT",
205
+ preActionValidation: async (record) => {
206
+ record.mailTemplateId = props.selectedRecord.id;
207
+ return true;
208
+ },
209
+ }}
210
+ deleteAction={{ isEnabled: true, authority: "MAIL_BODY_DELETE" }}
211
+ />
212
+ );
213
+ };
214
+
215
+ export default MailBodyGrid;
@@ -1,19 +1,103 @@
1
1
  import { useState } from "react";
2
- import TemplateGrid from "../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
3
- import useApiActions from "../../hooks/useApiActions";
4
- import { FormElementProps } from "../templates/DataEntryTemplates/DataEntryTypes";
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";
5
7
 
6
8
  const MailNotificationQueueGrid: React.FC = () => {
9
+ const { t } = useTranslation();
7
10
  const [data, setData] = useState([]);
8
11
  const apiActions = useApiActions({
9
- findAll: "api/v1/admin/mailnotificationqueue/all",
10
- deleteById: "api/v1/admin/mailnotificationqueue",
11
- save: "api/v1/admin/mailnotificationqueue",
12
- findById: "api/v1/admin/mailnotificationqueue",
12
+ findAll: "api/v1/dev/mailnotificationqueue/all",
13
+ deleteById: "api/v1/dev/mailnotificationqueue",
14
+ save: "api/v1/dev/mailnotificationqueue",
15
+ findById: "api/v1/dev/mailnotificationqueue",
13
16
  setData: setData,
14
17
  });
18
+ const SystemMailTemplates = useSelector(
19
+ (state: any) => state.commonStores.stores.SystemMailTemplates.data
20
+ );
15
21
 
16
22
  const formElements: Array<FormElementProps> = [
23
+ {
24
+ type: "field",
25
+ mode: "props",
26
+ props: {
27
+ fieldLabel: "id",
28
+ fieldName: "id",
29
+ fieldType: "number",
30
+ hidden: true,
31
+ gridProps: {
32
+ hidden: true,
33
+ },
34
+ },
35
+ },
36
+ {
37
+ type: "field",
38
+ mode: "props",
39
+ props: {
40
+ fieldLabel: "createTime",
41
+ fieldName: "createTime",
42
+ fieldType: "datetime",
43
+ hidden: true,
44
+ gridProps: {
45
+ hidden: true,
46
+ },
47
+ },
48
+ },
49
+ {
50
+ type: "field",
51
+ mode: "props",
52
+ props: {
53
+ fieldLabel: "createdBy",
54
+ fieldName: "createdBy",
55
+ fieldType: "text",
56
+ hidden: true,
57
+ gridProps: {
58
+ hidden: true,
59
+ },
60
+ },
61
+ },
62
+ {
63
+ type: "field",
64
+ mode: "props",
65
+ props: {
66
+ fieldLabel: "lastUpdateBy",
67
+ fieldName: "lastUpdateBy",
68
+ fieldType: "text",
69
+ hidden: true,
70
+ gridProps: {
71
+ hidden: true,
72
+ },
73
+ },
74
+ },
75
+ {
76
+ type: "field",
77
+ mode: "props",
78
+ props: {
79
+ fieldLabel: "lastUpdateTime",
80
+ fieldName: "lastUpdateTime",
81
+ fieldType: "datetime",
82
+ hidden: true,
83
+ gridProps: {
84
+ hidden: true,
85
+ },
86
+ },
87
+ },
88
+ {
89
+ type: "field",
90
+ mode: "props",
91
+ props: {
92
+ fieldLabel: "MAIL_NOTIFICATION_QUEUE_MAIL_TEMPLATE_ID",
93
+ fieldName: "mailTemplateId",
94
+ required: false,
95
+ fieldType: "combobox",
96
+ options: SystemMailTemplates,
97
+ optionDisplayField: "mailTemplateName",
98
+ optionValueField: "id",
99
+ },
100
+ },
17
101
  {
18
102
  type: "field",
19
103
  mode: "props",
@@ -21,7 +105,11 @@ const MailNotificationQueueGrid: React.FC = () => {
21
105
  fieldLabel: "MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_ATTACHED_REPORT_ID",
22
106
  fieldName: "customMailAttachedReportId",
23
107
  required: false,
24
- fieldType: "text",
108
+ hidden: true,
109
+ gridProps: {
110
+ hidden: true,
111
+ },
112
+ fieldType: "number",
25
113
  },
26
114
  },
27
115
  {
@@ -31,6 +119,10 @@ const MailNotificationQueueGrid: React.FC = () => {
31
119
  fieldLabel: "MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_BODY",
32
120
  fieldName: "customMailBody",
33
121
  required: false,
122
+ hidden: true,
123
+ gridProps: {
124
+ hidden: true,
125
+ },
34
126
  fieldType: "text",
35
127
  },
36
128
  },
@@ -41,6 +133,7 @@ const MailNotificationQueueGrid: React.FC = () => {
41
133
  fieldLabel: "MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_SUBJECT",
42
134
  fieldName: "customMailSubject",
43
135
  required: false,
136
+ hidden: true,
44
137
  fieldType: "text",
45
138
  },
46
139
  },
@@ -68,20 +161,10 @@ const MailNotificationQueueGrid: React.FC = () => {
68
161
  type: "field",
69
162
  mode: "props",
70
163
  props: {
71
- fieldLabel: "MAIL_NOTIFICATION_QUEUE_MAIL_PARAMETERS",
72
- fieldName: "mailParameters",
73
- required: false,
74
- fieldType: "text",
75
- },
76
- },
77
- {
78
- type: "field",
79
- mode: "props",
80
- props: {
81
- fieldLabel: "MAIL_NOTIFICATION_QUEUE_MAIL_TEMPLATE_ID",
82
- fieldName: "mailTemplateId",
164
+ fieldLabel: "MAIL_NOTIFICATION_QUEUE_NOTIFICATION_TIME",
165
+ fieldName: "notificationTime",
83
166
  required: false,
84
- fieldType: "text",
167
+ fieldType: "datetime",
85
168
  },
86
169
  },
87
170
  {
@@ -98,10 +181,14 @@ const MailNotificationQueueGrid: React.FC = () => {
98
181
  type: "field",
99
182
  mode: "props",
100
183
  props: {
101
- fieldLabel: "MAIL_NOTIFICATION_QUEUE_NOTIFICATION_TIME",
102
- fieldName: "notificationTime",
184
+ fieldLabel: "MAIL_NOTIFICATION_QUEUE_MAIL_PARAMETERS",
185
+ fieldName: "mailParameters",
186
+ hidden: true,
187
+ gridProps: {
188
+ hidden: true,
189
+ },
103
190
  required: false,
104
- fieldType: "datetime",
191
+ fieldType: "text",
105
192
  },
106
193
  },
107
194
  ];
@@ -109,12 +196,13 @@ const MailNotificationQueueGrid: React.FC = () => {
109
196
  return (
110
197
  <TemplateGrid
111
198
  apiActions={apiActions}
199
+ disableDefaultAction={true}
112
200
  data={data}
113
201
  setData={setData}
114
- editMode={{ editMode: "row" }}
202
+ editMode={{ editMode: "none" }}
115
203
  formElements={formElements}
116
204
  keyColumnName={"id"}
117
- gridTitle="MAIL_NOTIFICATION_QUEUE_PLURAL"
205
+ gridTitle={t("MAIL_NOTIFICATION_QUEUE_PLURAL")}
118
206
  girdIcon="table-cells"
119
207
  editAction={{
120
208
  isEnabled: true,