Skip to content

Commit

Permalink
Enable prior notification list for superusers
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Jul 18, 2024
1 parent 58b46f4 commit a2114d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function MapButtons() {
{isFavoriteVesselsMapButtonDisplayed && <FavoriteVessels />}
{isSuperUser && isFavoriteVesselsMapButtonDisplayed && <MissionsMenu />}
{isSuperUser && isAlertsMapButtonDisplayed && <AlertsMapButton />}
{import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true' &&
{(isSuperUser || import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true') &&
isPriorNotificationMapButtonDisplayed && <PriorNotificationListButton />}
{isSuperUser && isBeaconMalfunctionsMapButtonDisplayed && <BeaconMalfunctionsMapButton />}

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/features/SideWindow/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Icon, IconButton } from '@mtes-mct/monitor-ui'
import { useIsSuperUser } from 'auth/hooks/useIsSuperUser'
import styled from 'styled-components'

import { SideWindowMenuKey, SideWindowMenuLabel } from '../../../domain/entities/sideWindow/constants'
Expand All @@ -10,6 +11,7 @@ export type MenuProps = Readonly<{
}>
export function Menu({ selectedMenu }: MenuProps) {
const dispatch = useMainAppDispatch()
const isSuperUser = useIsSuperUser()

return (
<Wrapper role="menu">
Expand All @@ -32,7 +34,7 @@ export function Menu({ selectedMenu }: MenuProps) {
selected={selectedMenu === SideWindowMenuKey.ALERT_LIST_AND_REPORTING_LIST}
title={SideWindowMenuLabel.ALERT_LIST_AND_REPORTING_LIST}
/>
{import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true' && (
{(isSuperUser || import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true') && (
<MenuButton
aria-label={SideWindowMenuKey.PRIOR_NOTIFICATION_LIST}
Icon={Icon.Fishery}
Expand Down

0 comments on commit a2114d9

Please sign in to comment.