Added optional group separator for app menu
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-06-30 08:30:31 +02:00
parent eb8780e9f9
commit 9388ad9bdb
3 changed files with 62 additions and 27 deletions
@@ -46,34 +46,42 @@
(!item.adminOnly ||
credentialService.isEffectiveSuperAdmin() ||
credentialService.isEffectiveAdmin()) &&
(!item.superAdminOnly ||
credentialService.isEffectiveSuperAdmin())
(!item.superAdminOnly || credentialService.isEffectiveSuperAdmin())
) {
@if (collapsed()) {
<a
mat-icon-button
class="nav-icon-button"
[routerLink]="item.disabled ? null : item.route"
[queryParams]="item.queryParams || null"
routerLinkActive="active"
[routerLinkActiveOptions]="navLinkActiveOptions"
[class.disabled]="item.disabled"
[matTooltip]="item.label"
matTooltipPosition="right"
[attr.aria-label]="item.label">
<mat-icon>{{ item.icon }}</mat-icon>
</a>
} @else {
<a
mat-list-item
[routerLink]="item.disabled ? null : item.route"
[queryParams]="item.queryParams || null"
routerLinkActive="active"
[routerLinkActiveOptions]="navLinkActiveOptions"
[class.disabled]="item.disabled">
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
<span matListItemTitle>{{ item.label }}</span>
</a>
@if (item.type === 'link') {
@if (collapsed()) {
<a
mat-icon-button
class="nav-icon-button"
[routerLink]="item.disabled ? null : item.route"
[queryParams]="item.queryParams || null"
routerLinkActive="active"
[routerLinkActiveOptions]="navLinkActiveOptions"
[class.disabled]="item.disabled"
[matTooltip]="item.label"
matTooltipPosition="right"
[attr.aria-label]="item.label">
<mat-icon>{{ item.icon }}</mat-icon>
</a>
} @else {
<a
mat-list-item
[routerLink]="item.disabled ? null : item.route"
[queryParams]="item.queryParams || null"
routerLinkActive="active"
[routerLinkActiveOptions]="navLinkActiveOptions"
[class.disabled]="item.disabled">
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
<span matListItemTitle>{{ item.label }}</span>
</a>
}
} @else if (item.type === 'separator') {
<mat-divider></mat-divider>
@if (!collapsed()) {
<div class="nav-separator">
<span>{{ item.label }}</span>
</div>
}
}
}
}
@@ -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;
}
@@ -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',