@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.
- package/dist/index.d.ts +20 -13
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -3
- 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,129 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
|
+
|
|
8
|
+
const BluePrintGrid: React.FC = () => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const SystemDataQueries = useSelector(
|
|
11
|
+
(state: any) => state.commonStores.stores.SystemDataQueries.data
|
|
12
|
+
);
|
|
13
|
+
const [data, setData] = useState([]);
|
|
14
|
+
const apiActions = useApiActions({
|
|
15
|
+
commonStoreKey: "SystemBluePrints",
|
|
16
|
+
deleteById: "api/v1/dev/blueprint",
|
|
17
|
+
save: "api/v1/dev/blueprint",
|
|
18
|
+
findById: "api/v1/dev/blueprint",
|
|
19
|
+
setData: setData,
|
|
20
|
+
});
|
|
21
|
+
|
|
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: "BLUE_PRINT_BLUE_PRINT_CODE",
|
|
93
|
+
fieldName: "bluePrintCode",
|
|
94
|
+
required: true,
|
|
95
|
+
fieldType: "text",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "field",
|
|
100
|
+
mode: "props",
|
|
101
|
+
props: {
|
|
102
|
+
fieldLabel: "BLUE_PRINT_QUERY_ID",
|
|
103
|
+
fieldName: "queryId",
|
|
104
|
+
required: true,
|
|
105
|
+
fieldType: "combobox",
|
|
106
|
+
options: SystemDataQueries,
|
|
107
|
+
optionDisplayField: "queryName",
|
|
108
|
+
optionValueField: "id",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<TemplateGrid
|
|
115
|
+
apiActions={apiActions}
|
|
116
|
+
data={data}
|
|
117
|
+
setData={setData}
|
|
118
|
+
editMode={{ editMode: "row", reloadAfterSave: true }}
|
|
119
|
+
formElements={formElements}
|
|
120
|
+
keyColumnName={"id"}
|
|
121
|
+
gridTitle={t("BLUE_PRINT_PLURAL")}
|
|
122
|
+
girdIcon="table-cells"
|
|
123
|
+
editAction={{ isEnabled: true, authority: "BLUE_PRINT_EDIT" }}
|
|
124
|
+
deleteAction={{ isEnabled: true, authority: "BLUE_PRINT_DELETE" }}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default BluePrintGrid;
|
|
@@ -0,0 +1,173 @@
|
|
|
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, useWindow } from "../../../hooks";
|
|
6
|
+
import DashboardWidgetGrid from "./DashboardWidgetGrid";
|
|
7
|
+
import { useNavigate } from "react-router-dom";
|
|
8
|
+
|
|
9
|
+
const DashboardGrid: React.FC = () => {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
12
|
+
const { Window: WidgetsWindows, setWindowState: setWidgetsWindowState } =
|
|
13
|
+
useWindow({
|
|
14
|
+
windowTitle: "Dashboard Widgets",
|
|
15
|
+
windowIcon: "chart-pie",
|
|
16
|
+
});
|
|
17
|
+
const [data, setData] = useState([]);
|
|
18
|
+
const navigate = useNavigate();
|
|
19
|
+
const apiActions = useApiActions({
|
|
20
|
+
findAll: "api/v1/dev/dashboard/all",
|
|
21
|
+
deleteById: "api/v1/dev/dashboard",
|
|
22
|
+
save: "api/v1/dev/dashboard",
|
|
23
|
+
findById: "api/v1/dev/dashboard",
|
|
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: "DASHBOARD_DASHBOARD_CODE",
|
|
98
|
+
fieldName: "dashboardCode",
|
|
99
|
+
required: true,
|
|
100
|
+
fieldType: "text",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "field",
|
|
105
|
+
mode: "props",
|
|
106
|
+
props: {
|
|
107
|
+
fieldLabel: "DASHBOARD_DASHBOARD_NAME",
|
|
108
|
+
fieldName: "dashboardName",
|
|
109
|
+
required: true,
|
|
110
|
+
fieldType: "text",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: "field",
|
|
115
|
+
mode: "props",
|
|
116
|
+
props: {
|
|
117
|
+
fieldLabel: "DASHBOARD_DASHBOARD_TITLE",
|
|
118
|
+
fieldName: "dashboardTitle",
|
|
119
|
+
required: true,
|
|
120
|
+
fieldType: "text",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: "field",
|
|
125
|
+
mode: "props",
|
|
126
|
+
props: {
|
|
127
|
+
fieldLabel: "DASHBOARD_ENABLED",
|
|
128
|
+
fieldName: "enabled",
|
|
129
|
+
required: false,
|
|
130
|
+
fieldType: "checkbox",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<>
|
|
137
|
+
<WidgetsWindows>
|
|
138
|
+
<DashboardWidgetGrid selectedRecord={selectedRecord} />
|
|
139
|
+
</WidgetsWindows>
|
|
140
|
+
<TemplateGrid
|
|
141
|
+
apiActions={apiActions}
|
|
142
|
+
data={data}
|
|
143
|
+
setData={setData}
|
|
144
|
+
editMode={{ editMode: "row" }}
|
|
145
|
+
formElements={formElements}
|
|
146
|
+
keyColumnName={"id"}
|
|
147
|
+
rowActions={[
|
|
148
|
+
{
|
|
149
|
+
label: "Widgets",
|
|
150
|
+
icon: "chart-pie",
|
|
151
|
+
actionFn: async (data) => {
|
|
152
|
+
setSelectedRecord(data);
|
|
153
|
+
setWidgetsWindowState(true);
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "View",
|
|
158
|
+
icon: "eye",
|
|
159
|
+
actionFn: async (data) => {
|
|
160
|
+
navigate("/dashboard/" + data.dashboardCode);
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
]}
|
|
164
|
+
gridTitle={t("DASHBOARD_PLURAL")}
|
|
165
|
+
girdIcon="square-poll-vertical"
|
|
166
|
+
editAction={{ isEnabled: true, authority: "DASHBOARD_EDIT" }}
|
|
167
|
+
deleteAction={{ isEnabled: true, authority: "DASHBOARD_DELETE" }}
|
|
168
|
+
/>
|
|
169
|
+
</>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default DashboardGrid;
|
|
@@ -0,0 +1,164 @@
|
|
|
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 DashboardWidgetGridProps = {
|
|
9
|
+
selectedRecord: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const DashboardWidgetGrid: React.FC<DashboardWidgetGridProps> = (props) => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const [data, setData] = useState([]);
|
|
15
|
+
const SystemWidgets = useSelector(
|
|
16
|
+
(state: any) => state.commonStores.stores.SystemWidgets.data
|
|
17
|
+
);
|
|
18
|
+
const apiActions = useApiActions({
|
|
19
|
+
findAll: "api/v1/dev/dashboardwidget/all",
|
|
20
|
+
deleteById: "api/v1/dev/dashboardwidget",
|
|
21
|
+
save: "api/v1/dev/dashboardwidget",
|
|
22
|
+
findById: "api/v1/dev/dashboardwidget",
|
|
23
|
+
setData: setData,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const formElements: Array<FormElementProps> = [
|
|
27
|
+
{
|
|
28
|
+
type: "field",
|
|
29
|
+
mode: "props",
|
|
30
|
+
props: {
|
|
31
|
+
fieldLabel: "id",
|
|
32
|
+
fieldName: "id",
|
|
33
|
+
fieldType: "number",
|
|
34
|
+
hidden: true,
|
|
35
|
+
gridProps: {
|
|
36
|
+
hidden: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: "field",
|
|
42
|
+
mode: "props",
|
|
43
|
+
props: {
|
|
44
|
+
fieldLabel: "createTime",
|
|
45
|
+
fieldName: "createTime",
|
|
46
|
+
fieldType: "datetime",
|
|
47
|
+
hidden: true,
|
|
48
|
+
gridProps: {
|
|
49
|
+
hidden: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "field",
|
|
55
|
+
mode: "props",
|
|
56
|
+
props: {
|
|
57
|
+
fieldLabel: "createdBy",
|
|
58
|
+
fieldName: "createdBy",
|
|
59
|
+
fieldType: "text",
|
|
60
|
+
hidden: true,
|
|
61
|
+
gridProps: {
|
|
62
|
+
hidden: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: "field",
|
|
68
|
+
mode: "props",
|
|
69
|
+
props: {
|
|
70
|
+
fieldLabel: "lastUpdateBy",
|
|
71
|
+
fieldName: "lastUpdateBy",
|
|
72
|
+
fieldType: "text",
|
|
73
|
+
hidden: true,
|
|
74
|
+
gridProps: {
|
|
75
|
+
hidden: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "field",
|
|
81
|
+
mode: "props",
|
|
82
|
+
props: {
|
|
83
|
+
fieldLabel: "lastUpdateTime",
|
|
84
|
+
fieldName: "lastUpdateTime",
|
|
85
|
+
fieldType: "datetime",
|
|
86
|
+
hidden: true,
|
|
87
|
+
gridProps: {
|
|
88
|
+
hidden: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "field",
|
|
94
|
+
mode: "props",
|
|
95
|
+
props: {
|
|
96
|
+
fieldLabel: "DASHBOARD_WIDGET_DASHBOARD_ID",
|
|
97
|
+
fieldName: "dashboardId",
|
|
98
|
+
required: false,
|
|
99
|
+
hidden: true,
|
|
100
|
+
gridProps: { hidden: true },
|
|
101
|
+
fieldType: "number",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: "field",
|
|
106
|
+
mode: "props",
|
|
107
|
+
props: {
|
|
108
|
+
fieldLabel: "DASHBOARD_WIDGET_WIDGET_ID",
|
|
109
|
+
fieldName: "widgetId",
|
|
110
|
+
required: true,
|
|
111
|
+
fieldType: "combobox",
|
|
112
|
+
options: SystemWidgets,
|
|
113
|
+
optionValueField: "id",
|
|
114
|
+
optionDisplayField: "widgetName",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "field",
|
|
119
|
+
mode: "props",
|
|
120
|
+
props: {
|
|
121
|
+
fieldLabel: "DASHBOARD_WIDGET_WIDGET_ORDER",
|
|
122
|
+
fieldName: "widgetOrder",
|
|
123
|
+
required: false,
|
|
124
|
+
fieldType: "number",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "field",
|
|
129
|
+
mode: "props",
|
|
130
|
+
props: {
|
|
131
|
+
fieldLabel: "DASHBOARD_WIDGET_ENABLED",
|
|
132
|
+
fieldName: "enabled",
|
|
133
|
+
required: false,
|
|
134
|
+
fieldType: "checkbox",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<TemplateGrid
|
|
141
|
+
apiActions={apiActions}
|
|
142
|
+
data={data}
|
|
143
|
+
setData={setData}
|
|
144
|
+
editMode={{ editMode: "row" }}
|
|
145
|
+
hideInfoBar={true}
|
|
146
|
+
formElements={formElements}
|
|
147
|
+
gridLoadParametersValues={{ dashboardId: props.selectedRecord.id }}
|
|
148
|
+
keyColumnName={"id"}
|
|
149
|
+
gridTitle={t("DASHBOARD_WIDGET_PLURAL")}
|
|
150
|
+
girdIcon="table-cells"
|
|
151
|
+
editAction={{
|
|
152
|
+
isEnabled: true,
|
|
153
|
+
authority: "DASHBOARD_WIDGET_EDIT",
|
|
154
|
+
preActionValidation: async (data) => {
|
|
155
|
+
data.dashboardId = props.selectedRecord.id;
|
|
156
|
+
return true;
|
|
157
|
+
},
|
|
158
|
+
}}
|
|
159
|
+
deleteAction={{ isEnabled: true, authority: "DASHBOARD_WIDGET_DELETE" }}
|
|
160
|
+
/>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export default DashboardWidgetGrid;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid";
|
|
3
|
+
import { useApiActions, useWindow } from "../../../hooks";
|
|
4
|
+
import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useSelector } from "react-redux";
|
|
7
|
+
import DataQueryParametersForm from "./DataQueryParametersForm";
|
|
8
|
+
import DataQueryParameterGrid from "./DataQueryParameterGrid";
|
|
9
|
+
|
|
10
|
+
const DataQueryGrid: React.FC = () => {
|
|
11
|
+
const [selectedRecord, setSelectedRecord] = useState<any>(null);
|
|
12
|
+
const {
|
|
13
|
+
Window: DataQueryParameterWindow,
|
|
14
|
+
setWindowState: setDataQueryParameterWindow,
|
|
15
|
+
} = useWindow({
|
|
16
|
+
width: "50%",
|
|
17
|
+
windowTitle: "Data query parameters",
|
|
18
|
+
windowIcon: "p",
|
|
19
|
+
});
|
|
20
|
+
const SystemDataSources = useSelector(
|
|
21
|
+
(state: any) => state.commonStores.stores.SystemDataSources.data
|
|
22
|
+
);
|
|
23
|
+
const { t } = useTranslation();
|
|
24
|
+
const [data, setData] = useState([]);
|
|
25
|
+
const apiActions = useApiActions({
|
|
26
|
+
commonStoreKey: "SystemDataQueries",
|
|
27
|
+
deleteById: "api/v1/dev/dataquery",
|
|
28
|
+
save: "api/v1/dev/dataquery",
|
|
29
|
+
findById: "api/v1/dev/dataquery",
|
|
30
|
+
setData: setData,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const formElements: Array<FormElementProps> = [
|
|
34
|
+
{
|
|
35
|
+
type: "field",
|
|
36
|
+
mode: "props",
|
|
37
|
+
props: {
|
|
38
|
+
fieldLabel: "id",
|
|
39
|
+
fieldName: "id",
|
|
40
|
+
fieldType: "number",
|
|
41
|
+
hidden: true,
|
|
42
|
+
gridProps: {
|
|
43
|
+
hidden: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "field",
|
|
49
|
+
mode: "props",
|
|
50
|
+
props: {
|
|
51
|
+
fieldLabel: "createTime",
|
|
52
|
+
fieldName: "createTime",
|
|
53
|
+
fieldType: "datetime",
|
|
54
|
+
hidden: true,
|
|
55
|
+
gridProps: {
|
|
56
|
+
hidden: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "field",
|
|
62
|
+
mode: "props",
|
|
63
|
+
props: {
|
|
64
|
+
fieldLabel: "createdBy",
|
|
65
|
+
fieldName: "createdBy",
|
|
66
|
+
fieldType: "text",
|
|
67
|
+
hidden: true,
|
|
68
|
+
gridProps: {
|
|
69
|
+
hidden: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: "field",
|
|
75
|
+
mode: "props",
|
|
76
|
+
props: {
|
|
77
|
+
fieldLabel: "lastUpdateBy",
|
|
78
|
+
fieldName: "lastUpdateBy",
|
|
79
|
+
fieldType: "text",
|
|
80
|
+
hidden: true,
|
|
81
|
+
gridProps: {
|
|
82
|
+
hidden: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: "field",
|
|
88
|
+
mode: "props",
|
|
89
|
+
props: {
|
|
90
|
+
fieldLabel: "lastUpdateTime",
|
|
91
|
+
fieldName: "lastUpdateTime",
|
|
92
|
+
fieldType: "datetime",
|
|
93
|
+
hidden: true,
|
|
94
|
+
gridProps: {
|
|
95
|
+
hidden: true,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "field",
|
|
101
|
+
mode: "props",
|
|
102
|
+
props: {
|
|
103
|
+
fieldLabel: "DATA_QUERY_QUERY_NAME",
|
|
104
|
+
fieldName: "queryName",
|
|
105
|
+
required: false,
|
|
106
|
+
fieldType: "text",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: "field",
|
|
111
|
+
mode: "props",
|
|
112
|
+
props: {
|
|
113
|
+
fieldLabel: "DATA_QUERY_USE_SYS_CON",
|
|
114
|
+
fieldName: "useSysCon",
|
|
115
|
+
required: false,
|
|
116
|
+
fieldType: "checkbox",
|
|
117
|
+
formProps: {
|
|
118
|
+
onValueChangeCallBack(
|
|
119
|
+
value,
|
|
120
|
+
formManager,
|
|
121
|
+
formActions,
|
|
122
|
+
selectedRecord
|
|
123
|
+
) {
|
|
124
|
+
if (value) {
|
|
125
|
+
formActions.hideField("datasourceConId");
|
|
126
|
+
formManager.setValue("datasourceConId", null);
|
|
127
|
+
} else {
|
|
128
|
+
formActions.showField("datasourceConId");
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "field",
|
|
136
|
+
mode: "props",
|
|
137
|
+
props: {
|
|
138
|
+
fieldLabel: "DATA_QUERY_DATASOURCE_CON_ID",
|
|
139
|
+
fieldName: "datasourceConId",
|
|
140
|
+
required: false,
|
|
141
|
+
options: SystemDataSources,
|
|
142
|
+
optionDisplayField: "connectionName",
|
|
143
|
+
optionValueField: "id",
|
|
144
|
+
fieldType: "combobox",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
{
|
|
149
|
+
type: "field",
|
|
150
|
+
mode: "props",
|
|
151
|
+
props: {
|
|
152
|
+
fieldLabel: "DATA_QUERY_QUERY_STR",
|
|
153
|
+
fieldName: "queryStr",
|
|
154
|
+
formProps: { fieldHeight: 400 },
|
|
155
|
+
gridProps: {
|
|
156
|
+
hidden: true,
|
|
157
|
+
},
|
|
158
|
+
muiTextFieldProps: {
|
|
159
|
+
multiline: true,
|
|
160
|
+
rows: 4,
|
|
161
|
+
},
|
|
162
|
+
required: false,
|
|
163
|
+
fieldType: "text",
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<>
|
|
170
|
+
<DataQueryParameterWindow>
|
|
171
|
+
<DataQueryParameterGrid selectedRecord={selectedRecord} />
|
|
172
|
+
</DataQueryParameterWindow>
|
|
173
|
+
<TemplateGrid
|
|
174
|
+
apiActions={apiActions}
|
|
175
|
+
rowActions={[
|
|
176
|
+
{
|
|
177
|
+
label: "Query Parameters",
|
|
178
|
+
actionFn: async (data) => {
|
|
179
|
+
setSelectedRecord(data);
|
|
180
|
+
setDataQueryParameterWindow(true);
|
|
181
|
+
},
|
|
182
|
+
icon: "p",
|
|
183
|
+
},
|
|
184
|
+
]}
|
|
185
|
+
data={data}
|
|
186
|
+
setData={setData}
|
|
187
|
+
editMode={{
|
|
188
|
+
editMode: "modal",
|
|
189
|
+
specs: {
|
|
190
|
+
modalTitle: "System Query",
|
|
191
|
+
modalWidth: 600,
|
|
192
|
+
modalIcon: "file-code",
|
|
193
|
+
},
|
|
194
|
+
}}
|
|
195
|
+
formElements={formElements}
|
|
196
|
+
keyColumnName={"id"}
|
|
197
|
+
gridTitle={t("DATA_QUERY_PLURAL")}
|
|
198
|
+
girdIcon="table-cells"
|
|
199
|
+
editAction={{ isEnabled: true, authority: "DATA_QUERY_EDIT" }}
|
|
200
|
+
deleteAction={{ isEnabled: true, authority: "DATA_QUERY_DELETE" }}
|
|
201
|
+
/>
|
|
202
|
+
</>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export default DataQueryGrid;
|