From 9388ad9bdba3e0ee5a9d11bbe321a461a40dcc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20Paul=20Ton=C4=8Dik?= Date: Tue, 30 Jun 2026 08:30:31 +0200 Subject: [PATCH] Added optional group separator for app menu --- .../ui/app-menu/app-menu.component.html | 62 +++++++++++-------- .../ui/app-menu/app-menu.component.scss | 11 ++++ .../shared/ui/app-menu/app-menu.component.ts | 16 +++++ 3 files changed, 62 insertions(+), 27 deletions(-) diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index 159f2598..1d34aefc 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.html +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.html @@ -46,34 +46,42 @@ (!item.adminOnly || credentialService.isEffectiveSuperAdmin() || credentialService.isEffectiveAdmin()) && - (!item.superAdminOnly || - credentialService.isEffectiveSuperAdmin()) + (!item.superAdminOnly || credentialService.isEffectiveSuperAdmin()) ) { - @if (collapsed()) { - - {{ item.icon }} - - } @else { - - {{ item.icon }} - {{ item.label }} - + @if (item.type === 'link') { + @if (collapsed()) { + + {{ item.icon }} + + } @else { + + {{ item.icon }} + {{ item.label }} + + } + } @else if (item.type === 'separator') { + + @if (!collapsed()) { + + } } } } diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.scss b/webapp/src/app/shared/ui/app-menu/app-menu.component.scss index 70c13978..0a3cc8fb 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.scss +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.scss @@ -277,3 +277,14 @@ .sidebar--collapsed .account-icon { margin-inline: auto; } + +.nav-separator { + display: flex; + align-items: center; + gap: 8px; + padding: 0 12px; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 600; + text-transform: uppercase; +} diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index e8e34eb1..ce9c80aa 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -16,6 +16,7 @@ import { MatDialog } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation-dialog.component'; type NavItem = { + type: 'link' | 'separator'; label: string; icon: string; route: string; @@ -53,12 +54,14 @@ export class AppMenuComponent { }; navItems: NavItem[] = [ { + type: 'link', label: 'Dashboard', icon: 'dashboard', route: '/dashboard', disabled: false, }, { + type: 'link', label: 'Personen', icon: 'groups', route: '/persons', @@ -68,12 +71,14 @@ export class AppMenuComponent { disabled: false, }, { + type: 'link', label: 'News', icon: 'newspaper', route: '/news', disabled: false, }, { + type: 'link', label: 'Institutionen', icon: 'apartment', route: '/institutions', @@ -87,6 +92,7 @@ export class AppMenuComponent { }, }, { + type: 'link', label: 'Projekte', icon: 'work', route: '/projects', @@ -101,6 +107,15 @@ export class AppMenuComponent { }, }, { + type: 'separator', + label: 'Verwaltung', + icon: '', + route: '', + disabled: false, + adminOnly: true, + }, + { + type: 'link', label: 'Accounts', icon: 'manage_accounts', route: '/accounts', @@ -108,6 +123,7 @@ export class AppMenuComponent { adminOnly: true, }, { + type: 'link', label: 'Organisationen', icon: 'domain', route: '/organizations',