diff --git a/src/components/sw360/Navbar/Navbar.tsx b/src/components/sw360/Navbar/Navbar.tsx index c756d5d1..a2393a37 100644 --- a/src/components/sw360/Navbar/Navbar.tsx +++ b/src/components/sw360/Navbar/Navbar.tsx @@ -28,64 +28,90 @@ function Navbar() { const [show, setShow] = useState(false) const navlist = [ - { link: '/home', name: t('Home') }, - { link: '/projects', name: t('Projects') }, - { link: '/components', name: t('Components') }, - { link: '/licenses', name: t('Licenses') }, - { link: '/ecc', name: t('ECC') }, - { link: '/vulnerabilities', name: t('Vulnerabilities') }, - { link: '/requests', name: t('Requests') }, - { link: '/search', name: t('Search') }, - { link: '/admin', name: t('Admin') }, - { link: '/preferences', name: t('Preferences') }, + { href: '/home', name: t('Home'), id: 'home' }, + { href: '/projects', name: t('Projects'), id: 'projects' }, + { href: '/components', name: t('Components'), id: 'components' }, + { href: '/licenses', name: t('Licenses'), id: 'licenses' }, + { href: '/ecc', name: t('ECC'), id: 'ecc' }, + { href: '/vulnerabilities', name: t('Vulnerabilities'), id: 'vulnerabilities' }, + { href: '/requests', name: t('Requests'), id: 'requests' }, + { href: '/search', name: t('Search'), id: 'search' }, + { + href: '/admin', + name: t('Admin'), + id: 'admin', + visibility: 'ADMIN', + childs: [ + { href: '#', name: t('User'), id: 'admin_user' }, + { href: '#', name: t('Vendors'), id: 'admin_vendors' }, + { href: '#', name: t('Bulk Release Edit'), id: 'admin_bulk_edit' }, + { href: '#', name: t('Licenses'), id: 'admin_licenses' }, + { href: '#', name: t('Obligations'), id: 'admin_obligations' }, + { href: '#', name: t('Schedule'), id: 'admin_schedule' }, + { href: '#', name: t('Fossology'), id: 'admin_fossology' }, + { href: '#', name: t('Import Export'), id: 'admin_import_export' }, + { href: '#', name: t('Database Sanitation'), id: 'admin_database_sanitation' }, + { href: '#', name: t('Attachment Cleanup'), id: 'admin_attachment_cleanup' }, + { href: '#', name: t('OAuth Client'), id: 'admin_oauth_client' }, + { href: '#', name: t('License Types'), id: 'admin_license_types' }, + { href: '#', name: t('Department'), id: 'admin_department' }, + ], + }, + { + href: '/preferences', + name: t('Preferences'), + id: 'preferences', + }, ] + // NavItems receives an array of links with possible entries: + // href: the link (mandatory) + // name: the name of the link (mandatory) + // id: the id of the link (mandatory) + // visibility: the userGroup that is allowed to see the link (optional) + // childs: an array of links that are shown as dropdown menu (optional) + const NavItems = () => (