From cd81723bf5a30582b1aa329eb3efe7735554216f Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Sun, 8 Nov 2026 14:36:09 +0100 Subject: [PATCH] Site-instellingen: ook Beheerder mag lezen en wijzigen Co-Authored-By: Claude Sonnet 5.5 --- frontend/src/components/layout/Sidebar.test.tsx | 4 ++-- frontend/src/components/layout/Sidebar.tsx | 8 +++----- .../features/settings/pages/SettingsPage.test.tsx | 15 ++++++++++++++- frontend/src/router.tsx | 2 +- .../Controllers/AvailabilityController.cs | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/layout/Sidebar.test.tsx b/frontend/src/components/layout/Sidebar.test.tsx index f1ebd16..6bba3d0 100644 --- a/frontend/src/components/layout/Sidebar.test.tsx +++ b/frontend/src/components/layout/Sidebar.test.tsx @@ -32,12 +32,12 @@ describe('Sidebar role filtering (BR-U3-01 – BR-U3-06)', () => { expect(screen.queryByTestId('nav-profile')).not.toBeInTheDocument(); }); - it('Administrator sees Dashboard and Users — not Settings or CMS', async () => { + it('Administrator sees Dashboard, Users and Settings — not CMS', async () => { mockAuthenticatedAs('Administrator'); renderApp('/dashboard'); expect(await screen.findByTestId('nav-dashboard')).toBeInTheDocument(); expect(screen.getByTestId('nav-users')).toBeInTheDocument(); - expect(screen.queryByTestId('nav-settings')).not.toBeInTheDocument(); + expect(screen.getByTestId('nav-settings')).toBeInTheDocument(); expect(screen.queryByTestId('nav-cms')).not.toBeInTheDocument(); expect(screen.queryByTestId('nav-profile')).not.toBeInTheDocument(); }); diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index 4561c70..56f32dc 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -7,6 +7,7 @@ import { useAuth } from '@/features/auth/context/auth-context'; import { useAvailabilityStatus } from '@/features/availability/services/useAvailability'; import { useSystemCapabilities } from '@/features/system/services/useSystemCapabilities'; import { LanguageSwitcher } from '@/i18n/LanguageSwitcher'; +import { BrandLogo } from './BrandLogo'; import { ThemeToggle } from './ThemeToggle'; import { UserMenu } from './UserMenu'; @@ -38,7 +39,7 @@ const NAV_ITEMS: NavItem[] = [ ]; const SETTINGS_ITEM: NavItem = { - to: '/settings', labelKey: 'nav.settings', icon: Settings, testId: 'nav-settings', roles: ['Owner'], + to: '/settings', labelKey: 'nav.settings', icon: Settings, testId: 'nav-settings', roles: ['Owner', 'Administrator'], }; interface SidebarProps { @@ -66,10 +67,7 @@ export function Sidebar({ onClose }: SidebarProps = {}) { data-testid="app-sidebar" >
-
-
+ {onClose && (