wcz-layout 6.7.2 → 7.6.1

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.

Potentially problematic release.


This version of wcz-layout might be problematic. Click here for more details.

Files changed (303) hide show
  1. package/dist/DialogsContext-BIhId-r8.js +7 -0
  2. package/dist/DialogsContext-BIhId-r8.js.map +1 -0
  3. package/dist/DialogsHooks-CZVdKmPv.js +207 -0
  4. package/dist/DialogsHooks-CZVdKmPv.js.map +1 -0
  5. package/dist/FileMeta-YGG9mxo_.js +36 -0
  6. package/dist/FileMeta-YGG9mxo_.js.map +1 -0
  7. package/dist/NotificationContext-DovR_auQ.js +7 -0
  8. package/dist/NotificationContext-DovR_auQ.js.map +1 -0
  9. package/dist/RouterListItemButton-DeaQB4ym.js +31 -0
  10. package/dist/RouterListItemButton-DeaQB4ym.js.map +1 -0
  11. package/dist/components/core/AppTitle.d.ts +2 -0
  12. package/dist/components/core/Fullscreen.d.ts +3 -0
  13. package/dist/components/core/Layout.d.ts +10 -0
  14. package/dist/{src/components/layout → components/core}/TypographyWithIcon.d.ts +1 -1
  15. package/dist/components/core/account/UserAvatar.d.ts +2 -0
  16. package/dist/components/core/account/UserMenu.d.ts +2 -0
  17. package/dist/components/core/navigation/NavigationContent.d.ts +11 -0
  18. package/dist/components/core/navigation/NavigationList.d.ts +22 -0
  19. package/dist/components/core/navigation/NavigationListItem.d.ts +16 -0
  20. package/dist/components/core/navigation/NavigationRail.d.ts +12 -0
  21. package/dist/{src/components/dataGrid → components/data-grid}/ChipInputCell.d.ts +3 -3
  22. package/dist/components/data-grid/EditableColumnHeader.d.ts +2 -0
  23. package/dist/components/file/Dropzone.d.ts +8 -0
  24. package/dist/components/file/FileViewer.d.ts +20 -0
  25. package/dist/components/file/fileViewer/FileViewerGrid.d.ts +17 -0
  26. package/dist/components/file/fileViewer/FileViewerList.d.ts +12 -0
  27. package/dist/components/file/fileViewer/ImageViewer.d.ts +6 -0
  28. package/dist/components/file/fileViewer/common/ActionsMenu.d.ts +15 -0
  29. package/dist/{src/components → components}/form/FormAutocomplete.d.ts +3 -3
  30. package/dist/{src/components → components}/form/FormCheckbox.d.ts +3 -3
  31. package/dist/components/form/FormDatePicker.d.ts +8 -0
  32. package/dist/components/form/FormDateRangePicker.d.ts +8 -0
  33. package/dist/components/form/FormDateTimePicker.d.ts +8 -0
  34. package/dist/components/form/FormDateTimeRangePicker.d.ts +8 -0
  35. package/dist/{src/components → components}/form/FormNumberField.d.ts +4 -7
  36. package/dist/{src/components → components}/form/FormRadioGroup.d.ts +4 -4
  37. package/dist/{src/components → components}/form/FormSlider.d.ts +3 -3
  38. package/dist/components/form/FormSubmitButton.d.ts +4 -0
  39. package/dist/{src/components → components}/form/FormSwitch.d.ts +3 -3
  40. package/dist/{src/components → components}/form/FormTextField.d.ts +3 -3
  41. package/dist/components/form/FormTimePicker.d.ts +8 -0
  42. package/dist/components/form/FormTimeRangePicker.d.ts +8 -0
  43. package/dist/components/router/RouterButton.d.ts +6 -0
  44. package/dist/components/router/RouterError.d.ts +7 -0
  45. package/dist/components/router/RouterFab.d.ts +6 -0
  46. package/dist/components/router/RouterGridActionsCellItem.d.ts +6 -0
  47. package/dist/components/router/RouterIconButton.d.ts +6 -0
  48. package/dist/components/router/RouterLink.d.ts +6 -0
  49. package/dist/components/router/RouterListItemButton.d.ts +6 -0
  50. package/dist/components/router/RouterNotFound.d.ts +1 -0
  51. package/dist/components/router/RouterTab.d.ts +6 -0
  52. package/dist/components.js +3255 -0
  53. package/dist/components.js.map +1 -0
  54. package/dist/contexts/DialogsContext.d.ts +6 -0
  55. package/dist/contexts/FileContext.d.ts +13 -0
  56. package/dist/contexts/NotificationContext.d.ts +9 -0
  57. package/dist/dist-Bxzg1_9c.js +152 -0
  58. package/dist/dist-Bxzg1_9c.js.map +1 -0
  59. package/dist/exports/components.d.ts +15 -0
  60. package/dist/exports/hooks.d.ts +7 -0
  61. package/dist/exports/index.d.ts +5 -0
  62. package/dist/exports/middleware.d.ts +2 -0
  63. package/dist/exports/models.d.ts +24 -0
  64. package/dist/exports/query.d.ts +3 -0
  65. package/dist/exports/utils.d.ts +6 -0
  66. package/dist/exports/vite.d.ts +1 -0
  67. package/dist/hooks/DialogsHooks.d.ts +42 -0
  68. package/dist/hooks/FormHooks.d.ts +52 -0
  69. package/dist/hooks/UseNotification.d.ts +1 -0
  70. package/dist/hooks/UseScanDetection.d.ts +28 -0
  71. package/dist/hooks.js +1075 -0
  72. package/dist/hooks.js.map +1 -0
  73. package/dist/index.js +1105 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/lib/auth/msalClient.d.ts +19 -0
  76. package/dist/lib/auth/msalServer.d.ts +11 -0
  77. package/dist/lib/auth/permissions.d.ts +4 -0
  78. package/dist/lib/auth/scopes.d.ts +4 -0
  79. package/dist/lib/db/collections/userCollection.d.ts +18 -0
  80. package/dist/lib/queryClient.d.ts +2 -0
  81. package/dist/lib/theme.d.ts +1 -0
  82. package/dist/lib/utils.d.ts +63 -0
  83. package/dist/lib/vite-plugin.d.ts +2 -0
  84. package/dist/middleware/authMiddleware.d.ts +22 -0
  85. package/dist/middleware/validationMiddleware.d.ts +4 -0
  86. package/dist/middleware.js +1051 -0
  87. package/dist/middleware.js.map +1 -0
  88. package/dist/models/LayoutOptions.d.ts +7 -0
  89. package/dist/models/Navigation.d.ts +18 -0
  90. package/dist/models/TokenPayload.d.ts +9 -0
  91. package/dist/models/User.d.ts +10 -0
  92. package/dist/models/VaultConfig.d.ts +9 -0
  93. package/dist/models/approval/Approval.d.ts +177 -0
  94. package/dist/models/approval/ApprovalEmployee.d.ts +7 -0
  95. package/dist/models/approval/ApprovalFlow.d.ts +49 -0
  96. package/dist/models/approval/ApprovalFlowStep.d.ts +29 -0
  97. package/dist/models/approval/ApprovalRequestType.d.ts +5 -0
  98. package/dist/models/approval/ApprovalStatus.d.ts +9 -0
  99. package/dist/models/approval/ApprovalStepResult.d.ts +11 -0
  100. package/dist/models/approval/StepApprovalOrder.d.ts +6 -0
  101. package/dist/models/email/Email.d.ts +13 -0
  102. package/dist/models/email/EmailAttachment.d.ts +6 -0
  103. package/dist/models/file/FileActions.d.ts +6 -0
  104. package/dist/models/file/FileMeta.d.ts +15 -0
  105. package/dist/models/peoplesoft/Department.d.ts +58 -0
  106. package/dist/models/peoplesoft/Employee.d.ts +46 -0
  107. package/dist/models/peoplesoft/EmployeeCategoryGroup.d.ts +6 -0
  108. package/dist/models/peoplesoft/EmployeeStatus.d.ts +6 -0
  109. package/dist/models.js +150 -0
  110. package/dist/models.js.map +1 -0
  111. package/dist/providers/DialogsProvider.d.ts +5 -0
  112. package/dist/providers/LayoutProvider.d.ts +12 -0
  113. package/dist/providers/MsalAuthProvider.d.ts +6 -0
  114. package/dist/providers/NotificationProvider.d.ts +7 -0
  115. package/dist/queries/ApprovalQueries.d.ts +661 -0
  116. package/dist/queries/FileQueries.d.ts +205 -0
  117. package/dist/queries/PeopleSoftQueries.d.ts +2173 -0
  118. package/dist/queries/index.d.ts +2958 -0
  119. package/dist/queries-D-DV5lCw.js +2941 -0
  120. package/dist/queries-D-DV5lCw.js.map +1 -0
  121. package/dist/query.js +3 -0
  122. package/dist/queryClient-B__OEZ70.js +7 -0
  123. package/dist/queryClient-B__OEZ70.js.map +1 -0
  124. package/dist/utils-C4oJ0tr5.js +157 -0
  125. package/dist/utils-C4oJ0tr5.js.map +1 -0
  126. package/dist/utils.js +35 -0
  127. package/dist/utils.js.map +1 -0
  128. package/dist/vite.js +110 -0
  129. package/dist/vite.js.map +1 -0
  130. package/package.json +132 -62
  131. package/dist/src/components/Layout.d.ts +0 -16
  132. package/dist/src/components/Layout.js +0 -122
  133. package/dist/src/components/Layout.js.map +0 -1
  134. package/dist/src/components/dataGrid/ChipInputCell.js +0 -17
  135. package/dist/src/components/dataGrid/ChipInputCell.js.map +0 -1
  136. package/dist/src/components/dataGrid/EditableColumnHeader.d.ts +0 -2
  137. package/dist/src/components/dataGrid/EditableColumnHeader.js +0 -7
  138. package/dist/src/components/dataGrid/EditableColumnHeader.js.map +0 -1
  139. package/dist/src/components/dataGrid/GridToolbar.d.ts +0 -8
  140. package/dist/src/components/dataGrid/GridToolbar.js +0 -40
  141. package/dist/src/components/dataGrid/GridToolbar.js.map +0 -1
  142. package/dist/src/components/dataGrid/TableContainer.d.ts +0 -3
  143. package/dist/src/components/dataGrid/TableContainer.js +0 -32
  144. package/dist/src/components/dataGrid/TableContainer.js.map +0 -1
  145. package/dist/src/components/form/FormAutocomplete.js +0 -10
  146. package/dist/src/components/form/FormAutocomplete.js.map +0 -1
  147. package/dist/src/components/form/FormCheckbox.js +0 -11
  148. package/dist/src/components/form/FormCheckbox.js.map +0 -1
  149. package/dist/src/components/form/FormDatePicker.d.ts +0 -9
  150. package/dist/src/components/form/FormDatePicker.js +0 -19
  151. package/dist/src/components/form/FormDatePicker.js.map +0 -1
  152. package/dist/src/components/form/FormDateTimePicker.d.ts +0 -9
  153. package/dist/src/components/form/FormDateTimePicker.js +0 -19
  154. package/dist/src/components/form/FormDateTimePicker.js.map +0 -1
  155. package/dist/src/components/form/FormNumberField.js +0 -12
  156. package/dist/src/components/form/FormNumberField.js.map +0 -1
  157. package/dist/src/components/form/FormRadioGroup.js +0 -11
  158. package/dist/src/components/form/FormRadioGroup.js.map +0 -1
  159. package/dist/src/components/form/FormSlider.js +0 -11
  160. package/dist/src/components/form/FormSlider.js.map +0 -1
  161. package/dist/src/components/form/FormSubmitButton.d.ts +0 -5
  162. package/dist/src/components/form/FormSubmitButton.js +0 -13
  163. package/dist/src/components/form/FormSubmitButton.js.map +0 -1
  164. package/dist/src/components/form/FormSwitch.js +0 -11
  165. package/dist/src/components/form/FormSwitch.js.map +0 -1
  166. package/dist/src/components/form/FormTextField.js +0 -11
  167. package/dist/src/components/form/FormTextField.js.map +0 -1
  168. package/dist/src/components/layout/AccountMenu.d.ts +0 -9
  169. package/dist/src/components/layout/AccountMenu.js +0 -44
  170. package/dist/src/components/layout/AccountMenu.js.map +0 -1
  171. package/dist/src/components/layout/DevelopmentBanner.d.ts +0 -7
  172. package/dist/src/components/layout/DevelopmentBanner.js +0 -29
  173. package/dist/src/components/layout/DevelopmentBanner.js.map +0 -1
  174. package/dist/src/components/layout/ErrorPage.d.ts +0 -2
  175. package/dist/src/components/layout/ErrorPage.js +0 -25
  176. package/dist/src/components/layout/ErrorPage.js.map +0 -1
  177. package/dist/src/components/layout/LayoutDialog.d.ts +0 -12
  178. package/dist/src/components/layout/LayoutDialog.js +0 -12
  179. package/dist/src/components/layout/LayoutDialog.js.map +0 -1
  180. package/dist/src/components/layout/LayoutSnackbar.d.ts +0 -8
  181. package/dist/src/components/layout/LayoutSnackbar.js +0 -25
  182. package/dist/src/components/layout/LayoutSnackbar.js.map +0 -1
  183. package/dist/src/components/layout/NavigationDrawer.d.ts +0 -11
  184. package/dist/src/components/layout/NavigationDrawer.js +0 -70
  185. package/dist/src/components/layout/NavigationDrawer.js.map +0 -1
  186. package/dist/src/components/layout/NotificationMenu.d.ts +0 -8
  187. package/dist/src/components/layout/NotificationMenu.js +0 -26
  188. package/dist/src/components/layout/NotificationMenu.js.map +0 -1
  189. package/dist/src/components/layout/TypographyWithIcon.js +0 -22
  190. package/dist/src/components/layout/TypographyWithIcon.js.map +0 -1
  191. package/dist/src/components/layout/Unauthorized.d.ts +0 -2
  192. package/dist/src/components/layout/Unauthorized.js +0 -26
  193. package/dist/src/components/layout/Unauthorized.js.map +0 -1
  194. package/dist/src/contexts/LayoutContext.d.ts +0 -40
  195. package/dist/src/contexts/LayoutContext.js +0 -60
  196. package/dist/src/contexts/LayoutContext.js.map +0 -1
  197. package/dist/src/contexts/UserContext.d.ts +0 -24
  198. package/dist/src/contexts/UserContext.js +0 -55
  199. package/dist/src/contexts/UserContext.js.map +0 -1
  200. package/dist/src/hooks/FormHooks.d.ts +0 -46
  201. package/dist/src/hooks/FormHooks.js +0 -31
  202. package/dist/src/hooks/FormHooks.js.map +0 -1
  203. package/dist/src/hooks/UseSnackbar.d.ts +0 -10
  204. package/dist/src/hooks/UseSnackbar.js +0 -23
  205. package/dist/src/hooks/UseSnackbar.js.map +0 -1
  206. package/dist/src/hooks/UseUser.d.ts +0 -10
  207. package/dist/src/hooks/UseUser.js +0 -25
  208. package/dist/src/hooks/UseUser.js.map +0 -1
  209. package/dist/src/index.d.ts +0 -20
  210. package/dist/src/index.js +0 -15
  211. package/dist/src/index.js.map +0 -1
  212. package/dist/src/models/Error.d.ts +0 -6
  213. package/dist/src/models/Error.js +0 -2
  214. package/dist/src/models/Error.js.map +0 -1
  215. package/dist/src/models/KeycloakSettings.d.ts +0 -8
  216. package/dist/src/models/KeycloakSettings.js +0 -2
  217. package/dist/src/models/KeycloakSettings.js.map +0 -1
  218. package/dist/src/models/LayoutPaletteColorOptions.d.ts +0 -6
  219. package/dist/src/models/LayoutPaletteColorOptions.js +0 -2
  220. package/dist/src/models/LayoutPaletteColorOptions.js.map +0 -1
  221. package/dist/src/models/LayoutRoute.d.ts +0 -14
  222. package/dist/src/models/LayoutRoute.js +0 -2
  223. package/dist/src/models/LayoutRoute.js.map +0 -1
  224. package/dist/src/models/Notification.d.ts +0 -9
  225. package/dist/src/models/Notification.js +0 -2
  226. package/dist/src/models/Notification.js.map +0 -1
  227. package/dist/src/models/PeoplesoftDepartment.d.ts +0 -14
  228. package/dist/src/models/PeoplesoftDepartment.js +0 -2
  229. package/dist/src/models/PeoplesoftDepartment.js.map +0 -1
  230. package/dist/src/models/PeoplesoftEmployee.d.ts +0 -34
  231. package/dist/src/models/PeoplesoftEmployee.js +0 -2
  232. package/dist/src/models/PeoplesoftEmployee.js.map +0 -1
  233. package/dist/src/models/Snackbar.d.ts +0 -15
  234. package/dist/src/models/Snackbar.js +0 -2
  235. package/dist/src/models/Snackbar.js.map +0 -1
  236. package/dist/src/models/User.d.ts +0 -27
  237. package/dist/src/models/User.js +0 -11
  238. package/dist/src/models/User.js.map +0 -1
  239. package/dist/src/models/types/EmployeeCategoryGroup.d.ts +0 -1
  240. package/dist/src/models/types/EmployeeCategoryGroup.js +0 -2
  241. package/dist/src/models/types/EmployeeCategoryGroup.js.map +0 -1
  242. package/dist/src/models/types/EmployeeStatus.d.ts +0 -1
  243. package/dist/src/models/types/EmployeeStatus.js +0 -2
  244. package/dist/src/models/types/EmployeeStatus.js.map +0 -1
  245. package/dist/src/utils/Auth.d.ts +0 -12
  246. package/dist/src/utils/Auth.js +0 -49
  247. package/dist/src/utils/Auth.js.map +0 -1
  248. package/dist/src/utils/Fetches.d.ts +0 -5
  249. package/dist/src/utils/Fetches.js +0 -66
  250. package/dist/src/utils/Fetches.js.map +0 -1
  251. package/dist/src/utils/FormUtils.d.ts +0 -7
  252. package/dist/src/utils/FormUtils.js +0 -9
  253. package/dist/src/utils/FormUtils.js.map +0 -1
  254. package/dist/src/utils/Helpers.d.ts +0 -11
  255. package/dist/src/utils/Helpers.js +0 -26
  256. package/dist/src/utils/Helpers.js.map +0 -1
  257. package/dist/tsconfig.tsbuildinfo +0 -1
  258. package/src/components/Layout.tsx +0 -183
  259. package/src/components/dataGrid/ChipInputCell.tsx +0 -31
  260. package/src/components/dataGrid/EditableColumnHeader.tsx +0 -7
  261. package/src/components/dataGrid/GridToolbar.tsx +0 -63
  262. package/src/components/dataGrid/TableContainer.tsx +0 -39
  263. package/src/components/form/FormAutocomplete.tsx +0 -34
  264. package/src/components/form/FormCheckbox.tsx +0 -32
  265. package/src/components/form/FormDatePicker.tsx +0 -34
  266. package/src/components/form/FormDateTimePicker.tsx +0 -34
  267. package/src/components/form/FormNumberField.tsx +0 -33
  268. package/src/components/form/FormRadioGroup.tsx +0 -43
  269. package/src/components/form/FormSlider.tsx +0 -28
  270. package/src/components/form/FormSubmitButton.tsx +0 -29
  271. package/src/components/form/FormSwitch.tsx +0 -32
  272. package/src/components/form/FormTextField.tsx +0 -26
  273. package/src/components/layout/AccountMenu.tsx +0 -160
  274. package/src/components/layout/DevelopmentBanner.tsx +0 -54
  275. package/src/components/layout/ErrorPage.tsx +0 -34
  276. package/src/components/layout/LayoutDialog.tsx +0 -50
  277. package/src/components/layout/LayoutSnackbar.tsx +0 -44
  278. package/src/components/layout/NavigationDrawer.tsx +0 -131
  279. package/src/components/layout/NotificationMenu.tsx +0 -76
  280. package/src/components/layout/TypographyWithIcon.tsx +0 -35
  281. package/src/components/layout/Unauthorized.tsx +0 -37
  282. package/src/contexts/LayoutContext.tsx +0 -127
  283. package/src/contexts/UserContext.tsx +0 -88
  284. package/src/hooks/FormHooks.ts +0 -33
  285. package/src/hooks/UseSnackbar.tsx +0 -28
  286. package/src/hooks/UseUser.tsx +0 -29
  287. package/src/index.ts +0 -27
  288. package/src/models/Error.tsx +0 -6
  289. package/src/models/KeycloakSettings.ts +0 -8
  290. package/src/models/LayoutPaletteColorOptions.tsx +0 -7
  291. package/src/models/LayoutRoute.ts +0 -15
  292. package/src/models/Notification.ts +0 -10
  293. package/src/models/PeoplesoftDepartment.ts +0 -15
  294. package/src/models/PeoplesoftEmployee.ts +0 -35
  295. package/src/models/Snackbar.ts +0 -16
  296. package/src/models/User.ts +0 -13
  297. package/src/models/types/EmployeeCategoryGroup.ts +0 -1
  298. package/src/models/types/EmployeeStatus.ts +0 -1
  299. package/src/utils/Auth.ts +0 -58
  300. package/src/utils/Fetches.ts +0 -83
  301. package/src/utils/FormUtils.ts +0 -22
  302. package/src/utils/Helpers.ts +0 -27
  303. package/tsconfig.json +0 -29
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useIsAuthenticated, useMsal } from "@azure/msal-react";
3
- import { AccountCircle, ArrowBack, Brightness4, ChevronRight, DarkMode, LightMode, Login, Logout, SettingsBrightness, Translate } from "@mui/icons-material";
4
- import { Avatar, Box, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Menu } from "@mui/material";
5
- import { useQuery } from "@tanstack/react-query";
6
- import { Fragment, useState } from "react";
7
- import { useTranslation } from "react-i18next";
8
- import { graphQueries } from "../../hooks/UseUser";
9
- const drawerWidth = 240;
10
- export const AccountMenu = ({ mode, setMode, user }) => {
11
- const [anchorEl, setAnchorEl] = useState(null);
12
- const [tab, setTab] = useState("settings");
13
- const open = Boolean(anchorEl);
14
- const { t, i18n } = useTranslation();
15
- const { instance } = useMsal();
16
- const isAuthenticated = useIsAuthenticated();
17
- const { data: userPhoto } = useQuery({ ...graphQueries.sessionUserPhoto(), enabled: isAuthenticated });
18
- const changeLanguage = (newLanguage) => () => {
19
- i18n.changeLanguage(newLanguage)
20
- .finally(() => closeMenu());
21
- };
22
- const changeMode = (newMode) => () => {
23
- setMode(newMode);
24
- closeMenu();
25
- };
26
- const openMenu = (e) => setAnchorEl(e.currentTarget);
27
- const closeMenu = () => { setAnchorEl(null); setTimeout(() => setTab("settings"), 300); };
28
- const login = () => instance.loginRedirect();
29
- const logout = () => instance.logoutRedirect({
30
- postLogoutRedirectUri: "/",
31
- });
32
- const changeTab = (newTab) => () => setTab(newTab);
33
- const settings = (_jsxs(List, { component: "nav", subheader: _jsx(ListSubheader, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [_jsxs(ListItemButton, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [_jsx(ListItemIcon, { children: _jsx(Brightness4, {}) }), _jsx(ListItemText, { primary: t("Layout.Appearance"), secondary: t(`Layout.${mode.charAt(0).toUpperCase() + mode.slice(1)}`) }), _jsx(ChevronRight, {})] }), _jsxs(ListItemButton, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [_jsx(ListItemIcon, { children: _jsx(Translate, {}) }), _jsx(ListItemText, { primary: t("Layout.Language"), secondary: i18n.resolvedLanguage === "en" ? "English" : "Čeština" }), _jsx(ChevronRight, {})] })] }));
34
- const theme = (_jsxs(List, { subheader: _jsxs(ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [_jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: _jsx(ArrowBack, { fontSize: "small" }) }), " ", t("Layout.Appearance")] }), children: [_jsxs(ListItemButton, { onClick: changeMode("light"), disabled: mode === "light", children: [_jsx(ListItemIcon, { children: _jsx(LightMode, {}) }), _jsx(ListItemText, { primary: t("Layout.Light") })] }), _jsxs(ListItemButton, { onClick: changeMode("dark"), disabled: mode === "dark", children: [_jsx(ListItemIcon, { children: _jsx(DarkMode, {}) }), _jsx(ListItemText, { primary: t("Layout.Dark") })] }), _jsxs(ListItemButton, { onClick: changeMode("system"), disabled: mode === "system", children: [_jsx(ListItemIcon, { children: _jsx(SettingsBrightness, {}) }), _jsx(ListItemText, { primary: t("Layout.System") })] })] }));
35
- const language = (_jsxs(List, { subheader: _jsxs(ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [_jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: _jsx(ArrowBack, { fontSize: "small" }) }), " ", t("Layout.Language")] }), children: [_jsx(ListItemButton, { onClick: changeLanguage("en"), disabled: i18n.resolvedLanguage === "en", children: _jsx(ListItemText, { primary: "English" }) }), _jsx(ListItemButton, { onClick: changeLanguage("cs"), disabled: i18n.resolvedLanguage === "cs", children: _jsx(ListItemText, { primary: "\u010Ce\u0161tina" }) })] }));
36
- return (_jsxs(Fragment, { children: [_jsx(IconButton, { size: "small", edge: "end", onClick: openMenu, children: userPhoto ?
37
- _jsx(Avatar, { src: userPhoto, sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 } } })
38
- :
39
- _jsx(AccountCircle, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 } } }) }), _jsx(Menu, { anchorEl: anchorEl, open: open, onClose: closeMenu, children: _jsxs(Box, { sx: { width: drawerWidth }, children: [_jsx(List, { disablePadding: true, children: isAuthenticated ?
40
- _jsxs(Fragment, { children: [_jsx(ListItem, { children: _jsx(ListItemText, { primary: user.name, secondary: _jsxs("span", { children: [user.employeeId && _jsx("span", { children: user.employeeId }), user.employeeId && _jsx("br", {}), user.department && _jsx("span", { children: user.department })] }) }) }), _jsxs(ListItemButton, { onClick: logout, children: [_jsx(ListItemIcon, { children: _jsx(Logout, { color: "error" }) }), _jsx(ListItemText, { primary: t("Layout.Logout") })] })] })
41
- :
42
- _jsxs(ListItemButton, { onClick: login, children: [_jsx(ListItemIcon, { children: _jsx(Login, { color: "success" }) }), _jsx(ListItemText, { primary: t("Layout.LogIn") })] }) }), tab === "settings" && settings, tab === "theme" && theme, tab === "language" && language] }) })] }));
43
- };
44
- //# sourceMappingURL=AccountMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMenu.js","sourceRoot":"","sources":["../../../../src/components/layout/AccountMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7J,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzI,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,WAAW,GAAG,GAAG,CAAC;AASxB,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IAC/E,MAAM,CAAC,QAAQ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pD,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,aAC3B,KAAC,IAAI,IAAC,cAAc,kBACf,eAAe,CAAC,CAAC;gCACd,MAAC,QAAQ,eACL,KAAC,QAAQ,cACL,KAAC,YAAY,IAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EACvC,2BACK,IAAI,CAAC,UAAU,IAAI,yBAAO,IAAI,CAAC,UAAU,GAAQ,EACjD,IAAI,CAAC,UAAU,IAAI,cAAM,EACzB,IAAI,CAAC,UAAU,IAAI,yBAAO,IAAI,CAAC,UAAU,GAAQ,IAC/C,GACP,GACG,EAEX,MAAC,cAAc,IAAC,OAAO,EAAE,MAAM,aAC3B,KAAC,YAAY,cAAC,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,GAAG,GAAe,EACrD,KAAC,YAAY,IAAC,OAAO,EAAE,CAAC,CAAC,eAAe,CAAC,GAAI,IAChC,IACV;gCACX,CAAC;oCACD,MAAC,cAAc,IAAC,OAAO,EAAE,KAAK,aAC1B,KAAC,YAAY,cAAC,KAAC,KAAK,IAAC,KAAK,EAAC,SAAS,GAAG,GAAe,EACtD,KAAC,YAAY,IAAC,OAAO,EAAE,CAAC,CAAC,cAAc,CAAC,GAAI,IAC/B,GAElB,EAEN,GAAG,KAAK,UAAU,IAAI,QAAQ,EAC9B,GAAG,KAAK,OAAO,IAAI,KAAK,EACxB,GAAG,KAAK,UAAU,IAAI,QAAQ,IAC7B,GACH,IACA,CACd,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useIsAuthenticated, useMsal } from \"@azure/msal-react\";\r\nimport { AccountCircle, ArrowBack, Brightness4, ChevronRight, DarkMode, LightMode, Login, Logout, SettingsBrightness, Translate } from \"@mui/icons-material\";\r\nimport { Avatar, Box, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Menu } from \"@mui/material\";\r\nimport { useQuery } from \"@tanstack/react-query\";\r\nimport React, { Fragment, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { graphQueries } from \"../../hooks/UseUser\";\r\nimport { User } from \"../../models/User\";\r\n\r\nconst drawerWidth = 240;\r\ntype TabType = \"settings\" | \"theme\" | \"language\";\r\n\r\ninterface AccountMenuProps {\r\n mode: \"light\" | \"dark\" | \"system\";\r\n setMode: (mode: \"light\" | \"dark\" | \"system\") => void;\r\n user: User;\r\n}\r\n\r\nexport const AccountMenu: React.FC<AccountMenuProps> = ({ mode, setMode, user }) => {\r\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\r\n const [tab, setTab] = useState<TabType>(\"settings\");\r\n const open = Boolean(anchorEl);\r\n const { t, i18n } = useTranslation();\r\n const { instance } = useMsal();\r\n const isAuthenticated = useIsAuthenticated();\r\n\r\n const { data: userPhoto } = useQuery({ ...graphQueries.sessionUserPhoto(), enabled: isAuthenticated });\r\n\r\n const changeLanguage = (newLanguage: \"en\" | \"cs\") => () => {\r\n i18n.changeLanguage(newLanguage)\r\n .finally(() => closeMenu());\r\n };\r\n\r\n const changeMode = (newMode: \"light\" | \"dark\" | \"system\") => () => {\r\n setMode(newMode);\r\n closeMenu();\r\n };\r\n\r\n const openMenu = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => setAnchorEl(e.currentTarget);\r\n const closeMenu = () => { setAnchorEl(null); setTimeout(() => setTab(\"settings\"), 300); };\r\n\r\n const login = () => instance.loginRedirect();\r\n const logout = () => instance.logoutRedirect({\r\n postLogoutRedirectUri: \"/\",\r\n });\r\n\r\n const changeTab = (newTab: TabType) => () => setTab(newTab);\r\n\r\n const settings = (\r\n <List component=\"nav\" subheader={<ListSubheader sx={{ backgroundColor: \"transparent\" }}>{t(\"Layout.Settings\")}</ListSubheader>}>\r\n <ListItemButton onClick={changeTab(\"theme\")} sx={{ py: 0.3 }}>\r\n <ListItemIcon>\r\n <Brightness4 />\r\n </ListItemIcon>\r\n <ListItemText primary={t(\"Layout.Appearance\")} secondary={t(`Layout.${mode.charAt(0).toUpperCase() + mode.slice(1)}`)} />\r\n <ChevronRight />\r\n </ListItemButton>\r\n\r\n <ListItemButton onClick={changeTab(\"language\")} sx={{ py: 0.3 }}>\r\n <ListItemIcon>\r\n <Translate />\r\n </ListItemIcon>\r\n <ListItemText primary={t(\"Layout.Language\")} secondary={i18n.resolvedLanguage === \"en\" ? \"English\" : \"Čeština\"} />\r\n <ChevronRight />\r\n </ListItemButton>\r\n </List>\r\n );\r\n\r\n const theme = (\r\n <List subheader={\r\n <ListSubheader onClick={changeTab(\"settings\")} sx={{ backgroundColor: \"transparent\", display: \"flex\", alignItems: \"center\", px: 1, cursor: \"pointer\" }}>\r\n <IconButton size=\"small\" sx={{ mr: 0.5 }}>\r\n <ArrowBack fontSize=\"small\" />\r\n </IconButton> {t(\"Layout.Appearance\")}\r\n </ListSubheader>\r\n }>\r\n <ListItemButton onClick={changeMode(\"light\")} disabled={mode === \"light\"}>\r\n <ListItemIcon>\r\n <LightMode />\r\n </ListItemIcon>\r\n <ListItemText primary={t(\"Layout.Light\")} />\r\n </ListItemButton>\r\n <ListItemButton onClick={changeMode(\"dark\")} disabled={mode === \"dark\"}>\r\n <ListItemIcon>\r\n <DarkMode />\r\n </ListItemIcon>\r\n <ListItemText primary={t(\"Layout.Dark\")} />\r\n </ListItemButton>\r\n <ListItemButton onClick={changeMode(\"system\")} disabled={mode === \"system\"}>\r\n <ListItemIcon>\r\n <SettingsBrightness />\r\n </ListItemIcon>\r\n <ListItemText primary={t(\"Layout.System\")} />\r\n </ListItemButton>\r\n </List>\r\n );\r\n\r\n const language = (\r\n <List subheader={\r\n <ListSubheader onClick={changeTab(\"settings\")} sx={{ backgroundColor: \"transparent\", display: \"flex\", alignItems: \"center\", px: 1, cursor: \"pointer\" }}>\r\n <IconButton size=\"small\" sx={{ mr: 0.5 }}>\r\n <ArrowBack fontSize=\"small\" />\r\n </IconButton> {t(\"Layout.Language\")}\r\n </ListSubheader>\r\n }>\r\n <ListItemButton onClick={changeLanguage(\"en\")} disabled={i18n.resolvedLanguage === \"en\"}>\r\n <ListItemText primary=\"English\" />\r\n </ListItemButton>\r\n <ListItemButton onClick={changeLanguage(\"cs\")} disabled={i18n.resolvedLanguage === \"cs\"}>\r\n <ListItemText primary=\"Čeština\" />\r\n </ListItemButton>\r\n </List>\r\n );\r\n\r\n return (\r\n <Fragment>\r\n <IconButton size=\"small\" edge=\"end\" onClick={openMenu}>\r\n {userPhoto ?\r\n <Avatar src={userPhoto} sx={{ width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 } }} />\r\n :\r\n <AccountCircle sx={{ width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 } }} />\r\n }\r\n </IconButton>\r\n\r\n <Menu anchorEl={anchorEl} open={open} onClose={closeMenu}>\r\n <Box sx={{ width: drawerWidth }}>\r\n <List disablePadding>\r\n {isAuthenticated ?\r\n <Fragment>\r\n <ListItem>\r\n <ListItemText primary={user.name} secondary={\r\n <span>\r\n {user.employeeId && <span>{user.employeeId}</span>}\r\n {user.employeeId && <br />}\r\n {user.department && <span>{user.department}</span>}\r\n </span>\r\n } />\r\n </ListItem>\r\n\r\n <ListItemButton onClick={logout}>\r\n <ListItemIcon><Logout color=\"error\" /></ListItemIcon>\r\n <ListItemText primary={t(\"Layout.Logout\")} />\r\n </ListItemButton>\r\n </Fragment>\r\n :\r\n <ListItemButton onClick={login}>\r\n <ListItemIcon><Login color=\"success\" /></ListItemIcon>\r\n <ListItemText primary={t(\"Layout.LogIn\")} />\r\n </ListItemButton>\r\n }\r\n </List>\r\n\r\n {tab === \"settings\" && settings}\r\n {tab === \"theme\" && theme}\r\n {tab === \"language\" && language}\r\n </Box>\r\n </Menu>\r\n </Fragment>\r\n );\r\n};"]}
@@ -1,7 +0,0 @@
1
- import { User } from "../../models/User";
2
- interface DevelopmentBannerProps {
3
- user: User;
4
- hasNavigationRoutes: boolean;
5
- }
6
- export declare const DevelopmentBanner: React.FC<DevelopmentBannerProps>;
7
- export {};
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Close } from "@mui/icons-material";
3
- import { Fade, Grid2, IconButton, Paper, Typography } from "@mui/material";
4
- import { grey } from "@mui/material/colors";
5
- import { useEffect, useState } from "react";
6
- import { useTranslation } from "react-i18next";
7
- import { environment } from "../../utils/Helpers";
8
- import { hasRole } from "../../utils/Auth";
9
- export const DevelopmentBanner = ({ user, hasNavigationRoutes }) => {
10
- const { t } = useTranslation();
11
- const [bannerOpen, setBannerOpen] = useState(false);
12
- useEffect(() => {
13
- if (!hasRole(user, ["wcz-developers"]) && (environment === "dev" || environment === "qas"))
14
- setBannerOpen(true);
15
- }, [user]);
16
- const closeBanner = () => setBannerOpen(false);
17
- return (_jsx(Fade, { appear: false, in: bannerOpen, children: _jsx(Paper, { square: true, variant: "outlined", tabIndex: -1, sx: theme => ({
18
- position: "fixed",
19
- bottom: 0,
20
- left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },
21
- right: 0,
22
- m: 0,
23
- p: 2,
24
- borderWidth: 0,
25
- borderTopWidth: 1,
26
- bgcolor: theme.palette.mode === "dark" ? grey[900] : grey[100]
27
- }), children: _jsxs(Grid2, { container: true, justifyContent: "space-between", alignItems: "center", children: [_jsxs(Grid2, { size: 10, children: [_jsx(Typography, { fontWeight: "bold", children: t("Layout.DevelopmentDialogTitle") }), _jsx(Typography, { variant: "body2", children: t("Layout.DevelopmentDialogContent") })] }), _jsx(Grid2, { size: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { size: "small", onClick: closeBanner, children: _jsx(Close, {}) }) })] }) }) }));
28
- };
29
- //# sourceMappingURL=DevelopmentBanner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevelopmentBanner.js","sourceRoot":"","sources":["../../../../src/components/layout/DevelopmentBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EA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AC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;gBACnD,KAAK,EAAE,CAAC;gBACR,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,WAAW,EAAE,CAAC;gBACd,cAAc,EAAE,CAAC;gBACjB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACjE,CAAC,YACE,MAAC,KAAK,IAAC,SAAS,QAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aAC/D,MAAC,KAAK,IAAC,IAAI,EAAE,EAAE,aACX,KAAC,UAAU,IAAC,UAAU,EAAC,MAAM,YAAE,CAAC,CAAC,+BAA+B,CAAC,GAAc,EAC/E,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,YAAE,CAAC,CAAC,iCAAiC,CAAC,GAAc,IAC3E,EAER,KAAC,KAAK,IAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,YAC5C,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,WAAW,YACzC,KAAC,KAAK,KAAG,GACA,GACT,IACJ,GACJ,GACL,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { Fade, Grid2, IconButton, Paper, Typography } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { User } from \"../../models/User\";\r\nimport { environment } from \"../../utils/Helpers\";\r\nimport { hasRole } from \"../../utils/Auth\";\r\n\r\ninterface DevelopmentBannerProps {\r\n user: User;\r\n hasNavigationRoutes: boolean;\r\n}\r\n\r\nexport const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user, hasNavigationRoutes }) => {\r\n const { t } = useTranslation();\r\n const [bannerOpen, setBannerOpen] = useState<boolean>(false);\r\n\r\n useEffect(() => {\r\n if (!hasRole(user, [\"wcz-developers\"]) && (environment === \"dev\" || environment === \"qas\"))\r\n setBannerOpen(true);\r\n }, [user]);\r\n\r\n const closeBanner = () => setBannerOpen(false);\r\n\r\n return (\r\n <Fade appear={false} in={bannerOpen}>\r\n <Paper square variant=\"outlined\" tabIndex={-1} sx={theme => ({\r\n position: \"fixed\",\r\n bottom: 0,\r\n left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },\r\n right: 0,\r\n m: 0,\r\n p: 2,\r\n borderWidth: 0,\r\n borderTopWidth: 1,\r\n bgcolor: theme.palette.mode === \"dark\" ? grey[900] : grey[100]\r\n })}>\r\n <Grid2 container justifyContent=\"space-between\" alignItems=\"center\">\r\n <Grid2 size={10}>\r\n <Typography fontWeight=\"bold\">{t(\"Layout.DevelopmentDialogTitle\")}</Typography>\r\n <Typography variant=\"body2\">{t(\"Layout.DevelopmentDialogContent\")}</Typography>\r\n </Grid2>\r\n\r\n <Grid2 size={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton size=\"small\" onClick={closeBanner}>\r\n <Close />\r\n </IconButton>\r\n </Grid2>\r\n </Grid2>\r\n </Paper>\r\n </Fade>\r\n );\r\n};"]}
@@ -1,2 +0,0 @@
1
- import { FC } from "react";
2
- export declare const ErrorPage: FC;
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Container, Typography } from "@mui/material";
3
- import { useRouteError } from "react-router-dom";
4
- export const ErrorPage = () => {
5
- const error = useRouteError();
6
- const formatErrorMessage = (error) => {
7
- if (typeof error === "string") {
8
- return error;
9
- }
10
- else if (error instanceof Error) {
11
- return error.message;
12
- }
13
- else if (typeof error === "object" && error !== null) {
14
- return JSON.stringify(error, null, 2);
15
- }
16
- else if (typeof error === "number" || typeof error === "boolean") {
17
- return error.toString();
18
- }
19
- else {
20
- return "An unknown error occurred.";
21
- }
22
- };
23
- return (_jsx(Container, { maxWidth: "sm", children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minHeight: "100vh", textAlign: "center", padding: 3, children: [_jsx(Typography, { variant: "h2", gutterBottom: true, children: "Oops!" }), _jsx(Typography, { variant: "h6", color: "textSecondary", gutterBottom: true, children: formatErrorMessage(error) })] }) }));
24
- };
25
- //# sourceMappingURL=ErrorPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../../src/components/layout/ErrorPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAO,GAAG,EAAE;IAC9B,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAE9B,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAU,EAAE;QAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC;QACjB,CAAC;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC,OAAO,CAAC;QACzB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1C,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACjE,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC;aAAM,CAAC;YACJ,OAAO,4BAA4B,CAAC;QACxC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,SAAS,IAAC,QAAQ,EAAC,IAAI,YACpB,MAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aAClI,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,YAAY,4BAExB,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,KAAK,EAAC,eAAe,EAAC,YAAY,kBACtD,kBAAkB,CAAC,KAAK,CAAC,GACjB,IACX,GACE,CACf,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Box, Container, Typography } from \"@mui/material\";\r\nimport { FC } from \"react\";\r\nimport { useRouteError } from \"react-router-dom\";\r\n\r\nexport const ErrorPage: FC = () => {\r\n const error = useRouteError();\r\n\r\n const formatErrorMessage = (error: unknown): string => {\r\n if (typeof error === \"string\") {\r\n return error;\r\n } else if (error instanceof Error) {\r\n return error.message;\r\n } else if (typeof error === \"object\" && error !== null) {\r\n return JSON.stringify(error, null, 2);\r\n } else if (typeof error === \"number\" || typeof error === \"boolean\") {\r\n return error.toString();\r\n } else {\r\n return \"An unknown error occurred.\";\r\n }\r\n };\r\n\r\n return (\r\n <Container maxWidth=\"sm\">\r\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" minHeight=\"100vh\" textAlign=\"center\" padding={3} >\r\n <Typography variant=\"h2\" gutterBottom>\r\n Oops!\r\n </Typography>\r\n <Typography variant=\"h6\" color=\"textSecondary\" gutterBottom>\r\n {formatErrorMessage(error)}\r\n </Typography>\r\n </Box>\r\n </Container>\r\n );\r\n};"]}
@@ -1,12 +0,0 @@
1
- import { Breakpoint } from "@mui/material";
2
- import { ReactNode } from "react";
3
- interface DialogProps {
4
- open: boolean;
5
- onClose: (_event?: {}, reason?: "backdropClick" | "escapeKeyDown") => void;
6
- title: string | ReactNode;
7
- color?: "success" | "info" | "warning" | "error" | "primary" | "secondary" | "inherit" | "default";
8
- maxWidth?: Breakpoint;
9
- children?: ReactNode;
10
- }
11
- export declare const LayoutDialog: React.FC<DialogProps>;
12
- export {};
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Close } from "@mui/icons-material";
3
- import { AppBar, Dialog, DialogTitle, Grid2, IconButton, Toolbar, Typography, useMediaQuery, useTheme } from "@mui/material";
4
- export const LayoutDialog = ({ open, onClose, title, color, maxWidth, children }) => {
5
- const theme = useTheme();
6
- const fullscreen = useMediaQuery(theme.breakpoints.down("sm"));
7
- return (_jsxs(Dialog, { open: open, onClose: onClose, fullScreen: fullscreen, fullWidth: true, maxWidth: maxWidth, children: [fullscreen ?
8
- _jsx(AppBar, { sx: { position: "relative", bgcolor: `${color}.main` }, children: _jsxs(Toolbar, { children: [_jsx(Typography, { sx: { flex: 1 }, variant: "h6", children: title }), _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { sx: { color: `${color}.contrastText` } }) })] }) })
9
- :
10
- _jsxs(Grid2, { container: true, justifyContent: "space-between", sx: { bgcolor: `${color}.main`, color: `${color}.contrastText` }, children: [_jsx(Grid2, { children: _jsx(DialogTitle, { children: title }) }), _jsx(Grid2, { size: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { fontSize: "small", sx: { color: `${color}.contrastText` } }) }) })] }), open ? children : null] }));
11
- };
12
- //# sourceMappingURL=LayoutDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LayoutDialog.js","sourceRoot":"","sources":["../../../../src/components/layout/LayoutDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAA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,IAAC,OAAO,EAAE,OAAO,YACxB,KAAC,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACzD,GACT,IACJ,EAGX,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IACjB,CACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { AppBar, Breakpoint, Dialog, DialogTitle, Grid2, IconButton, Toolbar, Typography, useMediaQuery, useTheme } from \"@mui/material\";\r\nimport { ReactNode } from \"react\";\r\n\r\ninterface DialogProps {\r\n open: boolean;\r\n onClose: (_event?: {}, reason?: \"backdropClick\" | \"escapeKeyDown\") => void;\r\n title: string | ReactNode;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n children?: ReactNode;\r\n}\r\n\r\nexport const LayoutDialog: React.FC<DialogProps> = ({ open, onClose, title, color, maxWidth, children }) => {\r\n const theme = useTheme();\r\n const fullscreen = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n\r\n return (\r\n <Dialog open={open} onClose={onClose} fullScreen={fullscreen} fullWidth maxWidth={maxWidth}>\r\n {fullscreen ?\r\n <AppBar sx={{ position: \"relative\", bgcolor: `${color}.main` }}>\r\n <Toolbar>\r\n <Typography sx={{ flex: 1 }} variant=\"h6\">\r\n {title}\r\n </Typography>\r\n <IconButton onClick={onClose}>\r\n <Close sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Toolbar>\r\n </AppBar>\r\n :\r\n <Grid2 container justifyContent=\"space-between\" sx={{ bgcolor: `${color}.main`, color: `${color}.contrastText` }}>\r\n <Grid2>\r\n <DialogTitle>\r\n {title}\r\n </DialogTitle>\r\n </Grid2>\r\n\r\n <Grid2 size={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton onClick={onClose}>\r\n <Close fontSize=\"small\" sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Grid2>\r\n </Grid2>\r\n }\r\n\r\n {open ? children : null}\r\n </Dialog >\r\n );\r\n};\r\n"]}
@@ -1,8 +0,0 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- import { Snackbar as SnackbarModel } from "../../models/Snackbar";
3
- interface SnackbarProps {
4
- snackbar: SnackbarModel;
5
- setSnackbar: Dispatch<SetStateAction<SnackbarModel>>;
6
- }
7
- export declare const LayoutSnackbar: React.FC<SnackbarProps>;
8
- export {};
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Alert, AlertTitle, Portal, Snackbar } from "@mui/material";
3
- import { Fragment, useMemo } from "react";
4
- export const LayoutSnackbar = ({ snackbar, setSnackbar }) => {
5
- const handleOnSnackbarClose = (_event, reason) => {
6
- if (reason === "clickaway")
7
- return;
8
- setSnackbar(prevSnackbar => ({ ...prevSnackbar, title: "" }));
9
- };
10
- const autoHideDuration = useMemo(() => {
11
- if ((snackbar === null || snackbar === void 0 ? void 0 : snackbar.duration) === undefined) {
12
- if ((snackbar === null || snackbar === void 0 ? void 0 : snackbar.severity) === "error")
13
- return 15000;
14
- if ((snackbar === null || snackbar === void 0 ? void 0 : snackbar.severity) === "warning")
15
- return 10000;
16
- return 5000;
17
- }
18
- return snackbar.duration;
19
- }, [snackbar]);
20
- return (_jsx(Portal, { children: _jsx(Snackbar, { open: !!(snackbar === null || snackbar === void 0 ? void 0 : snackbar.title), autoHideDuration: autoHideDuration, onClose: handleOnSnackbarClose, children: _jsx(Alert, { onClose: handleOnSnackbarClose, severity: snackbar === null || snackbar === void 0 ? void 0 : snackbar.severity, sx: { width: "100%" }, variant: "filled", children: (snackbar === null || snackbar === void 0 ? void 0 : snackbar.description) ?
21
- _jsxs(Fragment, { children: [_jsx(AlertTitle, { children: snackbar === null || snackbar === void 0 ? void 0 : snackbar.title }), snackbar.description] })
22
- :
23
- snackbar === null || snackbar === void 0 ? void 0 : snackbar.title }) }) }));
24
- };
25
- //# sourceMappingURL=LayoutSnackbar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LayoutSnackbar.js","sourceRoot":"","sources":["../../../../src/components/layout/LayoutSnackbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAY,QAAQ,EAAkC,OAAO,EAAE,MAAM,OAAO,CAAC;AAQpF,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;IAEjF,MAAM,qBAAqB,GAAG,CAAC,MAA+B,EAAE,MAAe,EAAE,EAAE;QAC/E,IAAI,MAAM,KAAK,WAAW;YAAE,OAAO;QACnC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QAClC,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,MAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,MAAK,OAAO;gBAC9B,OAAO,KAAK,CAAC;YACjB,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,MAAK,SAAS;gBAChC,OAAO,KAAK,CAAC;YACjB,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC7B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACH,KAAC,MAAM,cACH,KAAC,QAAQ,IAAC,IAAI,EAAE,CAAC,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAA,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,qBAAqB,YACjG,KAAC,KAAK,IAAC,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAC,QAAQ,YACvG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAC,CAAC;oBACpB,MAAC,QAAQ,eACL,KAAC,UAAU,cAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,GAAc,EACzC,QAAQ,CAAC,WAAW,IACd;oBACX,CAAC;wBACD,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,GAEf,GACD,GACN,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Alert, AlertTitle, Portal, Snackbar } from \"@mui/material\";\r\nimport { Dispatch, Fragment, SetStateAction, SyntheticEvent, useMemo } from \"react\";\r\nimport { Snackbar as SnackbarModel } from \"../../models/Snackbar\";\r\n\r\ninterface SnackbarProps {\r\n snackbar: SnackbarModel;\r\n setSnackbar: Dispatch<SetStateAction<SnackbarModel>>;\r\n}\r\n\r\nexport const LayoutSnackbar: React.FC<SnackbarProps> = ({ snackbar, setSnackbar }) => {\r\n\r\n const handleOnSnackbarClose = (_event?: SyntheticEvent | Event, reason?: string) => {\r\n if (reason === \"clickaway\") return;\r\n setSnackbar(prevSnackbar => ({ ...prevSnackbar, title: \"\" }));\r\n };\r\n\r\n const autoHideDuration = useMemo(() => {\r\n if (snackbar?.duration === undefined) {\r\n if (snackbar?.severity === \"error\")\r\n return 15000;\r\n if (snackbar?.severity === \"warning\")\r\n return 10000;\r\n return 5000;\r\n }\r\n return snackbar.duration;\r\n }, [snackbar]);\r\n\r\n return (\r\n <Portal>\r\n <Snackbar open={!!snackbar?.title} autoHideDuration={autoHideDuration} onClose={handleOnSnackbarClose}>\r\n <Alert onClose={handleOnSnackbarClose} severity={snackbar?.severity} sx={{ width: \"100%\" }} variant=\"filled\">\r\n {snackbar?.description ?\r\n <Fragment>\r\n <AlertTitle>{snackbar?.title}</AlertTitle>\r\n {snackbar.description}\r\n </Fragment>\r\n :\r\n snackbar?.title\r\n }\r\n </Alert>\r\n </Snackbar>\r\n </Portal>\r\n );\r\n};"]}
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { LayoutRoute } from "../../models/LayoutRoute";
3
- interface NavigationDrawerProps {
4
- routes: LayoutRoute[];
5
- appVersion: string;
6
- open: boolean;
7
- setOpen: (open: boolean) => void;
8
- hasRoutes: boolean;
9
- }
10
- export declare const NavigationDrawer: React.FC<NavigationDrawerProps>;
11
- export {};
@@ -1,70 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronLeft, ChevronRight } from "@mui/icons-material";
3
- import { Box, Divider, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Drawer as MuiDrawer, Tooltip, Typography } from "@mui/material";
4
- import { styled, useTheme } from "@mui/material/styles";
5
- import { Fragment } from "react";
6
- import { useTranslation } from "react-i18next";
7
- import { useLocation, useNavigate } from "react-router-dom";
8
- const drawerWidth = 240;
9
- const openedMixin = (theme) => ({
10
- width: drawerWidth,
11
- transition: theme.transitions.create("width", {
12
- easing: theme.transitions.easing.sharp,
13
- duration: theme.transitions.duration.enteringScreen,
14
- }),
15
- overflowX: "hidden",
16
- });
17
- const closedMixin = (theme) => ({
18
- transition: theme.transitions.create("width", {
19
- easing: theme.transitions.easing.sharp,
20
- duration: theme.transitions.duration.leavingScreen,
21
- }),
22
- overflowX: "hidden",
23
- width: `calc(${theme.spacing(7)} + 1px)`,
24
- [theme.breakpoints.up("sm")]: {
25
- width: `calc(${theme.spacing(8.4)} + 1px)`,
26
- },
27
- });
28
- const DrawerHeader = styled("div")(({ theme }) => ({
29
- display: "flex",
30
- alignItems: "center",
31
- justifyContent: "flex-end",
32
- padding: theme.spacing(0, 1),
33
- // necessary for content to be below app bar
34
- ...theme.mixins.toolbar,
35
- }));
36
- const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== "open" })(({ theme, open }) => ({
37
- width: drawerWidth,
38
- flexShrink: 0,
39
- whiteSpace: "nowrap",
40
- boxSizing: "border-box",
41
- ...(open && {
42
- ...openedMixin(theme),
43
- "& .MuiDrawer-paper": openedMixin(theme),
44
- }),
45
- ...(!open && {
46
- ...closedMixin(theme),
47
- "& .MuiDrawer-paper": closedMixin(theme),
48
- }),
49
- }));
50
- const isExternalUrl = (url) => url.startsWith("http://") || url.startsWith("https://");
51
- export const NavigationDrawer = ({ routes, appVersion, open, setOpen, hasRoutes }) => {
52
- const theme = useTheme();
53
- const { t } = useTranslation();
54
- const navigate = useNavigate();
55
- const location = useLocation();
56
- const closeDrawer = () => setOpen(false);
57
- const handleMenuItemClick = (item) => () => {
58
- if (!item.path)
59
- return console.error("Path is not defined for menu item", item);
60
- setOpen(false);
61
- if (location.pathname === item.path)
62
- return window.location.reload();
63
- if (isExternalUrl(item.path))
64
- return window.open(item.path, "_blank");
65
- navigate(item.path);
66
- };
67
- const menuItems = (_jsx(List, { children: routes.filter(route => route.showInMenu && !route.disabled).map(item => _jsxs(Fragment, { children: [_jsx(Tooltip, { title: item.title, placement: "right", disableInteractive: true, disableHoverListener: open, disableTouchListener: open, children: _jsx(ListItem, { disablePadding: true, sx: { display: "block" }, onClick: handleMenuItemClick(item), children: _jsxs(ListItemButton, { selected: location.pathname === item.path, children: [_jsx(ListItemIcon, { children: item.icon }), _jsx(ListItemText, { primary: item.title })] }) }) }), item.divider && _jsx(Divider, { sx: { my: 1 } })] }, item.path)) }));
68
- return (_jsxs(Fragment, { children: [_jsxs(Drawer, { variant: "permanent", open: open, sx: { display: { xs: "none", sm: hasRoutes ? "inherit" : "none" } }, children: [_jsxs(DrawerHeader, { children: [_jsxs(Typography, { sx: { flexGrow: 1, textAlign: "center", marginLeft: 3 }, children: [t("Layout.Version"), ": ", appVersion] }), _jsx(IconButton, { onClick: closeDrawer, children: theme.direction === "rtl" ? _jsx(ChevronRight, {}) : _jsx(ChevronLeft, {}) })] }), _jsx(Divider, {}), menuItems] }), _jsx(MuiDrawer, { anchor: "left", open: open, onClose: closeDrawer, sx: { display: { xs: "inherit", sm: hasRoutes ? "none" : "inherit" } }, children: _jsxs(Box, { sx: { width: drawerWidth }, children: [_jsxs(Typography, { sx: { textAlign: "center", my: 1.5 }, children: [t("Layout.Version"), ": ", appVersion] }), menuItems] }) })] }));
69
- };
70
- //# sourceMappingURL=NavigationDrawer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NavigationDrawer.js","sourceRoot":"","sources":["../../../../src/components/layout/NavigationDrawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/J,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG5D,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,KAAY,EAAa,EAAE,CAAC,CAAC;IAC9C,KAAK,EAAE,WAAW;IAClB,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE;QAC1C,MA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AC,YAAY,eACT,MAAC,UAAU,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,aAAG,CAAC,CAAC,gBAAgB,CAAC,QAAI,UAAU,IAAc,EACrH,KAAC,UAAU,IAAC,OAAO,EAAE,WAAW,YAC3B,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,GACtD,IACF,EACf,KAAC,OAAO,KAAG,EACV,SAAS,IACL,EAET,KAAC,SAAS,IAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAC7H,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,aAC3B,MAAC,UAAU,IAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,aAAG,CAAC,CAAC,gBAAgB,CAAC,QAAI,UAAU,IAAc,EACjG,SAAS,IACR,GACE,IACL,CACd,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { ChevronLeft, ChevronRight } from \"@mui/icons-material\";\r\nimport { Box, Divider, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Drawer as MuiDrawer, Tooltip, Typography } from \"@mui/material\";\r\nimport { CSSObject, Theme, styled, useTheme } from \"@mui/material/styles\";\r\nimport React, { Fragment } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { useLocation, useNavigate } from \"react-router-dom\";\r\nimport { LayoutRoute } from \"../../models/LayoutRoute\";\r\n\r\nconst drawerWidth = 240;\r\n\r\nconst openedMixin = (theme: Theme): CSSObject => ({\r\n width: drawerWidth,\r\n transition: theme.transitions.create(\"width\", {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n overflowX: \"hidden\",\r\n});\r\n\r\nconst closedMixin = (theme: Theme): CSSObject => ({\r\n transition: theme.transitions.create(\"width\", {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n overflowX: \"hidden\",\r\n width: `calc(${theme.spacing(7)} + 1px)`,\r\n [theme.breakpoints.up(\"sm\")]: {\r\n width: `calc(${theme.spacing(8.4)} + 1px)`,\r\n },\r\n});\r\n\r\nconst DrawerHeader = styled(\"div\")(({ theme }) => ({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n}));\r\n\r\nconst Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== \"open\" })(\r\n ({ theme, open }) => ({\r\n width: drawerWidth,\r\n flexShrink: 0,\r\n whiteSpace: \"nowrap\",\r\n boxSizing: \"border-box\",\r\n ...(open && {\r\n ...openedMixin(theme),\r\n \"& .MuiDrawer-paper\": openedMixin(theme),\r\n }),\r\n ...(!open && {\r\n ...closedMixin(theme),\r\n \"& .MuiDrawer-paper\": closedMixin(theme),\r\n }),\r\n }),\r\n);\r\n\r\nconst isExternalUrl = (url: string) => url.startsWith(\"http://\") || url.startsWith(\"https://\");\r\n\r\ninterface NavigationDrawerProps {\r\n routes: LayoutRoute[];\r\n appVersion: string;\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n hasRoutes: boolean;\r\n}\r\n\r\nexport const NavigationDrawer: React.FC<NavigationDrawerProps> = ({ routes, appVersion, open, setOpen, hasRoutes }) => {\r\n const theme = useTheme();\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const location = useLocation();\r\n\r\n const closeDrawer = () => setOpen(false);\r\n\r\n const handleMenuItemClick = (item: LayoutRoute) => () => {\r\n if (!item.path) return console.error(\"Path is not defined for menu item\", item);\r\n setOpen(false);\r\n\r\n if (location.pathname === item.path)\r\n return window.location.reload();\r\n\r\n if (isExternalUrl(item.path))\r\n return window.open(item.path, \"_blank\");\r\n\r\n navigate(item.path);\r\n };\r\n\r\n const menuItems = (\r\n <List>\r\n {routes.filter(route => route.showInMenu && !route.disabled).map(item =>\r\n <Fragment key={item.path}>\r\n <Tooltip title={item.title} placement=\"right\" disableInteractive disableHoverListener={open} disableTouchListener={open}>\r\n <ListItem disablePadding sx={{ display: \"block\" }} onClick={handleMenuItemClick(item)}>\r\n <ListItemButton selected={location.pathname === item.path}>\r\n <ListItemIcon>\r\n {item.icon}\r\n </ListItemIcon>\r\n <ListItemText primary={item.title} />\r\n </ListItemButton>\r\n </ListItem>\r\n </Tooltip>\r\n\r\n {item.divider && <Divider sx={{ my: 1 }} />}\r\n </Fragment>\r\n )}\r\n </List>\r\n );\r\n\r\n return (\r\n <Fragment>\r\n <Drawer variant=\"permanent\" open={open} sx={{ display: { xs: \"none\", sm: hasRoutes ? \"inherit\" : \"none\" } }}>\r\n <DrawerHeader>\r\n <Typography sx={{ flexGrow: 1, textAlign: \"center\", marginLeft: 3 }}>{t(\"Layout.Version\")}: {appVersion}</Typography>\r\n <IconButton onClick={closeDrawer}>\r\n {theme.direction === \"rtl\" ? <ChevronRight /> : <ChevronLeft />}\r\n </IconButton>\r\n </DrawerHeader>\r\n <Divider />\r\n {menuItems}\r\n </Drawer>\r\n\r\n <MuiDrawer anchor=\"left\" open={open} onClose={closeDrawer} sx={{ display: { xs: \"inherit\", sm: hasRoutes ? \"none\" : \"inherit\" } }}>\r\n <Box sx={{ width: drawerWidth }}>\r\n <Typography sx={{ textAlign: \"center\", my: 1.5 }}>{t(\"Layout.Version\")}: {appVersion}</Typography>\r\n {menuItems}\r\n </Box>\r\n </MuiDrawer>\r\n </Fragment>\r\n );\r\n};\r\n"]}
@@ -1,8 +0,0 @@
1
- import React, { Dispatch, SetStateAction } from "react";
2
- import Notification from "../../models/Notification";
3
- interface NotificationMenuProps {
4
- notifications: Notification[] | undefined;
5
- setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;
6
- }
7
- export declare const NotificationMenu: React.FC<NotificationMenuProps>;
8
- export {};
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Done, Error, Info, Notifications, NotificationsOff, Warning } from "@mui/icons-material";
3
- import { Badge, Grid, IconButton, List, ListItem, ListItemIcon, ListItemText, Menu, Typography } from "@mui/material";
4
- import { grey } from "@mui/material/colors";
5
- import moment from "moment";
6
- import { Fragment, useEffect, useState } from "react";
7
- import { useTranslation } from "react-i18next";
8
- import { TypographyWithIcon } from "./TypographyWithIcon";
9
- export const NotificationMenu = ({ notifications, setNotifications }) => {
10
- const { t } = useTranslation();
11
- const [anchorEl, setAnchorEl] = useState(null);
12
- const open = Boolean(anchorEl);
13
- const openMenu = (e) => setAnchorEl(e.currentTarget);
14
- const closeMenu = () => setAnchorEl(null);
15
- useEffect(() => {
16
- if (open)
17
- setAllNotificationsAsRead();
18
- }, [open]);
19
- const setAllNotificationsAsRead = () => {
20
- const updatedNotifications = [...notifications || []].map(notification => ({ ...notification, isRead: true }));
21
- setNotifications(updatedNotifications);
22
- };
23
- return (_jsxs(Fragment, { children: [_jsx(IconButton, { color: "inherit", onClick: openMenu, sx: { mr: 1 }, children: _jsx(Badge, { badgeContent: notifications === null || notifications === void 0 ? void 0 : notifications.filter(notification => !notification.isRead).length, color: "error", children: _jsx(Notifications, {}) }) }), _jsx(Menu, { anchorEl: anchorEl, open: open, onClose: closeMenu, sx: { height: 700, maxHeight: "calc(100vh - 50px)" }, children: _jsxs(List, { dense: true, sx: { width: 400, maxWidth: "calc(100vw - 50px)" }, children: [_jsx(ListItem, { children: _jsx(Typography, { variant: "h6", children: t("Layout.Notifications") }) }), notifications === null || notifications === void 0 ? void 0 : notifications.map(notification => _jsxs(ListItem, { sx: theme => ({ transition: "background-color 0.2s ease", cursor: "default", "&:hover": { bgcolor: theme.palette.mode === "dark" ? grey[800] : grey[200] } }), children: [_jsxs(ListItemIcon, { children: [notification.severity === "error" && _jsx(Error, { color: "error", fontSize: "large" }), notification.severity === "warning" && _jsx(Warning, { color: "warning", fontSize: "large" }), notification.severity === "info" && _jsx(Info, { color: "info", fontSize: "large" }), (notification.severity === "success" || !notification.severity) && _jsx(Done, { color: "success", fontSize: "large" })] }), _jsx(ListItemText, { primary: _jsx(Typography, { variant: "body1", children: notification.title }), secondary: _jsxs(Fragment, { children: [_jsx(Typography, { variant: "body2", children: notification.description }), _jsx(Typography, { variant: "caption", children: moment(notification.dateTime).fromNow() })] }) })] }, notification.dateTime)), !(notifications === null || notifications === void 0 ? void 0 : notifications.length) &&
24
- _jsx(Grid, { container: true, justifyContent: "center", alignItems: "center", sx: { width: "100%", height: 200, maxHeight: "calc(100vh - 150px)" }, children: _jsx(Grid, { item: true, children: _jsx(TypographyWithIcon, { startIcon: _jsx(NotificationsOff, { color: "disabled" }), color: "text.secondary", children: t("Layout.NoNotificationsAtTheMoment") }) }) })] }) })] }));
25
- };
26
- //# sourceMappingURL=NotificationMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationMenu.js","sourceRoot":"","sources":["../../../../src/components/layout/NotificationMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,MAAM,MAAM,QAAQ,CAAC;A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AAQ,EAAC,OAAO,GAAG,EAC1E,CAAC,YAAY,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,GAAG,IAClG,EAEf,KAAC,YAAY,IAAC,OAAO,EAAE,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,YAAE,YAAY,CAAC,KAAK,GAAc,EAAE,SAAS,EAC3F,MAAC,QAAQ,eACL,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,YAAE,YAAY,CAAC,WAAW,GAAc,EACnE,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,YAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,GAAc,IAC7E,GACX,KAbO,YAAY,CAAC,QAAQ,CAczB,CACd,EAEA,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAA;4BACnB,KAAC,IAAI,IAAC,SAAS,QAAC,cAAc,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE,YAC5H,KAAC,IAAI,IAAC,IAAI,kBACN,KAAC,kBAAkB,IAAC,SAAS,EAAE,KAAC,gBAAgB,IAAC,KAAK,EAAC,UAAU,GAAG,EAAE,KAAK,EAAC,gBAAgB,YAAE,CAAC,CAAC,mCAAmC,CAAC,GAAsB,GACvJ,GACJ,IAER,GACJ,IACA,CACd,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Done, Error, Info, Notifications, NotificationsOff, Warning } from \"@mui/icons-material\";\r\nimport { Badge, Grid, IconButton, List, ListItem, ListItemIcon, ListItemText, Menu, Typography } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport moment from \"moment\";\r\nimport React, { Dispatch, Fragment, SetStateAction, useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport Notification from \"../../models/Notification\";\r\nimport { TypographyWithIcon } from \"./TypographyWithIcon\";\r\n\r\ninterface NotificationMenuProps {\r\n notifications: Notification[] | undefined;\r\n setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;\r\n}\r\n\r\nexport const NotificationMenu: React.FC<NotificationMenuProps> = ({ notifications, setNotifications }) => {\r\n const { t } = useTranslation();\r\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\r\n const open = Boolean(anchorEl);\r\n\r\n const openMenu = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => setAnchorEl(e.currentTarget);\r\n const closeMenu = () => setAnchorEl(null);\r\n\r\n useEffect(() => {\r\n if (open)\r\n setAllNotificationsAsRead();\r\n }, [open]);\r\n\r\n const setAllNotificationsAsRead = () => {\r\n const updatedNotifications = [...notifications || []].map(notification => ({ ...notification, isRead: true }));\r\n setNotifications(updatedNotifications);\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <IconButton color=\"inherit\" onClick={openMenu} sx={{ mr: 1 }}>\r\n <Badge badgeContent={notifications?.filter(notification => !notification.isRead).length} color=\"error\">\r\n <Notifications />\r\n </Badge>\r\n </IconButton>\r\n\r\n <Menu anchorEl={anchorEl} open={open} onClose={closeMenu} sx={{ height: 700, maxHeight: \"calc(100vh - 50px)\" }}>\r\n <List dense sx={{ width: 400, maxWidth: \"calc(100vw - 50px)\" }}>\r\n <ListItem>\r\n <Typography variant=\"h6\">{t(\"Layout.Notifications\")}</Typography>\r\n </ListItem>\r\n\r\n {notifications?.map(notification =>\r\n <ListItem key={notification.dateTime} sx={theme => ({ transition: \"background-color 0.2s ease\", cursor: \"default\", \"&:hover\": { bgcolor: theme.palette.mode === \"dark\" ? grey[800] : grey[200] } })}>\r\n <ListItemIcon>\r\n {notification.severity === \"error\" && <Error color=\"error\" fontSize=\"large\" />}\r\n {notification.severity === \"warning\" && <Warning color=\"warning\" fontSize=\"large\" />}\r\n {notification.severity === \"info\" && <Info color=\"info\" fontSize=\"large\" />}\r\n {(notification.severity === \"success\" || !notification.severity) && <Done color=\"success\" fontSize=\"large\" />}\r\n </ListItemIcon>\r\n\r\n <ListItemText primary={<Typography variant=\"body1\">{notification.title}</Typography>} secondary={\r\n <Fragment>\r\n <Typography variant=\"body2\">{notification.description}</Typography>\r\n <Typography variant=\"caption\">{moment(notification.dateTime).fromNow()}</Typography>\r\n </Fragment>\r\n } />\r\n </ListItem>\r\n )}\r\n\r\n {!notifications?.length &&\r\n <Grid container justifyContent=\"center\" alignItems=\"center\" sx={{ width: \"100%\", height: 200, maxHeight: \"calc(100vh - 150px)\" }}>\r\n <Grid item>\r\n <TypographyWithIcon startIcon={<NotificationsOff color=\"disabled\" />} color=\"text.secondary\">{t(\"Layout.NoNotificationsAtTheMoment\")}</TypographyWithIcon>\r\n </Grid>\r\n </Grid>\r\n }\r\n </List>\r\n </Menu>\r\n </Fragment>\r\n );\r\n};"]}
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Stack, Typography } from "@mui/material";
3
- const stackSxProps = [
4
- "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "m", "mt", "mr", "mb", "ml", "mx", "my",
5
- "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "p", "pt", "pr", "pb", "pl", "px", "py",
6
- "flexGrow", "flexShrink", "flexBasis", "flexDirection", "alignItems", "justifyContent",
7
- "position", "zIndex", "top", "right", "bottom", "left",
8
- "gridGap", "gridColumnGap", "gridRowGap", "gridColumn", "gridRow", "gridAutoFlow",
9
- "gap", "columnGap", "rowGap"
10
- ];
11
- export const TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {
12
- const sxCopy = { ...sx };
13
- const stackStyles = stackSxProps.reduce((acc, curr) => {
14
- if (sxCopy && sxCopy[curr]) {
15
- acc[curr] = sxCopy[curr];
16
- delete sxCopy[curr];
17
- }
18
- return acc;
19
- }, {});
20
- return (_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : undefined, children: [startIcon && startIcon, _jsx(Typography, { ...props, sx: sxCopy, children: children }), endIcon && endIcon] }));
21
- };
22
- //# sourceMappingURL=TypographyWithIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypographyWithIcon.js","sourceRoot":"","sources":["../../../../src/components/layout/TypographyWithIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,UAAU,EAAmB,MAAM,eAAe,CAAC;AAEnF,MAAM,YAAY,GAAG;IACjB,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC3G,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAChH,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB;IACtF,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IACtD,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc;IACjF,KAAK,EAAE,WAAW,EAAE,QAAQ;CAC/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClI,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAClD,IAAI,MAAM,IAAK,MAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,GAAW,CAAC,IAAI,CAAC,GAAI,MAAc,CAAC,IAAI,CAAC,CAAC;YAC3C,OAAQ,MAAc,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,EAAoB,CAAC,CAAC;IAEzB,OAAO,CACH,MAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,aACjG,SAAS,IAAI,SAAS,EACvB,KAAC,UAAU,OAAK,KAAK,EAAE,EAAE,EAAE,MAAM,YAAG,QAAQ,GAAc,EACzD,OAAO,IAAI,OAAO,IACf,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Stack, SxProps, Theme, Typography, TypographyProps } from \"@mui/material\";\r\n\r\nconst stackSxProps = [\r\n \"margin\", \"marginTop\", \"marginRight\", \"marginBottom\", \"marginLeft\", \"m\", \"mt\", \"mr\", \"mb\", \"ml\", \"mx\", \"my\",\r\n \"padding\", \"paddingTop\", \"paddingRight\", \"paddingBottom\", \"paddingLeft\", \"p\", \"pt\", \"pr\", \"pb\", \"pl\", \"px\", \"py\",\r\n \"flexGrow\", \"flexShrink\", \"flexBasis\", \"flexDirection\", \"alignItems\", \"justifyContent\",\r\n \"position\", \"zIndex\", \"top\", \"right\", \"bottom\", \"left\",\r\n \"gridGap\", \"gridColumnGap\", \"gridRowGap\", \"gridColumn\", \"gridRow\", \"gridAutoFlow\",\r\n \"gap\", \"columnGap\", \"rowGap\"\r\n];\r\n\r\ninterface TypographyWithIconProps extends TypographyProps {\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n}\r\n\r\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {\r\n const sxCopy = { ...sx };\r\n\r\n const stackStyles = stackSxProps.reduce((acc, curr) => {\r\n if (sxCopy && (sxCopy as any)[curr]) {\r\n (acc as any)[curr] = (sxCopy as any)[curr];\r\n delete (sxCopy as any)[curr];\r\n }\r\n return acc;\r\n }, {} as SxProps<Theme>);\r\n\r\n return (\r\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={stackStyles} mb={gutterBottom ? 0.7 : undefined}>\r\n {startIcon && startIcon}\r\n <Typography {...props} sx={sxCopy}>{children}</Typography>\r\n {endIcon && endIcon}\r\n </Stack>\r\n );\r\n};"]}
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare const Unauthorized: React.FC;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, CircularProgress, Typography } from "@mui/material";
3
- import { useEffect, useState } from "react";
4
- import { useTranslation } from "react-i18next";
5
- export const Unauthorized = () => {
6
- const { t } = useTranslation();
7
- const [isInitializingKeycloak, setIsInitializingKeycloak] = useState(false);
8
- const [showComponent, setShowComponent] = useState(false);
9
- useEffect(() => {
10
- const timer = setTimeout(() => {
11
- setShowComponent(true);
12
- }, 1000);
13
- window.addEventListener("keycloakInitialization", handleInitialization);
14
- return () => {
15
- clearTimeout(timer);
16
- window.removeEventListener("keycloakInitialization", handleInitialization);
17
- };
18
- }, []);
19
- const handleInitialization = (event) => {
20
- setIsInitializingKeycloak(event.detail.initializing);
21
- };
22
- if (!showComponent)
23
- return null;
24
- return (_jsx(Box, { sx: { position: "relative", height: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } }, children: _jsx(Box, { sx: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }, children: isInitializingKeycloak ? _jsx(CircularProgress, {}) : _jsx(Typography, { variant: "h6", children: t("Layout.Unauthorized") }) }) }));
25
- };
26
- //# source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AAE,MAAM,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,YAC7F,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,YACzF,sBAAsB,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,qBAAqB,CAAC,GAAc,GAC/G,GACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Box, CircularProgress, Typography } from \"@mui/material\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\n\r\nexport const Unauthorized: React.FC = () => {\r\n const { t } = useTranslation();\r\n const [isInitializingKeycloak, setIsInitializingKeycloak] = useState(false);\r\n const [showComponent, setShowComponent] = useState(false);\r\n\r\n useEffect(() => {\r\n const timer = setTimeout(() => {\r\n setShowComponent(true);\r\n }, 1000);\r\n\r\n window.addEventListener(\"keycloakInitialization\", handleInitialization as EventListener);\r\n\r\n return () => {\r\n clearTimeout(timer);\r\n window.removeEventListener(\"keycloakInitialization\", handleInitialization as EventListener);\r\n };\r\n }, []);\r\n\r\n const handleInitialization = (event: CustomEvent) => {\r\n setIsInitializingKeycloak(event.detail.initializing);\r\n };\r\n\r\n if (!showComponent)\r\n return null;\r\n\r\n return (\r\n <Box sx={{ position: \"relative\", height: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" } }}>\r\n <Box sx={{ position: \"absolute\", top: \"50%\", left: \"50%\", transform: \"translate(-50%, -50%)\" }}>\r\n {isInitializingKeycloak ? <CircularProgress /> : <Typography variant=\"h6\">{t(\"Layout.Unauthorized\")}</Typography>}\r\n </Box>\r\n </Box>\r\n );\r\n};"]}
@@ -1,40 +0,0 @@
1
- import { TFunction, i18n } from "i18next";
2
- import "moment/locale/cs";
3
- import { LayoutPaletteColorOptions } from "../models/LayoutPaletteColorOptions";
4
- import { LayoutRoute } from "../models/LayoutRoute";
5
- import { Snackbar } from "../models/Snackbar";
6
- import { User } from "../models/User";
7
- declare module "moment" {
8
- interface Moment {
9
- formatDate(): string;
10
- formatDateTime(): string;
11
- }
12
- }
13
- declare global {
14
- interface Error {
15
- innerException?: string;
16
- status?: number;
17
- traceIdentifier?: string;
18
- }
19
- }
20
- export interface GetRoutesParams {
21
- user: User;
22
- t: TFunction<"translation", undefined>;
23
- i18n: i18n;
24
- }
25
- interface LayoutContextInterface {
26
- user: User;
27
- t: TFunction<"translation", undefined>;
28
- i18n: i18n;
29
- snackbar: (snackbar: Snackbar) => void;
30
- notification: (notification: Snackbar) => void;
31
- }
32
- export declare const LayoutContext: import("react").Context<LayoutContextInterface>;
33
- interface LayoutProviderProps {
34
- getRoutes: (params: GetRoutesParams) => LayoutRoute[];
35
- appVersion: string;
36
- colors: LayoutPaletteColorOptions;
37
- }
38
- export declare const LayoutProvider: React.FC<LayoutProviderProps>;
39
- export declare const useLayout: () => LayoutContextInterface;
40
- export {};