@gen-epix/ui-client-common 4.2.0 → 4.3.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.
- package/dist/_chunks/Breadcrumbs.js +22 -22
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +3 -3
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +559 -3173
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/{oidc-client-ts.js → UserManagerUtil.js} +222 -198
- package/dist/_chunks/UserManagerUtil.js.map +1 -0
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +1 -1
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +13 -11
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +2 -2
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +2 -2
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +8 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/services/LogService/index.js +1 -1
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/RouterService/RouterService.d.ts +15 -6
- package/dist/classes/services/RouterService/index.js +30 -10
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/index.js +34 -98
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +81 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/ApplicationBootstrapWithoutAuthorization.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +63 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -0
- package/dist/components/app/AuthenticationWrapper/index.js +38 -38
- package/dist/components/app/AuthorizationWrapper/index.js +20 -20
- package/dist/components/app/RouterRoot/index.js +58 -59
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +164 -148
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +34 -34
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +8 -8
- package/dist/components/ui/PageContainer/index.js +1 -1
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/pages/AcceptInvitationPage/index.js +28 -28
- package/dist/pages/AdminPage/index.js +23 -23
- package/dist/pages/OrganizationContactsAdminPage/index.js +29 -29
- package/dist/pages/OrganizationSitesAdminPage/index.js +25 -25
- package/dist/pages/PostLoginPage/index.js +11 -11
- package/dist/pages/RouterErrorPage/index.js +10 -10
- package/dist/utils/UserManagerUtil/index.js +2 -31
- package/package.json +36 -27
- package/dist/_chunks/chunk-BV7QT456.js +0 -3742
- package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
- package/dist/_chunks/oidc-client-ts.js.map +0 -1
- package/dist/_chunks/react-oidc-context.js +0 -201
- package/dist/_chunks/react-oidc-context.js.map +0 -1
- package/dist/components/app/ApplicationBootstrap/ApplicationBootstrap.d.ts +0 -2
- package/dist/components/app/ApplicationBootstrap/index.d.ts +0 -1
- package/dist/components/app/ApplicationBootstrap/index.js +0 -135
- package/dist/components/app/ApplicationBootstrap/index.js.map +0 -1
- package/dist/utils/UserManagerUtil/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/ApplicationBar/ApplicationBarNavigationMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.tsx","../../../../src/components/ui/ApplicationBar/InfoMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsInfotem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.tsx","../../../../src/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.tsx","../../../../src/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.tsx","../../../../src/components/ui/ApplicationBar/UserMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsUserItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActions.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBar.tsx"],"sourcesContent":["import {\n Box,\n IconButton,\n styled,\n useTheme,\n} from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport { useTranslation } from 'react-i18next';\nimport { NavLink as BaseNavLink } from 'react-router-dom';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport type { MyNonIndexRouteObject } from '../../../models/reactRouter';\nimport { RouterService } from '../../../classes/services/RouterService';\n\nconst NavLink = styled(BaseNavLink)(({ theme }) => ({\n '&:hover': {\n textDecoration: 'underline',\n },\n color: theme.palette.secondary.contrastText,\n display: 'inline-block',\n fontSize: '1.3rem',\n textDecoration: 'none',\n}));\n\nexport type ApplicationBarNavigationMenuProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationBarNavigationMenu = ({ fullWidth }: ApplicationBarNavigationMenuProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const authorizationService = useMemo(() => AuthorizationService.getInstance(), []);\n const navId = useId();\n\n const menuItems = useMemo(() => {\n const rootItem = RouterService.getInstance().routes.find(r => r.handle.root);\n return [rootItem, ...rootItem.children.filter(r => !r.handle.hidden)] as MyNonIndexRouteObject[];\n }, []);\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle navigation menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MenuIcon />\n </IconButton>\n <Box\n component={'nav'}\n id={navId}\n sx={{\n flexGrow: 1,\n [theme.breakpoints.down('md')]: {\n background: theme['gen-epix-ui'].navbar.background,\n display: isMenuOpen ? 'block' : 'none',\n left: 0,\n paddingBottom: 4,\n position: 'absolute',\n top: 48,\n width: '100%',\n },\n }}\n >\n <Box\n component={'ul'}\n sx={{\n display: 'flex',\n margin: 0,\n marginLeft: fullWidth ? 0 : 2,\n padding: 0,\n [theme.breakpoints.down('md')]: {\n display: 'block',\n margin: 0,\n },\n }}\n >\n {menuItems.filter(menuItem => !menuItem.handle.disabled && authorizationService.doesUserHavePermissionForRoute(menuItem)).map(menuItem => {\n return (\n <Box\n component={'li'}\n key={menuItem.path}\n sx={{\n '&:has(.active)': {\n '& svg': {\n color: theme['gen-epix-ui'].navbar.activeColor,\n },\n a: {\n color: theme['gen-epix-ui'].navbar.activeColor,\n },\n background: theme['gen-epix-ui'].navbar.activeBackground,\n },\n '& svg': {\n marginTop: '6px',\n },\n alignItems: 'center',\n color: theme['gen-epix-ui'].navbar.primaryColor,\n display: 'flex',\n fontWeight: 800,\n height: 48,\n listStyle: 'none',\n padding: `0 ${theme.spacing(1)}`,\n }}\n >\n <NavLink\n aria-label={menuItem.handle.title}\n sx={{\n padding: `0 ${theme.spacing(1)}`,\n }}\n to={menuItem.path}\n >\n {!!menuItem.handle.icon && menuItem.handle.icon}\n {!menuItem.handle.icon && menuItem.handle.title}\n </NavLink>\n </Box>\n );\n })}\n </Box>\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n IconButton,\n Tooltip,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport ChatIcon from '@mui/icons-material/Chat';\n\nimport { UserSettingsService } from '../../../classes/services/UserSettingsService';\nimport { UserFeedbackDialog } from '../UserFeedbackDialog';\nimport type { UserFeedbackDialogRefMethods } from '../UserFeedbackDialog';\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nconst NOW = new Date().getTime();\n\nexport const ApplicationBarActionsFeedbackItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const userFeedbackDialogRef = useRef<UserFeedbackDialogRefMethods>(null);\n const [isFeedbackTooltipOpen, setIsFeedbackTooltipOpen] = useState(false);\n useEffect(() => {\n if (!UserSettingsService.getInstance().showShowUserFeedbackTooltip) {\n return;\n }\n const timeoutMs = Math.max(0, ConfigService.getInstance().config.userFeedback.SHOW_USER_FEEDBACK_TOOLTIP_AFTER_MS - (new Date().getTime() - NOW));\n const handle = setTimeout(() => {\n setIsFeedbackTooltipOpen(true);\n }, timeoutMs);\n return () => {\n clearTimeout(handle);\n };\n }, []);\n\n const onUserFeedbackMenuIconClick = useCallback(() => {\n userFeedbackDialogRef.current.open();\n }, []);\n\n const onTooltipMouseEnter = useCallback(() => {\n setIsFeedbackTooltipOpen(false);\n UserSettingsService.getInstance().showShowUserFeedbackTooltip = false;\n }, []);\n\n return (\n <>\n <Tooltip\n arrow\n color={'secondary'}\n onMouseEnter={onTooltipMouseEnter}\n open={isFeedbackTooltipOpen}\n placement={'left'}\n slotProps={{\n arrow: {\n sx: {\n color: theme.palette.secondary.main,\n },\n },\n popper: {\n disablePortal: true,\n },\n tooltip: {\n sx: {\n backgroundColor: theme.palette.secondary.main,\n marginRight: `${theme.spacing(0.5)} !important`,\n },\n },\n }}\n title={t`Would you like to share your feedback?`}\n >\n <IconButton\n aria-label={t`Feedback`}\n color={'inherit'}\n onClick={onUserFeedbackMenuIconClick}\n >\n <ChatIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Feedback`}\n </Box>\n </IconButton>\n </Tooltip>\n <UserFeedbackDialog ref={userFeedbackDialogRef} />\n </>\n );\n};\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Popover,\n} from '@mui/material';\nimport CopyrightIcon from '@mui/icons-material/Copyright';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport DoneIcon from '@mui/icons-material/Done';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type { LicensesDialogRefMethods } from '../LicensesDialog';\nimport { LicensesDialog } from '../LicensesDialog';\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\ntype InfoMenuProps = {\n readonly anchorElement: HTMLElement;\n readonly onClose: () => void;\n};\n\nexport const InfoMenu = ({ anchorElement, onClose }: InfoMenuProps): ReactElement => {\n const popoverId = useMemo(() => StringUtil.createUuid(), []);\n const licensesDialogRef = useRef<LicensesDialogRefMethods>(null);\n const isInfoMenuOpen = !!anchorElement;\n const { t } = useTranslation();\n const [isCopied, setIsCopied] = useState(false);\n const onShowLicenseInformationButtonClick = useCallback(() => {\n licensesDialogRef.current.open();\n }, []);\n\n const onCopyVersionInformationButtonClick = useCallback(async () => {\n const versionInformation = `Frontend version: ${ConfigService.getInstance().config.getSoftwareVersion()}\\nBackend version: ${BackendVersionService.getInstance().version}\\nURL: ${window.location.href}\\nDate/time: ${new Date().toISOString()}`;\n await navigator.clipboard.writeText(versionInformation);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n }, []);\n\n return (\n <Popover\n {...TestIdUtil.createAttributes('InfoMenu')}\n anchorEl={anchorElement}\n anchorOrigin={{\n horizontal: 'right',\n vertical: 'bottom',\n }}\n id={isInfoMenuOpen ? popoverId : undefined}\n onClose={onClose}\n open={isInfoMenuOpen}\n transformOrigin={{\n horizontal: 'right',\n vertical: 'top',\n }}\n >\n <List\n sx={{\n maxWidth: 300,\n minWidth: 200,\n width: '100%',\n }}\n >\n <ListItem\n divider\n >\n <ListItemText\n primary={t('Frontend version')}\n secondary={ConfigService.getInstance().config.getSoftwareVersion()}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n divider\n >\n <ListItemText\n primary={t('Backend version')}\n secondary={BackendVersionService.getInstance().version}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n divider\n >\n <ListItemButton\n onClick={onCopyVersionInformationButtonClick}\n >\n <ListItemIcon>\n {isCopied ? <DoneIcon color={'success'} /> : <ContentCopyIcon color={'secondary'} />}\n </ListItemIcon>\n <ListItemText\n primary={t`Copy version information to clipboard`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n </ListItem>\n <ListItem>\n <ListItemButton\n onClick={onShowLicenseInformationButtonClick}\n >\n <ListItemIcon>\n <CopyrightIcon color={'secondary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`Show license information`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n <LicensesDialog\n ref={licensesDialogRef}\n />\n </ListItem>\n\n </List>\n </Popover>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport CodeIcon from '@mui/icons-material/Code';\nimport {\n useCallback,\n useState,\n} from 'react';\nimport type { MouseEvent } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { InfoMenu } from './InfoMenu';\n\nexport const ApplicationBarActionsInfoItem = () => {\n const [infoMenuAnchorElement, setInfoMenuAnchorElement] = useState<HTMLElement | null>(null);\n const { t } = useTranslation();\n const theme = useTheme();\n\n const onInfoMenuIconClick = useCallback((event: MouseEvent<HTMLElement>): void => {\n setInfoMenuAnchorElement(event.currentTarget);\n }, []);\n\n const onInfoMenuClose = useCallback(() => {\n setInfoMenuAnchorElement(null);\n }, []);\n\n return (\n <>\n <IconButton\n color={'inherit'}\n onClick={onInfoMenuIconClick}\n title={'Code information'}\n >\n <CodeIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Code information`}\n </Box>\n </IconButton>\n {infoMenuAnchorElement && (\n <InfoMenu\n anchorElement={infoMenuAnchorElement}\n onClose={onInfoMenuClose}\n />\n )}\n\n </>\n );\n};\n","import {\n Badge,\n Box,\n CircularProgress,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport NotificationsIcon from '@mui/icons-material/Notifications';\nimport { useTranslation } from 'react-i18next';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationsDrawer } from '../Notifications';\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\n\nexport const ApplicationBarActionsNotificationsItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const notifications = useSubscribable(NotificationService.getInstance());\n const isLoading = useMemo(() => notifications.some(x => x.isLoading), [notifications]);\n const [open, setOpen] = useState(false);\n\n\n const onMenuIconClick = useCallback(() => {\n NotificationService.getInstance().hideAllNotifications();\n setOpen(true);\n }, []);\n\n const onDrawerClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <>\n <IconButton\n aria-label={t`Notifications`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Notifications`}\n >\n <Badge\n badgeContent={notifications.length}\n color={'secondary'}\n sx={{ '& .MuiBadge-badge': { border: '1px solid white', fontSize: 9, height: 15, minWidth: 15 } }}\n >\n <NotificationsIcon color={'inherit'} />\n </Badge>\n {isLoading && (\n <CircularProgress\n color={'inherit'}\n size={theme.spacing(3.5)}\n sx={{\n position: 'absolute',\n }}\n />\n )}\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Notifications`}\n </Box>\n </IconButton>\n <NotificationsDrawer\n onDrawerClose={onDrawerClose}\n open={open}\n />\n </>\n );\n};\n","import {\n Badge,\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport ConstructionIcon from '@mui/icons-material/Construction';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\n\nimport { OutagesDialog } from '../OutagesDialog';\nimport type { OutagesDialogRefMethods } from '../OutagesDialog';\nimport { outagesStore } from '../../../stores/outagesStore';\n\nexport const ApplicationBarActionsOutagesItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const outagesDialogRef = useRef<OutagesDialogRefMethods>(null);\n const visibleOutages = useStore(outagesStore, (state) => state.visibleOutages);\n const activeOutages = useStore(outagesStore, (state) => state.activeOutages);\n const soonActiveOutages = useStore(outagesStore, (state) => state.soonActiveOutages);\n\n\n const badgeContent = useMemo<string>(() => {\n if (activeOutages.length > 0 || visibleOutages.length > 0 || soonActiveOutages.length > 0) {\n return '!';\n }\n return null;\n }, [activeOutages.length, soonActiveOutages.length, visibleOutages.length]);\n\n const onMenuIconClick = useCallback(() => {\n outagesDialogRef.current.open();\n }, []);\n\n\n return (\n <>\n <IconButton\n aria-label={t`Outages`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Outages`}\n >\n <Badge\n badgeContent={badgeContent}\n color={'secondary'}\n sx={{ '& .MuiBadge-badge': { border: '1px solid white', fontSize: 9, height: 15, minWidth: 15 } }}\n >\n <ConstructionIcon color={'inherit'} />\n </Badge>\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Outages`}\n </Box>\n </IconButton>\n <OutagesDialog ref={outagesDialogRef} />\n </>\n );\n};\n","import {\n Link,\n ListItem,\n ListItemText,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\n\nimport { withPermissions } from '../../../hoc/withPermissions';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { ApiService } from '../../../classes/services/ApiService';\n\nexport const UserOrganizationAdminMenuItem = withPermissions(() => {\n const { t } = useTranslation();\n\n const { data: organizationAdminNameEmails, error: organizationAdminNameEmailsError, isLoading: isOrganizationAdminNameEmailsLoading } = useQueryMemo({\n gcTime: 0,\n queryFn: async ({ signal }) => (await ApiService.getInstance().abacApi.retrieveOrganizationAdminNameEmails({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.ORGANIZATION_ADMIN_NAME_EMAILS),\n staleTime: 0,\n });\n\n return (\n <ListItem\n alignItems={'center'}\n sx={{\n justifyContent: 'center',\n paddingTop: 0,\n }}\n >\n <ListItemText\n primary={t`My organizations admins`}\n secondary={(\n <>\n {isOrganizationAdminNameEmailsLoading && t`Loading...`}\n {organizationAdminNameEmailsError && t`Error`}\n {organizationAdminNameEmails?.map(admin => (\n <Link\n href={`mailto:${admin.email}`}\n key={admin.id}\n sx={{\n display: 'table',\n }}\n >\n {admin.name ?? admin.email}\n </Link>\n ))}\n </>\n )}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n );\n}, {\n requiredPermissions: [\n { command_name: CommonDbCommandName.RetrieveOrganizationAdminNameEmailsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ],\n});\n","import {\n ListItem,\n ListItemText,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport { useMemo } from 'react';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\n\nimport { withPermissions } from '../../../hoc/withPermissions';\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport { useOrganizationMapQuery } from '../../../dataHooks/useOrganizationsQuery';\n\nexport const UserOwnOrganizationMenuItem = withPermissions(() => {\n const { t } = useTranslation();\n\n const organizationMapQuery = useOrganizationMapQuery();\n\n const userOrganization = useMemo(() => {\n if (organizationMapQuery.isLoading) {\n return t`Loading...`;\n }\n if (organizationMapQuery.error) {\n return t`Error`;\n }\n return organizationMapQuery.map.get(AuthorizationService.getInstance().user?.organization_id ?? '')?.name ?? t`Unknown`;\n }, [organizationMapQuery, t]);\n\n return (\n <ListItem\n sx={{\n paddingBottom: 0,\n }}\n >\n <ListItemText\n primary={t`My organization`}\n secondary={userOrganization ?? t`Unknown`}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n );\n}, {\n requiredPermissions: [\n { command_name: CommonDbCommandName.RetrieveOrganizationAdminNameEmailsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ],\n});\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport {\n Box,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Popover,\n} from '@mui/material';\nimport LogoutIcon from '@mui/icons-material/Logout';\nimport KeyIcon from '@mui/icons-material/Key';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\n\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport type { MyPermissionsDialogRefMethods } from '../MyPermissionsDialog';\nimport { MyPermissionsDialog } from '../MyPermissionsDialog';\nimport { UserUtil } from '../../../utils/UserUtil';\n\nimport { UserOrganizationAdminMenuItem } from './UserOrganizationAdminMenuItem';\nimport { UserOwnOrganizationMenuItem } from './UserOwnOrganizationMenuItem';\n\ntype UserMenuProps = {\n readonly anchorElement: HTMLElement;\n readonly onClose: () => void;\n};\n\nexport const UserMenu = ({ anchorElement, onClose }: UserMenuProps): ReactElement => {\n const auth = useAuth();\n const logoutConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const popoverId = useMemo(() => StringUtil.createUuid(), []);\n const isUserMenuOpen = !!anchorElement;\n const { t } = useTranslation();\n\n const myPermissionsDialogRef = useRef<MyPermissionsDialogRefMethods>(null);\n\n const onViewMyPermissionsButtonClick = useCallback(() => {\n myPermissionsDialogRef.current.open();\n }, []);\n\n const onLogoutButtonClick = useCallback(() => {\n logoutConfirmationRef.current.open();\n }, []);\n\n const onLogoutConfirmationConfirm = useCallback(() => {\n LogService.getInstance().log([{\n detail: auth.user,\n level: CommonDbLogLevel.TRACE,\n topic: 'USER_LOGOUT',\n }]);\n LogService.getInstance().flushLog();\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n auth.signoutRedirect();\n }, [auth]);\n\n const userName = useMemo(() => {\n return UserUtil.getUserDisplayValue(AuthorizationService.getInstance().user, t);\n }, [t]);\n\n const userRoles = useMemo(() => {\n return AuthorizationService.getInstance().user?.roles;\n }, []);\n\n return (\n <Popover\n {...TestIdUtil.createAttributes('UserMenu')}\n anchorEl={anchorElement}\n anchorOrigin={{\n horizontal: 'right',\n vertical: 'bottom',\n }}\n id={isUserMenuOpen ? popoverId : undefined}\n onClose={onClose}\n open={isUserMenuOpen}\n transformOrigin={{\n horizontal: 'right',\n vertical: 'top',\n }}\n >\n <List\n sx={{\n maxWidth: 300,\n minWidth: 200,\n width: '100%',\n }}\n >\n <ListItem\n divider\n >\n <ListItemText\n primary={userName ?? t`Unknown`}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <UserOwnOrganizationMenuItem />\n <UserOrganizationAdminMenuItem />\n <ListItem\n divider\n sx={{\n paddingTop: 0,\n }}\n >\n <ListItemText\n primary={t`My roles`}\n secondary={(\n <>\n {userRoles?.map((role) => (\n <Box\n component={'span'}\n key={role}\n sx={{\n display: 'inline-block',\n marginRight: 1,\n }}\n >\n {role}\n </Box>\n ))}\n </>\n )}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n alignItems={'center'}\n divider\n sx={{ justifyContent: 'center' }}\n >\n <ListItemButton\n onClick={onViewMyPermissionsButtonClick}\n >\n <ListItemIcon>\n <KeyIcon color={'primary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`My API permissions`}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n },\n },\n }}\n />\n </ListItemButton>\n <MyPermissionsDialog\n ref={myPermissionsDialogRef}\n />\n </ListItem>\n <ListItem\n alignItems={'center'}\n sx={{ justifyContent: 'center' }}\n >\n <ListItemButton\n onClick={onLogoutButtonClick}\n >\n <ListItemIcon>\n <LogoutIcon color={'secondary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`Logout`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n <Confirmation\n body={t`Click the logout button to logout`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Logout`}\n onConfirm={onLogoutConfirmationConfirm}\n ref={logoutConfirmationRef}\n title={t`Are you sure you want to logout?`}\n />\n </ListItem>\n </List>\n </Popover>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport AccountCircleIcon from '@mui/icons-material/AccountCircle';\nimport {\n useCallback,\n useState,\n} from 'react';\nimport type { MouseEvent } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { UserMenu } from './UserMenu';\n\nexport const ApplicationBarActionsUserItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const [accountMenuAnchorElement, setAccountMenuAnchorElement] = useState<HTMLElement | null>(null);\n\n const onAccountMenuIconClick = useCallback((event: MouseEvent<HTMLElement>): void => {\n setAccountMenuAnchorElement(event.currentTarget);\n }, []);\n\n const onAccountMenuClose = useCallback(() => {\n setAccountMenuAnchorElement(null);\n }, []);\n\n return (\n <>\n <IconButton\n color={'inherit'}\n onClick={onAccountMenuIconClick}\n title={'Account'}\n >\n <AccountCircleIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Account`}\n </Box>\n </IconButton>\n {accountMenuAnchorElement && (\n <UserMenu\n anchorElement={accountMenuAnchorElement}\n onClose={onAccountMenuClose}\n />\n )}\n\n </>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useRef,\n} from 'react';\nimport ChangeCircleIcon from '@mui/icons-material/ChangeCircle';\nimport { useTranslation } from 'react-i18next';\n\nimport { OrganizationSwitcherDialog } from '../OrganizationSwitcherDialog';\nimport type { OrganizationSwitcherDialogRefMethods } from '../OrganizationSwitcherDialog';\nimport { FeatureFlagsService } from '../../../classes/services/FeatureFlagsService';\n\n\nexport const ApplicationBarActionsOrganizationSwitcherItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const organizationSwitcherDialogRef = useRef<OrganizationSwitcherDialogRefMethods>(null);\n\n\n const onMenuIconClick = useCallback(() => {\n organizationSwitcherDialogRef.current.open();\n }, []);\n\n if (!FeatureFlagsService.getInstance().featureFlags.update_own_organization) {\n return null;\n }\n\n return (\n <>\n <IconButton\n aria-label={t`Change organization`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Change organization`}\n >\n <ChangeCircleIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Change organization`}\n </Box>\n </IconButton>\n <OrganizationSwitcherDialog ref={organizationSwitcherDialogRef} />\n </>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport { useTranslation } from 'react-i18next';\nimport {\n useCallback,\n useEffect,\n useId,\n useState,\n} from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nimport { ApplicationBarActionsFeedbackItem } from './ApplicationBarActionsFeedbackItem';\nimport { ApplicationBarActionsInfoItem } from './ApplicationBarActionsInfotem';\nimport { ApplicationBarActionsNotificationsItem } from './ApplicationBarActionsNotificationsItem';\nimport { ApplicationBarActionsOutagesItem } from './ApplicationBarActionsOutagesItem';\nimport { ApplicationBarActionsUserItem } from './ApplicationBarActionsUserItem';\nimport { ApplicationBarActionsOrganizationSwitcherItem } from './ApplicationBarActionsOrganizationSwitcherItem';\n\nexport type ApplicationBarActionsProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationBarActions = ({ fullWidth }: ApplicationBarActionsProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n const environmentMessage = ConfigService.getInstance().config.getEnvironmentMessage();\n const navId = useId();\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n return (\n <Box\n {...TestIdUtil.createAttributes('ApplicationBarActions')}\n sx={{\n alignItems: 'center',\n display: 'flex',\n paddingRight: 1,\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MoreVertIcon />\n </IconButton>\n <Box\n id={navId}\n sx={{\n display: 'flex',\n [theme.breakpoints.down('md')]: {\n alignItems: 'start',\n background: theme['gen-epix-ui'].navbar.background,\n display: isMenuOpen ? 'flex' : 'none',\n flexDirection: 'column',\n left: 0,\n position: 'absolute',\n right: 0,\n top: theme.spacing(6),\n zIndex: theme.zIndex.appBar - 1,\n },\n }}\n >\n <ApplicationBarActionsFeedbackItem />\n <ApplicationBarActionsOutagesItem />\n <ApplicationBarActionsNotificationsItem />\n <ApplicationBarActionsInfoItem />\n <ApplicationBarActionsOrganizationSwitcherItem />\n <ApplicationBarActionsUserItem />\n {environmentMessage && (\n <Box\n {...TestIdUtil.createAttributes('ApplicationBarActions-EnvironmentMessage')}\n aria-hidden={'true'}\n sx={{\n alignItems: 'center',\n color: theme['gen-epix-ui'].navbar.environmentMessageColor,\n display: 'flex',\n fontWeight: 700,\n marginRight: fullWidth ? 0 : 1,\n padding: `0 ${theme.spacing(1)} !important`,\n textTransform: 'uppercase',\n [theme.breakpoints.down('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t('{{environmentMessage}}', { environmentMessage })}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n","import {\n AppBar,\n Box,\n Container,\n Toolbar,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nimport { ApplicationBarNavigationMenu } from './ApplicationBarNavigationMenu';\nimport { ApplicationBarActions } from './ApplicationBarActions';\n\nexport type ApplicationBarProps = {\n readonly fullHeight?: boolean;\n readonly fullWidth?: boolean;\n readonly singleAction?: boolean;\n};\n\nexport const ApplicationBar = ({\n fullWidth,\n singleAction,\n}: ApplicationBarProps) => {\n const theme = useTheme();\n\n return (\n <AppBar\n {...TestIdUtil.createAttributes('ApplicationBar')}\n position={'static'}\n square\n sx={{\n background: theme['gen-epix-ui'].navbar.background,\n boxShadow: 'none',\n }}\n >\n <Container\n disableGutters\n maxWidth={fullWidth ? false : 'xl'}\n >\n <Toolbar\n disableGutters\n sx={{\n height: 48,\n justifyContent: singleAction ? 'center' : 'space-between',\n minHeight: '48px !important',\n }}\n >\n {singleAction && (\n <Box\n sx={{\n marginX: 2,\n }}\n >\n <Typography\n component={'h1'}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n fontSize: '1.3rem',\n }}\n variant={'body2'}\n >\n {ConfigService.getInstance().config.applicationName}\n </Typography>\n </Box>\n )}\n {!singleAction && (\n <>\n <ApplicationBarNavigationMenu fullWidth={fullWidth} />\n <ApplicationBarActions fullWidth={fullWidth} />\n </>\n )}\n </Toolbar>\n </Container>\n </AppBar>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,KAAU,EAAO,CAAW,CAAC,EAAE,EAAE,gBAAa;CAClD,WAAW,EACT,gBAAgB,YAClB;CACA,OAAO,EAAM,QAAQ,UAAU;CAC/B,SAAS;CACT,UAAU;CACV,gBAAgB;AAClB,EAAE,GAMW,MAAgC,EAAE,mBAAmD;CAChG,IAAM,EAAE,MAAM,EAAe,GACvB,IAAQ,EAAS,GACjB,IAAuB,QAAc,EAAqB,YAAY,GAAG,CAAC,CAAC,GAC3E,IAAQ,EAAM,GAEd,IAAY,QAAc;EAC9B,IAAM,IAAW,EAAc,YAAY,CAAC,CAAC,OAAO,MAAK,MAAK,EAAE,OAAO,IAAI;EAC3E,OAAO,CAAC,GAAU,GAAG,EAAS,SAAS,QAAO,MAAK,CAAC,EAAE,OAAO,MAAM,CAAC;CACtE,GAAG,CAAC,CAAC,GAEC,CAAC,GAAY,KAAiB,EAAS,EAAK;CAElD,QAAgB;EACd,IAAI,GAAY;GACd,IAAM,KAAiB,MAAyB;IAC9C,AAAI,EAAM,QAAQ,YAChB,EAAc,EAAK;GAEvB;GAEA,OADA,SAAS,iBAAiB,WAAW,CAAa,SACrC;IACX,SAAS,oBAAoB,WAAW,CAAa;GACvD;EACF;CACF,GAAG,CAAC,CAAU,CAAC;CAEf,IAAM,IAAoB,QAAkB;EAC1C,GAAc,MAAK,CAAC,CAAC;CACvB,GAAG,CAAC,CAAC;CAEL,OACE,kBAAC,GAAD;EACE,IAAI,EACF,UAAU,EACZ;EAHF,UAAA,CA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AAO,EAAM,cAAc,CAAC,OAAO;OACnC,UAAU;MACZ;MACA,SAAS;MAER,UAAA,EAAc,YAAY,CAAC,CAAC,OAAO;KAC1B,CAAA;IACT,CAAA,GAEN,CAAC,KACA,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,IAAD,EAAyC,aAAY,CAAA,GACrD,kBAAC,IAAD,EAAkC,aAAY,CAAA,CAC9C,EAAA,CAAA,CAEG;;EACA,CAAA;CACL,CAAA;AAEZ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/ApplicationBar/ApplicationBarNavigationMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.tsx","../../../../src/components/ui/ApplicationBar/InfoMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsInfotem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.tsx","../../../../src/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.tsx","../../../../src/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.tsx","../../../../src/components/ui/ApplicationBar/UserMenu.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsUserItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBarActions.tsx","../../../../src/components/ui/ApplicationBar/ApplicationBar.tsx"],"sourcesContent":["import {\n Box,\n IconButton,\n styled,\n useTheme,\n} from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport { useTranslation } from 'react-i18next';\nimport { NavLink as BaseNavLink } from 'react-router-dom';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport type { MyNonIndexRouteObject } from '../../../models/reactRouter';\nimport { RouterService } from '../../../classes/services/RouterService';\n\nconst NavLink = styled(BaseNavLink)(({ theme }) => ({\n '&:hover': {\n textDecoration: 'underline',\n },\n color: theme.palette.secondary.contrastText,\n display: 'inline-block',\n fontSize: '1.3rem',\n textDecoration: 'none',\n}));\n\nexport type ApplicationBarNavigationMenuProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationBarNavigationMenu = ({ fullWidth }: ApplicationBarNavigationMenuProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const authorizationService = useMemo(() => AuthorizationService.getInstance(), []);\n const navId = useId();\n\n const menuItems = useMemo(() => {\n const rootItem = RouterService.getInstance().routes.find(r => r.handle.root);\n return [rootItem, ...rootItem.children.filter(r => !r.handle.hidden)] as MyNonIndexRouteObject[];\n }, []);\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n const onNavLinkClick = useCallback((event: MouseEvent<HTMLAnchorElement>) => {\n if (event.currentTarget.ariaDisabled === 'true') {\n event.preventDefault();\n }\n }, []);\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle navigation menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MenuIcon />\n </IconButton>\n <Box\n component={'nav'}\n id={navId}\n sx={{\n flexGrow: 1,\n [theme.breakpoints.down('md')]: {\n background: theme['gen-epix-ui'].navbar.background,\n display: isMenuOpen ? 'block' : 'none',\n left: 0,\n paddingBottom: 4,\n position: 'absolute',\n top: 48,\n width: '100%',\n },\n }}\n >\n <Box\n component={'ul'}\n sx={{\n display: 'flex',\n margin: 0,\n marginLeft: fullWidth ? 0 : 2,\n padding: 0,\n [theme.breakpoints.down('md')]: {\n display: 'block',\n margin: 0,\n },\n }}\n >\n {menuItems.filter(menuItem => authorizationService.doesUserHavePermissionForRoute(menuItem)).map(menuItem => {\n const isDisabled = !!menuItem.handle.disabled;\n return (\n <Box\n component={'li'}\n key={menuItem.path}\n sx={{\n '&:has(.active:not([aria-disabled=\"true\"]))': {\n '& svg': {\n color: theme['gen-epix-ui'].navbar.activeColor,\n },\n a: {\n color: theme['gen-epix-ui'].navbar.activeColor,\n },\n background: theme['gen-epix-ui'].navbar.activeBackground,\n },\n '& svg': {\n color: isDisabled ? theme.palette.grey[400] : undefined,\n marginTop: '6px',\n },\n alignItems: 'center',\n color: isDisabled ? theme.palette.grey[400] : theme['gen-epix-ui'].navbar.primaryColor,\n display: 'flex',\n fontWeight: 800,\n height: 48,\n listStyle: 'none',\n padding: `0 ${theme.spacing(1)}`,\n }}\n >\n <NavLink\n aria-disabled={isDisabled || undefined}\n aria-label={menuItem.handle.title}\n onClick={onNavLinkClick}\n sx={{\n '&:hover': {\n textDecoration: isDisabled ? 'none' : undefined,\n },\n color: isDisabled ? theme.palette.grey[400] : undefined,\n cursor: isDisabled ? 'not-allowed' : undefined,\n padding: `0 ${theme.spacing(1)}`,\n }}\n tabIndex={isDisabled ? -1 : undefined}\n to={menuItem.path}\n >\n {!!menuItem.handle.icon && menuItem.handle.icon}\n {!menuItem.handle.icon && menuItem.handle.title}\n </NavLink>\n </Box>\n );\n })}\n </Box>\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n IconButton,\n Tooltip,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport ChatIcon from '@mui/icons-material/Chat';\n\nimport { UserSettingsService } from '../../../classes/services/UserSettingsService';\nimport { UserFeedbackDialog } from '../UserFeedbackDialog';\nimport type { UserFeedbackDialogRefMethods } from '../UserFeedbackDialog';\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nconst NOW = new Date().getTime();\n\nexport const ApplicationBarActionsFeedbackItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const userFeedbackDialogRef = useRef<UserFeedbackDialogRefMethods>(null);\n const [isFeedbackTooltipOpen, setIsFeedbackTooltipOpen] = useState(false);\n useEffect(() => {\n if (!UserSettingsService.getInstance().showShowUserFeedbackTooltip) {\n return;\n }\n const timeoutMs = Math.max(0, ConfigService.getInstance().config.userFeedback.SHOW_USER_FEEDBACK_TOOLTIP_AFTER_MS - (new Date().getTime() - NOW));\n const handle = setTimeout(() => {\n setIsFeedbackTooltipOpen(true);\n }, timeoutMs);\n return () => {\n clearTimeout(handle);\n };\n }, []);\n\n const onUserFeedbackMenuIconClick = useCallback(() => {\n userFeedbackDialogRef.current.open();\n }, []);\n\n const onTooltipMouseEnter = useCallback(() => {\n setIsFeedbackTooltipOpen(false);\n UserSettingsService.getInstance().showShowUserFeedbackTooltip = false;\n }, []);\n\n return (\n <>\n <Tooltip\n arrow\n color={'secondary'}\n onMouseEnter={onTooltipMouseEnter}\n open={isFeedbackTooltipOpen}\n placement={'left'}\n slotProps={{\n arrow: {\n sx: {\n color: theme.palette.secondary.main,\n },\n },\n popper: {\n disablePortal: true,\n },\n tooltip: {\n sx: {\n backgroundColor: theme.palette.secondary.main,\n marginRight: `${theme.spacing(0.5)} !important`,\n },\n },\n }}\n title={t`Would you like to share your feedback?`}\n >\n <IconButton\n aria-label={t`Feedback`}\n color={'inherit'}\n onClick={onUserFeedbackMenuIconClick}\n >\n <ChatIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Feedback`}\n </Box>\n </IconButton>\n </Tooltip>\n <UserFeedbackDialog ref={userFeedbackDialogRef} />\n </>\n );\n};\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Popover,\n} from '@mui/material';\nimport CopyrightIcon from '@mui/icons-material/Copyright';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport DoneIcon from '@mui/icons-material/Done';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type { LicensesDialogRefMethods } from '../LicensesDialog';\nimport { LicensesDialog } from '../LicensesDialog';\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\ntype InfoMenuProps = {\n readonly anchorElement: HTMLElement;\n readonly onClose: () => void;\n};\n\nexport const InfoMenu = ({ anchorElement, onClose }: InfoMenuProps): ReactElement => {\n const popoverId = useMemo(() => StringUtil.createUuid(), []);\n const licensesDialogRef = useRef<LicensesDialogRefMethods>(null);\n const isInfoMenuOpen = !!anchorElement;\n const { t } = useTranslation();\n const [isCopied, setIsCopied] = useState(false);\n const onShowLicenseInformationButtonClick = useCallback(() => {\n licensesDialogRef.current.open();\n }, []);\n\n const onCopyVersionInformationButtonClick = useCallback(async () => {\n const versionInformation = `Frontend version: ${ConfigService.getInstance().config.getSoftwareVersion()}\\nBackend version: ${BackendVersionService.getInstance().version}\\nURL: ${window.location.href}\\nDate/time: ${new Date().toISOString()}`;\n await navigator.clipboard.writeText(versionInformation);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n }, []);\n\n return (\n <Popover\n {...TestIdUtil.createAttributes('InfoMenu')}\n anchorEl={anchorElement}\n anchorOrigin={{\n horizontal: 'right',\n vertical: 'bottom',\n }}\n id={isInfoMenuOpen ? popoverId : undefined}\n onClose={onClose}\n open={isInfoMenuOpen}\n transformOrigin={{\n horizontal: 'right',\n vertical: 'top',\n }}\n >\n <List\n sx={{\n maxWidth: 300,\n minWidth: 200,\n width: '100%',\n }}\n >\n <ListItem\n divider\n >\n <ListItemText\n primary={t('Frontend version')}\n secondary={ConfigService.getInstance().config.getSoftwareVersion()}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n divider\n >\n <ListItemText\n primary={t('Backend version')}\n secondary={BackendVersionService.getInstance().version}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n divider\n >\n <ListItemButton\n onClick={onCopyVersionInformationButtonClick}\n >\n <ListItemIcon>\n {isCopied ? <DoneIcon color={'success'} /> : <ContentCopyIcon color={'secondary'} />}\n </ListItemIcon>\n <ListItemText\n primary={t`Copy version information to clipboard`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n </ListItem>\n <ListItem>\n <ListItemButton\n onClick={onShowLicenseInformationButtonClick}\n >\n <ListItemIcon>\n <CopyrightIcon color={'secondary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`Show license information`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n <LicensesDialog\n ref={licensesDialogRef}\n />\n </ListItem>\n\n </List>\n </Popover>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport CodeIcon from '@mui/icons-material/Code';\nimport {\n useCallback,\n useState,\n} from 'react';\nimport type { MouseEvent } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { InfoMenu } from './InfoMenu';\n\nexport const ApplicationBarActionsInfoItem = () => {\n const [infoMenuAnchorElement, setInfoMenuAnchorElement] = useState<HTMLElement | null>(null);\n const { t } = useTranslation();\n const theme = useTheme();\n\n const onInfoMenuIconClick = useCallback((event: MouseEvent<HTMLElement>): void => {\n setInfoMenuAnchorElement(event.currentTarget);\n }, []);\n\n const onInfoMenuClose = useCallback(() => {\n setInfoMenuAnchorElement(null);\n }, []);\n\n return (\n <>\n <IconButton\n color={'inherit'}\n onClick={onInfoMenuIconClick}\n title={'Code information'}\n >\n <CodeIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Code information`}\n </Box>\n </IconButton>\n {infoMenuAnchorElement && (\n <InfoMenu\n anchorElement={infoMenuAnchorElement}\n onClose={onInfoMenuClose}\n />\n )}\n\n </>\n );\n};\n","import {\n Badge,\n Box,\n CircularProgress,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport NotificationsIcon from '@mui/icons-material/Notifications';\nimport { useTranslation } from 'react-i18next';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { NotificationsDrawer } from '../Notifications';\nimport { NotificationService } from '../../../classes/services/NotificationService';\n\n\nexport const ApplicationBarActionsNotificationsItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const notifications = useSubscribable(NotificationService.getInstance());\n const isLoading = useMemo(() => notifications.some(x => x.isLoading), [notifications]);\n const [open, setOpen] = useState(false);\n\n\n const onMenuIconClick = useCallback(() => {\n NotificationService.getInstance().hideAllNotifications();\n setOpen(true);\n }, []);\n\n const onDrawerClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <>\n <IconButton\n aria-label={t`Notifications`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Notifications`}\n >\n <Badge\n badgeContent={notifications.length}\n color={'secondary'}\n sx={{ '& .MuiBadge-badge': { border: '1px solid white', fontSize: 9, height: 15, minWidth: 15 } }}\n >\n <NotificationsIcon color={'inherit'} />\n </Badge>\n {isLoading && (\n <CircularProgress\n color={'inherit'}\n size={theme.spacing(3.5)}\n sx={{\n position: 'absolute',\n }}\n />\n )}\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Notifications`}\n </Box>\n </IconButton>\n <NotificationsDrawer\n onDrawerClose={onDrawerClose}\n open={open}\n />\n </>\n );\n};\n","import {\n Badge,\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport ConstructionIcon from '@mui/icons-material/Construction';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\n\nimport { OutagesDialog } from '../OutagesDialog';\nimport type { OutagesDialogRefMethods } from '../OutagesDialog';\nimport { outagesStore } from '../../../stores/outagesStore';\n\nexport const ApplicationBarActionsOutagesItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const outagesDialogRef = useRef<OutagesDialogRefMethods>(null);\n const visibleOutages = useStore(outagesStore, (state) => state.visibleOutages);\n const activeOutages = useStore(outagesStore, (state) => state.activeOutages);\n const soonActiveOutages = useStore(outagesStore, (state) => state.soonActiveOutages);\n\n\n const badgeContent = useMemo<string>(() => {\n if (activeOutages.length > 0 || visibleOutages.length > 0 || soonActiveOutages.length > 0) {\n return '!';\n }\n return null;\n }, [activeOutages.length, soonActiveOutages.length, visibleOutages.length]);\n\n const onMenuIconClick = useCallback(() => {\n outagesDialogRef.current.open();\n }, []);\n\n\n return (\n <>\n <IconButton\n aria-label={t`Outages`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Outages`}\n >\n <Badge\n badgeContent={badgeContent}\n color={'secondary'}\n sx={{ '& .MuiBadge-badge': { border: '1px solid white', fontSize: 9, height: 15, minWidth: 15 } }}\n >\n <ConstructionIcon color={'inherit'} />\n </Badge>\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Outages`}\n </Box>\n </IconButton>\n <OutagesDialog ref={outagesDialogRef} />\n </>\n );\n};\n","import {\n Link,\n ListItem,\n ListItemText,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\n\nimport { withPermissions } from '../../../hoc/withPermissions';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { ApiService } from '../../../classes/services/ApiService';\n\nexport const UserOrganizationAdminMenuItem = withPermissions(() => {\n const { t } = useTranslation();\n\n const { data: organizationAdminNameEmails, error: organizationAdminNameEmailsError, isLoading: isOrganizationAdminNameEmailsLoading } = useQueryMemo({\n gcTime: 0,\n queryFn: async ({ signal }) => (await ApiService.getInstance().abacApi.retrieveOrganizationAdminNameEmails({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.ORGANIZATION_ADMIN_NAME_EMAILS),\n staleTime: 0,\n });\n\n return (\n <ListItem\n alignItems={'center'}\n sx={{\n justifyContent: 'center',\n paddingTop: 0,\n }}\n >\n <ListItemText\n primary={t`My organizations admins`}\n secondary={(\n <>\n {isOrganizationAdminNameEmailsLoading && t`Loading...`}\n {organizationAdminNameEmailsError && t`Error`}\n {organizationAdminNameEmails?.map(admin => (\n <Link\n href={`mailto:${admin.email}`}\n key={admin.id}\n sx={{\n display: 'table',\n }}\n >\n {admin.name ?? admin.email}\n </Link>\n ))}\n </>\n )}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n );\n}, {\n requiredPermissions: [\n { command_name: CommonDbCommandName.RetrieveOrganizationAdminNameEmailsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ],\n});\n","import {\n ListItem,\n ListItemText,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport { useMemo } from 'react';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\n\nimport { withPermissions } from '../../../hoc/withPermissions';\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport { useOrganizationMapQuery } from '../../../dataHooks/useOrganizationsQuery';\n\nexport const UserOwnOrganizationMenuItem = withPermissions(() => {\n const { t } = useTranslation();\n\n const organizationMapQuery = useOrganizationMapQuery();\n\n const userOrganization = useMemo(() => {\n if (organizationMapQuery.isLoading) {\n return t`Loading...`;\n }\n if (organizationMapQuery.error) {\n return t`Error`;\n }\n return organizationMapQuery.map.get(AuthorizationService.getInstance().user?.organization_id ?? '')?.name ?? t`Unknown`;\n }, [organizationMapQuery, t]);\n\n return (\n <ListItem\n sx={{\n paddingBottom: 0,\n }}\n >\n <ListItemText\n primary={t`My organization`}\n secondary={userOrganization ?? t`Unknown`}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n );\n}, {\n requiredPermissions: [\n { command_name: CommonDbCommandName.RetrieveOrganizationAdminNameEmailsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ],\n});\n","import type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport {\n Box,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Popover,\n} from '@mui/material';\nimport LogoutIcon from '@mui/icons-material/Logout';\nimport KeyIcon from '@mui/icons-material/Key';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\n\nimport { AuthorizationService } from '../../../classes/services/AuthorizationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport type { MyPermissionsDialogRefMethods } from '../MyPermissionsDialog';\nimport { MyPermissionsDialog } from '../MyPermissionsDialog';\nimport { UserUtil } from '../../../utils/UserUtil';\n\nimport { UserOrganizationAdminMenuItem } from './UserOrganizationAdminMenuItem';\nimport { UserOwnOrganizationMenuItem } from './UserOwnOrganizationMenuItem';\n\ntype UserMenuProps = {\n readonly anchorElement: HTMLElement;\n readonly onClose: () => void;\n};\n\nexport const UserMenu = ({ anchorElement, onClose }: UserMenuProps): ReactElement => {\n const auth = useAuth();\n const logoutConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const popoverId = useMemo(() => StringUtil.createUuid(), []);\n const isUserMenuOpen = !!anchorElement;\n const { t } = useTranslation();\n\n const myPermissionsDialogRef = useRef<MyPermissionsDialogRefMethods>(null);\n\n const onViewMyPermissionsButtonClick = useCallback(() => {\n myPermissionsDialogRef.current.open();\n }, []);\n\n const onLogoutButtonClick = useCallback(() => {\n logoutConfirmationRef.current.open();\n }, []);\n\n const onLogoutConfirmationConfirm = useCallback(() => {\n LogService.getInstance().log([{\n detail: auth.user,\n level: CommonDbLogLevel.TRACE,\n topic: 'USER_LOGOUT',\n }]);\n LogService.getInstance().flushLog();\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n auth.signoutRedirect();\n }, [auth]);\n\n const userName = useMemo(() => {\n return UserUtil.getUserDisplayValue(AuthorizationService.getInstance().user, t);\n }, [t]);\n\n const userRoles = useMemo(() => {\n return AuthorizationService.getInstance().user?.roles;\n }, []);\n\n return (\n <Popover\n {...TestIdUtil.createAttributes('UserMenu')}\n anchorEl={anchorElement}\n anchorOrigin={{\n horizontal: 'right',\n vertical: 'bottom',\n }}\n id={isUserMenuOpen ? popoverId : undefined}\n onClose={onClose}\n open={isUserMenuOpen}\n transformOrigin={{\n horizontal: 'right',\n vertical: 'top',\n }}\n >\n <List\n sx={{\n maxWidth: 300,\n minWidth: 200,\n width: '100%',\n }}\n >\n <ListItem\n divider\n >\n <ListItemText\n primary={userName ?? t`Unknown`}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <UserOwnOrganizationMenuItem />\n <UserOrganizationAdminMenuItem />\n <ListItem\n divider\n sx={{\n paddingTop: 0,\n }}\n >\n <ListItemText\n primary={t`My roles`}\n secondary={(\n <>\n {userRoles?.map((role) => (\n <Box\n component={'span'}\n key={role}\n sx={{\n display: 'inline-block',\n marginRight: 1,\n }}\n >\n {role}\n </Box>\n ))}\n </>\n )}\n slotProps={{\n primary: {\n sx: {\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItem>\n <ListItem\n alignItems={'center'}\n divider\n sx={{ justifyContent: 'center' }}\n >\n <ListItemButton\n onClick={onViewMyPermissionsButtonClick}\n >\n <ListItemIcon>\n <KeyIcon color={'primary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`My API permissions`}\n slotProps={{\n primary: {\n sx: {\n color: 'primary.main',\n },\n },\n }}\n />\n </ListItemButton>\n <MyPermissionsDialog\n ref={myPermissionsDialogRef}\n />\n </ListItem>\n <ListItem\n alignItems={'center'}\n sx={{ justifyContent: 'center' }}\n >\n <ListItemButton\n onClick={onLogoutButtonClick}\n >\n <ListItemIcon>\n <LogoutIcon color={'secondary'} />\n </ListItemIcon>\n <ListItemText\n primary={t`Logout`}\n slotProps={{\n primary: {\n sx: {\n color: 'secondary.main',\n fontWeight: 'bold',\n },\n },\n }}\n />\n </ListItemButton>\n <Confirmation\n body={t`Click the logout button to logout`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Logout`}\n onConfirm={onLogoutConfirmationConfirm}\n ref={logoutConfirmationRef}\n title={t`Are you sure you want to logout?`}\n />\n </ListItem>\n </List>\n </Popover>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport AccountCircleIcon from '@mui/icons-material/AccountCircle';\nimport {\n useCallback,\n useState,\n} from 'react';\nimport type { MouseEvent } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { UserMenu } from './UserMenu';\n\nexport const ApplicationBarActionsUserItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const [accountMenuAnchorElement, setAccountMenuAnchorElement] = useState<HTMLElement | null>(null);\n\n const onAccountMenuIconClick = useCallback((event: MouseEvent<HTMLElement>): void => {\n setAccountMenuAnchorElement(event.currentTarget);\n }, []);\n\n const onAccountMenuClose = useCallback(() => {\n setAccountMenuAnchorElement(null);\n }, []);\n\n return (\n <>\n <IconButton\n color={'inherit'}\n onClick={onAccountMenuIconClick}\n title={'Account'}\n >\n <AccountCircleIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Account`}\n </Box>\n </IconButton>\n {accountMenuAnchorElement && (\n <UserMenu\n anchorElement={accountMenuAnchorElement}\n onClose={onAccountMenuClose}\n />\n )}\n\n </>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useRef,\n} from 'react';\nimport ChangeCircleIcon from '@mui/icons-material/ChangeCircle';\nimport { useTranslation } from 'react-i18next';\n\nimport { OrganizationSwitcherDialog } from '../OrganizationSwitcherDialog';\nimport type { OrganizationSwitcherDialogRefMethods } from '../OrganizationSwitcherDialog';\nimport { FeatureFlagsService } from '../../../classes/services/FeatureFlagsService';\n\n\nexport const ApplicationBarActionsOrganizationSwitcherItem = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const organizationSwitcherDialogRef = useRef<OrganizationSwitcherDialogRefMethods>(null);\n\n\n const onMenuIconClick = useCallback(() => {\n organizationSwitcherDialogRef.current.open();\n }, []);\n\n if (!FeatureFlagsService.getInstance().featureFlags.update_own_organization) {\n return null;\n }\n\n return (\n <>\n <IconButton\n aria-label={t`Change organization`}\n color={'inherit'}\n onClick={onMenuIconClick}\n title={t`Change organization`}\n >\n <ChangeCircleIcon color={'inherit'} />\n <Box\n sx={{\n fontSize: '1.3rem',\n marginLeft: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t`Change organization`}\n </Box>\n </IconButton>\n <OrganizationSwitcherDialog ref={organizationSwitcherDialogRef} />\n </>\n );\n};\n","import {\n Box,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport { useTranslation } from 'react-i18next';\nimport {\n useCallback,\n useEffect,\n useId,\n useState,\n} from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nimport { ApplicationBarActionsFeedbackItem } from './ApplicationBarActionsFeedbackItem';\nimport { ApplicationBarActionsInfoItem } from './ApplicationBarActionsInfotem';\nimport { ApplicationBarActionsNotificationsItem } from './ApplicationBarActionsNotificationsItem';\nimport { ApplicationBarActionsOutagesItem } from './ApplicationBarActionsOutagesItem';\nimport { ApplicationBarActionsUserItem } from './ApplicationBarActionsUserItem';\nimport { ApplicationBarActionsOrganizationSwitcherItem } from './ApplicationBarActionsOrganizationSwitcherItem';\n\nexport type ApplicationBarActionsProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationBarActions = ({ fullWidth }: ApplicationBarActionsProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n const environmentMessage = ConfigService.getInstance().config.getEnvironmentMessage();\n const navId = useId();\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n return (\n <Box\n {...TestIdUtil.createAttributes('ApplicationBarActions')}\n sx={{\n alignItems: 'center',\n display: 'flex',\n paddingRight: 1,\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MoreVertIcon />\n </IconButton>\n <Box\n id={navId}\n sx={{\n display: 'flex',\n [theme.breakpoints.down('md')]: {\n alignItems: 'start',\n background: theme['gen-epix-ui'].navbar.background,\n display: isMenuOpen ? 'flex' : 'none',\n flexDirection: 'column',\n left: 0,\n position: 'absolute',\n right: 0,\n top: theme.spacing(6),\n zIndex: theme.zIndex.appBar - 1,\n },\n }}\n >\n <ApplicationBarActionsFeedbackItem />\n <ApplicationBarActionsOutagesItem />\n <ApplicationBarActionsNotificationsItem />\n <ApplicationBarActionsInfoItem />\n <ApplicationBarActionsOrganizationSwitcherItem />\n <ApplicationBarActionsUserItem />\n {environmentMessage && (\n <Box\n {...TestIdUtil.createAttributes('ApplicationBarActions-EnvironmentMessage')}\n aria-hidden={'true'}\n sx={{\n alignItems: 'center',\n color: theme['gen-epix-ui'].navbar.environmentMessageColor,\n display: 'flex',\n fontWeight: 700,\n marginRight: fullWidth ? 0 : 1,\n padding: `0 ${theme.spacing(1)} !important`,\n textTransform: 'uppercase',\n [theme.breakpoints.down('md')]: {\n position: 'absolute',\n visibility: 'hidden',\n },\n }}\n >\n {t('{{environmentMessage}}', { environmentMessage })}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n","import {\n AppBar,\n Box,\n Container,\n Toolbar,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { ConfigService } from '../../../classes/services/ConfigService';\n\nimport { ApplicationBarNavigationMenu } from './ApplicationBarNavigationMenu';\nimport { ApplicationBarActions } from './ApplicationBarActions';\n\nexport type ApplicationBarProps = {\n readonly fullHeight?: boolean;\n readonly fullWidth?: boolean;\n readonly singleAction?: boolean;\n};\n\nexport const ApplicationBar = ({\n fullWidth,\n singleAction,\n}: ApplicationBarProps) => {\n const theme = useTheme();\n\n return (\n <AppBar\n {...TestIdUtil.createAttributes('ApplicationBar')}\n position={'static'}\n square\n sx={{\n background: theme['gen-epix-ui'].navbar.background,\n boxShadow: 'none',\n }}\n >\n <Container\n disableGutters\n maxWidth={fullWidth ? false : 'xl'}\n >\n <Toolbar\n disableGutters\n sx={{\n height: 48,\n justifyContent: singleAction ? 'center' : 'space-between',\n minHeight: '48px !important',\n }}\n >\n {singleAction && (\n <Box\n sx={{\n marginX: 2,\n }}\n >\n <Typography\n component={'h1'}\n sx={{\n color: theme['gen-epix-ui'].navbar.primaryColor,\n fontSize: '1.3rem',\n }}\n variant={'body2'}\n >\n {ConfigService.getInstance().config.applicationName}\n </Typography>\n </Box>\n )}\n {!singleAction && (\n <>\n <ApplicationBarNavigationMenu fullWidth={fullWidth} />\n <ApplicationBarActions fullWidth={fullWidth} />\n </>\n )}\n </Toolbar>\n </Container>\n </AppBar>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAM,KAAU,EAAO,CAAW,CAAC,EAAE,EAAE,gBAAa;CAClD,WAAW,EACT,gBAAgB,YAClB;CACA,OAAO,EAAM,QAAQ,UAAU;CAC/B,SAAS;CACT,UAAU;CACV,gBAAgB;AAClB,EAAE,GAMW,MAAgC,EAAE,mBAAmD;CAChG,IAAM,EAAE,MAAM,EAAe,GACvB,IAAQ,EAAS,GACjB,IAAuB,QAAc,EAAqB,YAAY,GAAG,CAAC,CAAC,GAC3E,IAAQ,EAAM,GAEd,IAAY,QAAc;EAC9B,IAAM,IAAW,EAAc,YAAY,CAAC,CAAC,OAAO,MAAK,MAAK,EAAE,OAAO,IAA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AAEZ"}
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
import { ConfigService as e } from "../../../classes/services/ConfigService/index.js";
|
|
2
2
|
import { AxiosUtil as t } from "../../../utils/AxiosUtil/index.js";
|
|
3
3
|
import { PageEventBusService as n } from "../../../classes/services/PageEventBusService/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
4
|
+
import { RouterService as r } from "../../../classes/services/RouterService/index.js";
|
|
5
|
+
import { AuthenticationService as i } from "../../../classes/services/AuthenticationService/index.js";
|
|
6
|
+
import { LogService as a } from "../../../classes/services/LogService/index.js";
|
|
7
|
+
import { CommonDbLogLevel as o } from "@gen-epix/api-commondb";
|
|
8
|
+
import { isAxiosError as s } from "axios";
|
|
9
|
+
import { Box as c, Button as l, Typography as u } from "@mui/material";
|
|
10
|
+
import { useCallback as d, useEffect as f, useMemo as p } from "react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { useTranslation as g } from "react-i18next";
|
|
13
|
+
import { isRouteErrorResponse as _ } from "react-router-dom";
|
|
14
14
|
//#region src/components/ui/GenericErrorMessage/GenericErrorMessage.tsx
|
|
15
15
|
var v = ({ error: v, shouldHideActionButtons: y }) => {
|
|
16
|
-
let { t: b } =
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
let { t: b } = g();
|
|
17
|
+
f(() => {
|
|
18
|
+
v && !s(v) && (a.getInstance().log([{
|
|
19
19
|
detail: {
|
|
20
20
|
error: v,
|
|
21
21
|
stack: v?.stack
|
|
22
22
|
},
|
|
23
|
-
level:
|
|
23
|
+
level: s(v) ? o.DEBUG : o.ERROR,
|
|
24
24
|
topic: v?.message ? `Error: ${v?.message}` : "Error"
|
|
25
|
-
}]),
|
|
25
|
+
}]), a.getInstance().flushLog(), v instanceof Error && e.getInstance().config.enablePageEvents && n.getInstance().emit("error", v));
|
|
26
26
|
}, [v]);
|
|
27
|
-
let x =
|
|
28
|
-
await
|
|
29
|
-
}, []), S =
|
|
30
|
-
await
|
|
31
|
-
}, []), C =
|
|
32
|
-
|
|
33
|
-
}, []), w =
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
27
|
+
let x = d(async () => {
|
|
28
|
+
await r.getInstance().router.navigate({ pathname: "/" });
|
|
29
|
+
}, []), S = d(async () => {
|
|
30
|
+
await r.getInstance().router.navigate(-1);
|
|
31
|
+
}, []), C = d(async () => {
|
|
32
|
+
i.clearStaleState(), i.getInstance().authContextProps ? i.getInstance().authContextProps.signoutRedirect() : await r.getInstance().router.navigate({ pathname: "/" });
|
|
33
|
+
}, []), w = p(() => _(v) || t.isAxiosNotFoundError(v) ? b`Not found.` : t.isAxiosForbiddenError(v) ? b`Access denied.` : t.isAxiosUnprocessableEntityError(v) ? b`Unprocessable Entity.` : b`Sorry, an unexpected error has occurred.`, [v, b]), T = p(() => _(v) || t.isAxiosNotFoundError(v) ? b`The item you requested can not be found. It may have been moved or deleted.` : t.isAxiosForbiddenError(v) ? b`You are not authorized to access this page or item.` : t.isAxiosUnauthorizedError(v) ? b`You are not authorized to access this page or item. Please logout and login again.` : t.isAxiosUnprocessableEntityError(v) ? b`We were unable to process this page or item.` : b("We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}", { message: v?.message ?? b`Unknown` }), [v, b]), E = p(() => !s(v) && v?.stack, [v]);
|
|
34
|
+
return /* @__PURE__ */ h(c, { children: [
|
|
35
|
+
/* @__PURE__ */ m(c, {
|
|
36
36
|
sx: { padding: 1 },
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ m(u, {
|
|
38
38
|
variant: "h1",
|
|
39
39
|
children: w
|
|
40
40
|
})
|
|
41
41
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ m(c, {
|
|
43
43
|
sx: { padding: 1 },
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ m(u, {
|
|
45
45
|
variant: "body2",
|
|
46
46
|
children: T
|
|
47
47
|
})
|
|
48
48
|
}),
|
|
49
|
-
E && /* @__PURE__ */
|
|
49
|
+
E && /* @__PURE__ */ h(c, {
|
|
50
50
|
sx: { padding: 1 },
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ m(u, {
|
|
52
52
|
variant: "h6",
|
|
53
53
|
children: b`Details for our technicians`
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ m(c, {
|
|
55
55
|
component: "pre",
|
|
56
56
|
sx: { fontSize: "0.8rem" },
|
|
57
57
|
children: v?.stack
|
|
58
58
|
})]
|
|
59
59
|
}),
|
|
60
|
-
!y && /* @__PURE__ */
|
|
60
|
+
!y && /* @__PURE__ */ h(c, {
|
|
61
61
|
sx: {
|
|
62
62
|
display: "flex",
|
|
63
63
|
gap: 1,
|
|
64
64
|
padding: 1
|
|
65
65
|
},
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ m(l, {
|
|
68
68
|
color: "primary",
|
|
69
69
|
onClick: C,
|
|
70
70
|
variant: "outlined",
|
|
71
71
|
children: b`Logout`
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ m(l, {
|
|
74
74
|
color: "primary",
|
|
75
75
|
onClick: x,
|
|
76
76
|
variant: "outlined",
|
|
77
77
|
children: b`Go back to homepage`
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ m(l, {
|
|
80
80
|
color: "secondary",
|
|
81
81
|
onClick: S,
|
|
82
82
|
children: b`Go back`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/GenericErrorMessage/GenericErrorMessage.tsx"],"sourcesContent":["import {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport {\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport { isRouteErrorResponse } from 'react-router-dom';\nimport { isAxiosError } from 'axios';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\n\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { PageEventBusService } from '../../../classes/services/PageEventBusService';\nimport { RouterService } from '../../../classes/services/RouterService';\nimport { AxiosUtil } from '../../../utils/AxiosUtil';\n\nexport type GenericErrorMessageProps = {\n readonly error?: unknown;\n readonly shouldHideActionButtons?: boolean;\n};\n\nexport const GenericErrorMessage = ({ error, shouldHideActionButtons }: GenericErrorMessageProps) => {\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!error || isAxiosError(error)) {\n // Axios errors are logged in LogService already\n return;\n }\n LogService.getInstance().log([{\n detail: {\n error,\n stack: (error as Error)?.stack,\n },\n level: isAxiosError(error) ? CommonDbLogLevel.DEBUG : CommonDbLogLevel.ERROR,\n topic: (error as Error)?.message ? `Error: ${(error as Error)?.message}` : 'Error',\n }]);\n LogService.getInstance().flushLog();\n if (error instanceof Error && ConfigService.getInstance().config.enablePageEvents) {\n PageEventBusService.getInstance().emit('error', error);\n }\n }, [error]);\n\n const onBackToHomePageButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate({\n pathname: '/',\n });\n }, []);\n\n const onBackButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate(-1);\n }, []);\n\n const onLogoutButtonClick = useCallback(async () => {\n AuthenticationService.clearStaleState();\n if (AuthenticationService.getInstance().authContextProps) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n AuthenticationService.getInstance().authContextProps.signoutRedirect();\n } else {\n await RouterService.getInstance().router.navigate({\n pathname: '/',\n });\n }\n }, []);\n\n const title = useMemo(() => {\n if (isRouteErrorResponse(error) || AxiosUtil.isAxiosNotFoundError(error)) {\n return t`Not found.`;\n }\n if (AxiosUtil.isAxiosForbiddenError(error)) {\n return t`Access denied.`;\n }\n if (AxiosUtil.isAxiosUnprocessableEntityError(error)) {\n return t`Unprocessable Entity.`;\n }\n return t`Sorry, an unexpected error has occurred.`;\n }, [error, t]);\n\n const message = useMemo(() => {\n if (isRouteErrorResponse(error) || AxiosUtil.isAxiosNotFoundError(error)) {\n return t`The item you requested can not be found. It may have been moved or deleted.`;\n }\n if (AxiosUtil.isAxiosForbiddenError(error)) {\n return t`You are not authorized to access this page or item.`;\n }\n if (AxiosUtil.isAxiosUnauthorizedError(error)) {\n return t`You are not authorized to access this page or item. Please logout and login again.`;\n }\n if (AxiosUtil.isAxiosUnprocessableEntityError(error)) {\n return t`We were unable to process this page or item.`;\n }\n return t('We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}', { message: (error as Error)?.message ?? t`Unknown` });\n }, [error, t]);\n\n const shouldShowStackTrace = useMemo(() => {\n return !isAxiosError(error) && (error as Error)?.stack;\n }, [error]);\n\n return (\n <Box>\n <Box sx={{ padding: 1 }}>\n <Typography\n variant={'h1'}\n >\n {title}\n </Typography>\n </Box>\n <Box sx={{ padding: 1 }}>\n <Typography\n variant={'body2'}\n >\n {message}\n </Typography>\n </Box>\n {shouldShowStackTrace && (\n <Box sx={{ padding: 1 }}>\n <Typography variant={'h6'}>\n {t`Details for our technicians`}\n </Typography>\n <Box\n component={'pre'}\n sx={{\n fontSize: '0.8rem',\n }}\n >\n {(error as Error)?.stack}\n </Box>\n </Box>\n )}\n {!shouldHideActionButtons && (\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n padding: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onLogoutButtonClick}\n variant={'outlined'}\n >\n {t`Logout`}\n </Button>\n <Button\n color={'primary'}\n onClick={onBackToHomePageButtonClick}\n variant={'outlined'}\n >\n {t`Go back to homepage`}\n </Button>\n <Button\n color={'secondary'}\n onClick={onBackButtonClick}\n >\n {t`Go back`}\n </Button>\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAa,KAAuB,EAAE,UAAO,iCAAwD;CACnG,IAAM,EAAE,SAAM,EAAe;CAE7B,QAAgB;EACV,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/GenericErrorMessage/GenericErrorMessage.tsx"],"sourcesContent":["import {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport {\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport { isRouteErrorResponse } from 'react-router-dom';\nimport { isAxiosError } from 'axios';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\n\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { PageEventBusService } from '../../../classes/services/PageEventBusService';\nimport { RouterService } from '../../../classes/services/RouterService';\nimport { AxiosUtil } from '../../../utils/AxiosUtil';\n\nexport type GenericErrorMessageProps = {\n readonly error?: unknown;\n readonly shouldHideActionButtons?: boolean;\n};\n\nexport const GenericErrorMessage = ({ error, shouldHideActionButtons }: GenericErrorMessageProps) => {\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!error || isAxiosError(error)) {\n // Axios errors are logged in LogService already\n return;\n }\n LogService.getInstance().log([{\n detail: {\n error,\n stack: (error as Error)?.stack,\n },\n level: isAxiosError(error) ? CommonDbLogLevel.DEBUG : CommonDbLogLevel.ERROR,\n topic: (error as Error)?.message ? `Error: ${(error as Error)?.message}` : 'Error',\n }]);\n LogService.getInstance().flushLog();\n if (error instanceof Error && ConfigService.getInstance().config.enablePageEvents) {\n PageEventBusService.getInstance().emit('error', error);\n }\n }, [error]);\n\n const onBackToHomePageButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate({\n pathname: '/',\n });\n }, []);\n\n const onBackButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate(-1);\n }, []);\n\n const onLogoutButtonClick = useCallback(async () => {\n AuthenticationService.clearStaleState();\n if (AuthenticationService.getInstance().authContextProps) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n AuthenticationService.getInstance().authContextProps.signoutRedirect();\n } else {\n await RouterService.getInstance().router.navigate({\n pathname: '/',\n });\n }\n }, []);\n\n const title = useMemo(() => {\n if (isRouteErrorResponse(error) || AxiosUtil.isAxiosNotFoundError(error)) {\n return t`Not found.`;\n }\n if (AxiosUtil.isAxiosForbiddenError(error)) {\n return t`Access denied.`;\n }\n if (AxiosUtil.isAxiosUnprocessableEntityError(error)) {\n return t`Unprocessable Entity.`;\n }\n return t`Sorry, an unexpected error has occurred.`;\n }, [error, t]);\n\n const message = useMemo(() => {\n if (isRouteErrorResponse(error) || AxiosUtil.isAxiosNotFoundError(error)) {\n return t`The item you requested can not be found. It may have been moved or deleted.`;\n }\n if (AxiosUtil.isAxiosForbiddenError(error)) {\n return t`You are not authorized to access this page or item.`;\n }\n if (AxiosUtil.isAxiosUnauthorizedError(error)) {\n return t`You are not authorized to access this page or item. Please logout and login again.`;\n }\n if (AxiosUtil.isAxiosUnprocessableEntityError(error)) {\n return t`We were unable to process this page or item.`;\n }\n return t('We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}', { message: (error as Error)?.message ?? t`Unknown` });\n }, [error, t]);\n\n const shouldShowStackTrace = useMemo(() => {\n return !isAxiosError(error) && (error as Error)?.stack;\n }, [error]);\n\n return (\n <Box>\n <Box sx={{ padding: 1 }}>\n <Typography\n variant={'h1'}\n >\n {title}\n </Typography>\n </Box>\n <Box sx={{ padding: 1 }}>\n <Typography\n variant={'body2'}\n >\n {message}\n </Typography>\n </Box>\n {shouldShowStackTrace && (\n <Box sx={{ padding: 1 }}>\n <Typography variant={'h6'}>\n {t`Details for our technicians`}\n </Typography>\n <Box\n component={'pre'}\n sx={{\n fontSize: '0.8rem',\n }}\n >\n {(error as Error)?.stack}\n </Box>\n </Box>\n )}\n {!shouldHideActionButtons && (\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n padding: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onLogoutButtonClick}\n variant={'outlined'}\n >\n {t`Logout`}\n </Button>\n <Button\n color={'primary'}\n onClick={onBackToHomePageButtonClick}\n variant={'outlined'}\n >\n {t`Go back to homepage`}\n </Button>\n <Button\n color={'secondary'}\n onClick={onBackButtonClick}\n >\n {t`Go back`}\n </Button>\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAa,KAAuB,EAAE,UAAO,iCAAwD;CACnG,IAAM,EAAE,SAAM,EAAe;CAE7B,QAAgB;EACV,AAAC,KAAS,GAAa,CAAK,MAIhC,EAAW,YAAY,CAAC,CAAC,IAAI,CAAC;GAC5B,QAAQ;IACN;IACA,OAAQ,GAAiB;GAC3B;GACA,OAAO,EAAa,CAAK,IAAI,EAAiB,QAAQ,EAAiB;GACvE,OAAQ,GAAiB,UAAU,UAAW,GAAiB,YAAY;EAC7E,CAAC,CAAC,GACF,EAAW,YAAY,CAAC,CAAC,SAAS,GAC9B,aAAiB,SAAS,EAAc,YAAY,CAAC,CAAC,OAAO,oBAC/D,EAAoB,YAAY,CAAC,CAAC,KAAK,SAAS,CAAK;CAEzD,GAAG,CAAC,CAAK,CAAC;CAEV,IAAM,IAA8B,EAAY,YAAY;EAC1D,MAAM,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,EAChD,UAAU,IACZ,CAAC;CACH,GAAG,CAAC,CAAC,GAEC,IAAoB,EAAY,YAAY;EAChD,MAAM,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,EAAE;CACtD,GAAG,CAAC,CAAC,GAEC,IAAsB,EAAY,YAAY;EAElD,AADA,EAAsB,gBAAgB,G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AAC,KACA,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,KAAK;IACL,SAAS;GACX;GALF,UAAA;IAOE,kBAAC,GAAD;KACE,OAAO;KACP,SAAS;KACT,SAAS;KAER,UAAA,CAAC;IACI,CAAA;IACR,kBAAC,GAAD;KACE,OAAO;KACP,SAAS;KACT,SAAS;KAER,UAAA,CAAC;IACI,CAAA;IACR,kBAAC,GAAD;KACE,OAAO;KACP,SAAS;KAER,UAAA,CAAC;IACI,CAAA;GACL;;CAEJ,EAAA,CAAA;AAET"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { styled as e } from "@mui/material";
|
|
2
|
+
import { Fragment as t, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { NavLink as r, resolvePath as i, useMatch as a } from "react-router-dom";
|
|
4
4
|
//#region src/components/ui/NavLink/NavLink.tsx
|
|
5
|
-
var o = r
|
|
5
|
+
var o = e(r)(({ theme: e }) => ({
|
|
6
6
|
"&:hover": { textDecoration: "underline" },
|
|
7
7
|
"&.active": { color: e.palette.secondary.main },
|
|
8
8
|
color: e.palette.primary.main,
|
|
9
9
|
textDecoration: "none"
|
|
10
|
-
})), s = ({ activeAsText:
|
|
11
|
-
let c =
|
|
12
|
-
return
|
|
10
|
+
})), s = ({ activeAsText: e, children: r, ...s }) => {
|
|
11
|
+
let c = a({ path: i(s.to).pathname });
|
|
12
|
+
return e && c ? /* @__PURE__ */ n(t, { children: r }) : /* @__PURE__ */ n(o, {
|
|
13
13
|
...s,
|
|
14
|
-
children: ({ isActive: e }) => /* @__PURE__ */
|
|
14
|
+
children: ({ isActive: e }) => /* @__PURE__ */ n("span", {
|
|
15
15
|
className: e ? "active" : "",
|
|
16
16
|
children: r
|
|
17
17
|
})
|
|
@@ -14,7 +14,7 @@ var g = ({ children: g, contentActions: _, contentHeader: v, fullHeight: y, full
|
|
|
14
14
|
let E = u(), { t: D } = h(), O = v || _, k = !y && !C, { ApplicationHeader: A } = e.getInstance().config;
|
|
15
15
|
return d(() => {
|
|
16
16
|
let n = w["data-testid"];
|
|
17
|
-
x
|
|
17
|
+
!x && n && e.getInstance().config.enablePageEvents && t.getInstance().emit("changePage", {
|
|
18
18
|
location: a.getInstance().window.location,
|
|
19
19
|
pageName: w["data-testid"]
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/PageContainer/PageContainer.tsx"],"sourcesContent":["import {\n Box,\n Container,\n Link,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useEffect } from 'react';\nimport type {\n ReactElement,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport type { PropsWithTestIdAttributes } from '@gen-epix/ui-core/models/testId';\n\nimport { Breadcrumbs } from '../Breadcrumbs';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { PageEventBusService } from '../../../classes/services/PageEventBusService';\nimport { useUpdateDocumentTitle } from '../../../hooks/useUpdateDocumentTitle';\nimport { ApplicationFooter } from '../ApplicationFooter/ApplicationFooter';\n\nexport type PageContainerProps = PropsWithTestIdAttributes<{\n readonly children: ReactNode;\n readonly contentActions?: ReactElement;\n readonly contentHeader?: ReactElement | string;\n readonly fullHeight?: boolean;\n readonly fullWidth?: boolean;\n readonly ignorePageEvent?: boolean;\n readonly showBreadcrumbs?: boolean;\n readonly singleAction?: boolean;\n readonly title: string;\n}>;\n\nexport const PageContainer = ({\n children,\n contentActions,\n contentHeader,\n fullHeight,\n fullWidth,\n ignorePageEvent,\n showBreadcrumbs,\n singleAction,\n testIdAttributes,\n title,\n}: PageContainerProps): ReactElement => {\n useUpdateDocumentTitle(title);\n const theme = useTheme();\n const { t } = useTranslation();\n\n const hasContentHeaderArea = contentHeader || contentActions;\n const hasFooterArea = !fullHeight && !singleAction;\n const { ApplicationHeader } = ConfigService.getInstance().config;\n\n useEffect(() => {\n const pageName = testIdAttributes['data-testid'];\n if (ignorePageEvent || !pageName) {\n return;\n }\n\n if (ConfigService.getInstance().config.enablePageEvents) {\n PageEventBusService.getInstance().emit('changePage', {\n location: WindowService.getInstance().window.location,\n pageName: testIdAttributes['data-testid'],\n });\n }\n }, [ignorePageEvent, testIdAttributes]);\n\n return (\n <>\n <Box\n component={'nav'}\n sx={{\n background: theme.palette.background.default,\n marginTop: '-1px',\n position: 'absolute',\n top: 0,\n zIndex: theme.zIndex.appBar + 10,\n }}\n >\n <Link\n component={'a'}\n href={'#main-content'}\n sx={{\n '&:focus, &:active': {\n clip: 'auto',\n height: 'auto',\n overflow: 'visible',\n position: 'static',\n whiteSpace: 'normal',\n width: 'auto',\n },\n border: 0,\n height: '1px',\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n whiteSpace: 'nowrap',\n\n width: '1px',\n }}\n >\n {t`Skip to main content`}\n </Link>\n </Box>\n <Box\n data-page-container\n {...testIdAttributes}\n sx={{\n display: 'grid',\n gridTemplateRows: `max-content auto ${hasFooterArea ? 'max-content' : ''}`,\n height: '100%',\n }}\n >\n <ApplicationHeader\n fullHeight={fullHeight}\n fullWidth={fullWidth}\n singleAction={singleAction}\n />\n <Box\n id={ConfigService.getInstance().config.layout.MAIN_CONTENT_ID}\n sx={{\n display: 'grid',\n gridTemplateRows: `${showBreadcrumbs ? 'max-content' : ''} auto`,\n height: '100%',\n }}\n >\n {showBreadcrumbs && (\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n paddingLeft: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n paddingRight: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n }}\n >\n <Breadcrumbs />\n </Container>\n )}\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n display: 'grid',\n gridTemplateRows: `${hasContentHeaderArea ? 'max-content' : ''} auto`,\n height: '100%',\n paddingLeft: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n paddingRight: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n position: 'relative',\n }}\n >\n {hasContentHeaderArea && (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing(1),\n }}\n >\n {contentHeader && typeof contentHeader === 'string' && (\n <Box>\n <Typography variant={'h2'}>\n {contentHeader}\n </Typography>\n </Box>\n )}\n {contentHeader && typeof contentHeader !== 'string' && contentHeader}\n {contentActions && (\n <Box>\n {contentActions}\n </Box>\n )}\n </Box>\n )}\n {singleAction && (\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <Box\n component={'a'}\n href={'#main-content'}\n id={'main-content'}\n style={{ display: 'none' }}\n tabIndex={-1}\n />\n {children}\n </Box>\n )}\n {!singleAction && (\n <>\n <Box\n component={'a'}\n href={'#main-content'}\n id={'main-content'}\n style={{ display: 'none' }}\n tabIndex={-1}\n />\n {children}\n </>\n )}\n </Container>\n </Box>\n {hasFooterArea && (\n <ApplicationFooter fullWidth={fullWidth} />\n )}\n </Box>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;AAkCA,IAAa,KAAiB,EAC5B,aACA,mBACA,kBACA,eACA,cACA,oBACA,oBACA,iBACA,qBACA,eACsC;CACtC,EAAuB,CAAK;CAC5B,IAAM,IAAQ,EAAS,GACjB,EAAE,SAAM,EAAe,GAEvB,IAAuB,KAAiB,GACxC,IAAgB,CAAC,KAAc,CAAC,GAChC,EAAE,yBAAsB,EAAc,YAAY,CAAC,CAAC;CAgB1D,OAdA,QAAgB;EACd,IAAM,IAAW,EAAiB;EAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/PageContainer/PageContainer.tsx"],"sourcesContent":["import {\n Box,\n Container,\n Link,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useEffect } from 'react';\nimport type {\n ReactElement,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport type { PropsWithTestIdAttributes } from '@gen-epix/ui-core/models/testId';\n\nimport { Breadcrumbs } from '../Breadcrumbs';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { PageEventBusService } from '../../../classes/services/PageEventBusService';\nimport { useUpdateDocumentTitle } from '../../../hooks/useUpdateDocumentTitle';\nimport { ApplicationFooter } from '../ApplicationFooter/ApplicationFooter';\n\nexport type PageContainerProps = PropsWithTestIdAttributes<{\n readonly children: ReactNode;\n readonly contentActions?: ReactElement;\n readonly contentHeader?: ReactElement | string;\n readonly fullHeight?: boolean;\n readonly fullWidth?: boolean;\n readonly ignorePageEvent?: boolean;\n readonly showBreadcrumbs?: boolean;\n readonly singleAction?: boolean;\n readonly title: string;\n}>;\n\nexport const PageContainer = ({\n children,\n contentActions,\n contentHeader,\n fullHeight,\n fullWidth,\n ignorePageEvent,\n showBreadcrumbs,\n singleAction,\n testIdAttributes,\n title,\n}: PageContainerProps): ReactElement => {\n useUpdateDocumentTitle(title);\n const theme = useTheme();\n const { t } = useTranslation();\n\n const hasContentHeaderArea = contentHeader || contentActions;\n const hasFooterArea = !fullHeight && !singleAction;\n const { ApplicationHeader } = ConfigService.getInstance().config;\n\n useEffect(() => {\n const pageName = testIdAttributes['data-testid'];\n if (ignorePageEvent || !pageName) {\n return;\n }\n\n if (ConfigService.getInstance().config.enablePageEvents) {\n PageEventBusService.getInstance().emit('changePage', {\n location: WindowService.getInstance().window.location,\n pageName: testIdAttributes['data-testid'],\n });\n }\n }, [ignorePageEvent, testIdAttributes]);\n\n return (\n <>\n <Box\n component={'nav'}\n sx={{\n background: theme.palette.background.default,\n marginTop: '-1px',\n position: 'absolute',\n top: 0,\n zIndex: theme.zIndex.appBar + 10,\n }}\n >\n <Link\n component={'a'}\n href={'#main-content'}\n sx={{\n '&:focus, &:active': {\n clip: 'auto',\n height: 'auto',\n overflow: 'visible',\n position: 'static',\n whiteSpace: 'normal',\n width: 'auto',\n },\n border: 0,\n height: '1px',\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n whiteSpace: 'nowrap',\n\n width: '1px',\n }}\n >\n {t`Skip to main content`}\n </Link>\n </Box>\n <Box\n data-page-container\n {...testIdAttributes}\n sx={{\n display: 'grid',\n gridTemplateRows: `max-content auto ${hasFooterArea ? 'max-content' : ''}`,\n height: '100%',\n }}\n >\n <ApplicationHeader\n fullHeight={fullHeight}\n fullWidth={fullWidth}\n singleAction={singleAction}\n />\n <Box\n id={ConfigService.getInstance().config.layout.MAIN_CONTENT_ID}\n sx={{\n display: 'grid',\n gridTemplateRows: `${showBreadcrumbs ? 'max-content' : ''} auto`,\n height: '100%',\n }}\n >\n {showBreadcrumbs && (\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n paddingLeft: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n paddingRight: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n }}\n >\n <Breadcrumbs />\n </Container>\n )}\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n display: 'grid',\n gridTemplateRows: `${hasContentHeaderArea ? 'max-content' : ''} auto`,\n height: '100%',\n paddingLeft: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n paddingRight: `${theme.spacing(fullWidth ? 1 : 2)} !important`,\n position: 'relative',\n }}\n >\n {hasContentHeaderArea && (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing(1),\n }}\n >\n {contentHeader && typeof contentHeader === 'string' && (\n <Box>\n <Typography variant={'h2'}>\n {contentHeader}\n </Typography>\n </Box>\n )}\n {contentHeader && typeof contentHeader !== 'string' && contentHeader}\n {contentActions && (\n <Box>\n {contentActions}\n </Box>\n )}\n </Box>\n )}\n {singleAction && (\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <Box\n component={'a'}\n href={'#main-content'}\n id={'main-content'}\n style={{ display: 'none' }}\n tabIndex={-1}\n />\n {children}\n </Box>\n )}\n {!singleAction && (\n <>\n <Box\n component={'a'}\n href={'#main-content'}\n id={'main-content'}\n style={{ display: 'none' }}\n tabIndex={-1}\n />\n {children}\n </>\n )}\n </Container>\n </Box>\n {hasFooterArea && (\n <ApplicationFooter fullWidth={fullWidth} />\n )}\n </Box>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;AAkCA,IAAa,KAAiB,EAC5B,aACA,mBACA,kBACA,eACA,cACA,oBACA,oBACA,iBACA,qBACA,eACsC;CACtC,EAAuB,CAAK;CAC5B,IAAM,IAAQ,EAAS,GACjB,EAAE,SAAM,EAAe,GAEvB,IAAuB,KAAiB,GACxC,IAAgB,CAAC,KAAc,CAAC,GAChC,EAAE,yBAAsB,EAAc,YAAY,CAAC,CAAC;CAgB1D,OAdA,QAAgB;EACd,IAAM,IAAW,EAAiB;EAC9B,MAAoB,KAIpB,EAAc,YAAY,CAAC,CAAC,OAAO,oBACrC,EAAoB,YAAY,CAAC,CAAC,KAAK,cAAc;GACnD,UAAU,EAAc,YAAY,CAAC,CAAC,OAAO;GAC7C,UAAU,EAAiB;EAC7B,CAAC;CAEL,GAAG,CAAC,GAAiB,CAAgB,CAAC,GAGpC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,WAAW;EACX,IAAI;GACF,YAAY,EAAM,QAAQ,WAAW;GACrC,WAAW;GACX,UAAU;GACV,KAAK;GACL,QAAQ,EAAM,OAAO,SAAS;EAChC;EAEA,UAAA,kBAAC,GAAD;GACE,WAAW;GACX,MAAM;GACN,IAAI;IACF,qBAAqB;KACnB,MAAM;KACN,QAAQ;KACR,UAAU;KACV,UAAU;KACV,YAAY;KACZ,OAAO;IACT;IACA,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,UAAU;IACV,KAAK;IACL,YAAY;IAEZ,OAAO;GACT;GAEC,UAAA,CAAC;EACE,CAAA;CACH,CAAA,GACL,kBAAC,GAAD;EACE,uBAAA;EACA,GAAI;EACJ,IAA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