@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
package/src/layout/TopBar.tsx
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
Box,
|
|
4
|
+
IconButton,
|
|
5
|
+
styled,
|
|
6
|
+
Tooltip,
|
|
7
|
+
Typography,
|
|
8
|
+
} from "@mui/material";
|
|
2
9
|
import MuiAppBar, { AppBarProps as MuiAppBarProps } from "@mui/material/AppBar";
|
|
3
10
|
import Toolbar from "@mui/material/Toolbar";
|
|
4
11
|
import { useDispatch, useSelector } from "react-redux";
|
|
5
12
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
-
import { RootState } from "../redux/store";
|
|
7
13
|
import { useIsMobile } from "../hooks/UseMobile";
|
|
8
14
|
import {
|
|
9
15
|
AppLayoutActions,
|
|
@@ -12,6 +18,9 @@ import {
|
|
|
12
18
|
import useAxios from "../hooks/useAxios";
|
|
13
19
|
import { UserSessionActions } from "../redux/features/common/UserSessionSlice";
|
|
14
20
|
import i18n, { changeLanguage } from "../locales/i18n";
|
|
21
|
+
import { useSession, useWindow } from "../hooks";
|
|
22
|
+
import ChangeOrgForm from "../components/common/ChangeOrgForm";
|
|
23
|
+
import { toggleSideBarState } from "../redux/features/common/SideBarSlice";
|
|
15
24
|
|
|
16
25
|
interface AppBarProps extends MuiAppBarProps {
|
|
17
26
|
open?: boolean;
|
|
@@ -20,7 +29,7 @@ interface AppBarProps extends MuiAppBarProps {
|
|
|
20
29
|
const AppBar = styled(MuiAppBar, {
|
|
21
30
|
shouldForwardProp: (prop) => prop !== "open",
|
|
22
31
|
})<AppBarProps>(({ theme }) => {
|
|
23
|
-
const AppLayout = useSelector((state:
|
|
32
|
+
const AppLayout = useSelector((state: any) => state.AppLayout);
|
|
24
33
|
const isMobile = useIsMobile();
|
|
25
34
|
return {
|
|
26
35
|
transition: theme.transitions.create(["margin", "width"], {
|
|
@@ -51,9 +60,18 @@ const AppBar = styled(MuiAppBar, {
|
|
|
51
60
|
});
|
|
52
61
|
|
|
53
62
|
const TopBar: React.FC = () => {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
const { Window: ChangeOrgWindow, setWindowState: setChangeOrgWindowState } =
|
|
64
|
+
useWindow({
|
|
65
|
+
windowTitle: "Change Current Organization",
|
|
66
|
+
windowIcon: "globe",
|
|
67
|
+
width: "fit-content",
|
|
68
|
+
height: "fit-content",
|
|
69
|
+
});
|
|
70
|
+
const AppInfo = useSelector((state: any) => state.AppInfo.value);
|
|
71
|
+
const AppLayout = useSelector((state: any) => state.AppLayout);
|
|
72
|
+
const SideBarState = useSelector((state: any) => state.SideBar);
|
|
73
|
+
const { UserSession } = useSession();
|
|
74
|
+
const currentOrganization = UserSession.value.currentOrganization;
|
|
57
75
|
const { handleGetRequest } = useAxios();
|
|
58
76
|
const isMobile = useIsMobile();
|
|
59
77
|
const dispatch = useDispatch();
|
|
@@ -66,76 +84,126 @@ const TopBar: React.FC = () => {
|
|
|
66
84
|
dispatch(UserSessionActions.setUnAuthenticated());
|
|
67
85
|
};
|
|
68
86
|
const toggleSideBar = () => {
|
|
69
|
-
dispatch(
|
|
87
|
+
dispatch(toggleSideBarState());
|
|
70
88
|
};
|
|
71
89
|
return (
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onClick={toggleSideBar}
|
|
78
|
-
edge="start"
|
|
79
|
-
sx={[
|
|
80
|
-
{
|
|
81
|
-
mr: AppLayout.appDirection === "ltr" ? 2 : undefined,
|
|
82
|
-
ml: AppLayout.appDirection === "rtl" ? 2 : undefined,
|
|
83
|
-
},
|
|
84
|
-
AppLayout.sideBarOpened && { display: "none" },
|
|
85
|
-
]}
|
|
86
|
-
>
|
|
87
|
-
<FontAwesomeIcon icon="bars" />
|
|
88
|
-
</IconButton>
|
|
89
|
-
<Avatar src={AppInfo.appLogo} sx={{ marginRight: 1, marginLeft: 1 }} />
|
|
90
|
-
<Typography variant="h6" noWrap component="div" sx={{ flex: 1 }}>
|
|
91
|
-
{isMobile ? "" : AppInfo.appName}
|
|
92
|
-
</Typography>
|
|
93
|
-
<IconButton
|
|
94
|
-
color="inherit"
|
|
95
|
-
onClick={() => {
|
|
96
|
-
dispatch(
|
|
97
|
-
AppLayoutActions.setThemeMode(
|
|
98
|
-
AppLayout.themeMode === "light" ? "dark" : "light"
|
|
99
|
-
)
|
|
100
|
-
);
|
|
101
|
-
localStorage.setItem(
|
|
102
|
-
"themeMode",
|
|
103
|
-
AppLayout.themeMode === "light" ? "dark" : "light"
|
|
104
|
-
);
|
|
90
|
+
<>
|
|
91
|
+
<ChangeOrgWindow>
|
|
92
|
+
<ChangeOrgForm
|
|
93
|
+
successChangeCallBackFn={() => {
|
|
94
|
+
setChangeOrgWindowState(false);
|
|
105
95
|
}}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
/>
|
|
97
|
+
</ChangeOrgWindow>
|
|
98
|
+
<AppBar position="fixed" open={SideBarState.isOpened}>
|
|
99
|
+
<Toolbar>
|
|
100
|
+
<IconButton
|
|
101
|
+
color="inherit"
|
|
102
|
+
aria-label="open drawer"
|
|
103
|
+
onClick={toggleSideBar}
|
|
104
|
+
edge="start"
|
|
105
|
+
sx={[
|
|
106
|
+
{
|
|
107
|
+
mr: AppLayout.appDirection === "ltr" ? 2 : undefined,
|
|
108
|
+
ml: AppLayout.appDirection === "rtl" ? 2 : undefined,
|
|
109
|
+
},
|
|
110
|
+
SideBarState.isOpened && { display: "none" },
|
|
111
|
+
]}
|
|
112
|
+
>
|
|
113
|
+
<FontAwesomeIcon icon="bars" />
|
|
114
|
+
</IconButton>
|
|
115
|
+
<Avatar
|
|
116
|
+
src={AppInfo.appLogo}
|
|
117
|
+
sx={{ marginRight: 1, marginLeft: 1 }}
|
|
118
|
+
/>
|
|
119
|
+
<Typography variant="h6" noWrap component="div" sx={{ flex: 1 }}>
|
|
120
|
+
{isMobile
|
|
121
|
+
? ""
|
|
122
|
+
: `${AppInfo.appName} - ${
|
|
123
|
+
AppLayout.appDirection === "ltr"
|
|
124
|
+
? currentOrganization?.organizationEnName
|
|
125
|
+
: currentOrganization?.organizationArName
|
|
126
|
+
}`}
|
|
127
|
+
</Typography>
|
|
128
|
+
<Tooltip
|
|
129
|
+
title={
|
|
130
|
+
AppLayout.themeMode === "light"
|
|
131
|
+
? "Switch Theme to Dark"
|
|
132
|
+
: "Switch Theme to Light"
|
|
133
|
+
}
|
|
134
|
+
>
|
|
135
|
+
<IconButton
|
|
136
|
+
color="inherit"
|
|
137
|
+
onClick={() => {
|
|
138
|
+
dispatch(
|
|
139
|
+
AppLayoutActions.setThemeMode(
|
|
140
|
+
AppLayout.themeMode === "light" ? "dark" : "light"
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
localStorage.setItem(
|
|
144
|
+
"themeMode",
|
|
145
|
+
AppLayout.themeMode === "light" ? "dark" : "light"
|
|
146
|
+
);
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
{AppLayout.themeMode === "light" ? (
|
|
150
|
+
<FontAwesomeIcon icon="moon" />
|
|
151
|
+
) : (
|
|
152
|
+
<FontAwesomeIcon icon={{ prefix: "far", iconName: "sun" }} />
|
|
153
|
+
)}
|
|
154
|
+
</IconButton>
|
|
155
|
+
</Tooltip>
|
|
156
|
+
<Tooltip
|
|
157
|
+
title={
|
|
158
|
+
i18n.language === "ar"
|
|
159
|
+
? "Change Language To English"
|
|
160
|
+
: "Change Language To Arabic"
|
|
161
|
+
}
|
|
162
|
+
>
|
|
163
|
+
<IconButton
|
|
164
|
+
color="inherit"
|
|
165
|
+
onClick={() => {
|
|
166
|
+
let nextLanguage = i18n.language === "ar" ? "en" : "ar";
|
|
167
|
+
changeLanguage(nextLanguage);
|
|
168
|
+
dispatch(
|
|
169
|
+
AppLayoutActions.setAppDirection(
|
|
170
|
+
nextLanguage === "ar" ? "rtl" : "ltr"
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<FontAwesomeIcon icon="language" />
|
|
176
|
+
</IconButton>
|
|
177
|
+
</Tooltip>
|
|
178
|
+
{UserSession.value?.userOrganizations &&
|
|
179
|
+
UserSession.value?.userOrganizations.length > 1 ? (
|
|
180
|
+
<Tooltip title="Change Current Organization">
|
|
181
|
+
<IconButton
|
|
182
|
+
color="inherit"
|
|
183
|
+
onClick={() => {
|
|
184
|
+
setChangeOrgWindowState(true);
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
<FontAwesomeIcon icon="globe" />
|
|
188
|
+
</IconButton>
|
|
189
|
+
</Tooltip>
|
|
109
190
|
) : (
|
|
110
|
-
|
|
191
|
+
<></>
|
|
111
192
|
)}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</IconButton>
|
|
127
|
-
<Avatar />
|
|
128
|
-
<div style={{ marginLeft: 5, marginRight: 5 }}>
|
|
129
|
-
{isMobile ? "" : UserSession.value?.userProfile?.username}
|
|
130
|
-
</div>
|
|
131
|
-
<IconButton color="inherit" onClick={handleLogout}>
|
|
132
|
-
<FontAwesomeIcon
|
|
133
|
-
rotation={AppLayout.appDirection === "rtl" ? 180 : undefined}
|
|
134
|
-
icon="arrow-right-from-bracket"
|
|
135
|
-
/>
|
|
136
|
-
</IconButton>
|
|
137
|
-
</Toolbar>
|
|
138
|
-
</AppBar>
|
|
193
|
+
|
|
194
|
+
<Avatar />
|
|
195
|
+
<div style={{ marginLeft: 5, marginRight: 5 }}>
|
|
196
|
+
{isMobile ? "" : UserSession.value?.username}
|
|
197
|
+
</div>
|
|
198
|
+
<IconButton color="inherit" onClick={handleLogout}>
|
|
199
|
+
<FontAwesomeIcon
|
|
200
|
+
rotation={AppLayout.appDirection === "rtl" ? 180 : undefined}
|
|
201
|
+
icon="arrow-right-from-bracket"
|
|
202
|
+
/>
|
|
203
|
+
</IconButton>
|
|
204
|
+
</Toolbar>
|
|
205
|
+
</AppBar>
|
|
206
|
+
</>
|
|
139
207
|
);
|
|
140
208
|
};
|
|
141
209
|
|