Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 0d90d67b

Přidáno uživatelem Václav Honzík před více než 2 roky(ů)

map dialogs + catalog filter fix

re #9547 #9545

Zobrazit rozdíly:

frontend/src/features/Navigation/navigationMenuItems.ts
6 6
import PersonIcon from '@mui/icons-material/Person'
7 7
import LoginIcon from '@mui/icons-material/Login'
8 8
import { SvgIconTypeMap } from '@mui/material'
9
import DataSaverOffIcon from '@mui/icons-material/DataSaverOff'
10
import LogoutIcon from '@mui/icons-material/Logout'
9 11

  
10 12
export interface NavigationMenuItem {
11 13
    name: string
......
18 20

  
19 21
const visitorRole = 'VISITOR'
20 22
const visitorRoleOnly = 'VISITOR_ONLY'
23
const loggedInRole = 'LOGGED_IN'
21 24
const visitorAccess = new Set([visitorRole])
25
const adminAccess = new Set(['ADMIN'])
26
const loggedInAccess = new Set([loggedInRole])
22 27

  
23 28
const items: NavigationMenuItem[] = [
24 29
    {
......
53 58
    {
54 59
        name: 'Admin',
55 60
        path: '/admin',
56
        accessibleTo: new Set(['ADMIN']),
61
        accessibleTo: adminAccess,
57 62
        icon: PersonIcon,
58
        position: 4,
63
        position: 5,
59 64
    },
60 65
    // TODO move this to the top
61 66
    {
......
65 70
        icon: LoginIcon,
66 71
        position: 5,
67 72
    },
73
    {
74
        name: 'Statistics',
75
        path: '/stats',
76
        accessibleTo: adminAccess,
77
        icon: DataSaverOffIcon,
78
        position: 4,
79
    },
80
    {
81
        name: 'Logout',
82
        path: '/logout',
83
        accessibleTo: loggedInAccess,
84
        icon: LogoutIcon,
85
        position: 1337,
86
    }
68 87
]
69 88

  
70 89
const getNavigationItems = (_userRoles: string[]): NavigationMenuItem[] => {
......
74 93
        userRoles.push( visitorRole, visitorRoleOnly)
75 94
    } else {
76 95
        userRoles.push(visitorRole)
96
        userRoles.push(loggedInRole)
77 97
    }
78 98

  
79 99
    return items // else return everything the user has privileges to

Také k dispozici: Unified diff