new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 17:59:43 +01:00
parent 97c9af7f14
commit e720c52896

View File

@@ -133,10 +133,7 @@ const baseNavigationItems: NavigationItem[] = [
text: 'Issues', text: 'Issues',
icon: <BugReport />, icon: <BugReport />,
path: '/issues', path: '/issues',
subItems: [ // subItems computed dynamically in navigationItems useMemo
{ text: 'Meine Issues', path: '/issues?tab=0' },
{ text: 'Alle Issues', path: '/issues?tab=1' },
],
permission: 'issues:create', permission: 'issues:create',
}, },
]; ];
@@ -198,10 +195,17 @@ function Sidebar({ mobileOpen, onMobileClose }: SidebarProps) {
if (hasPermission('shop:view_overview')) { shopSubItems.push({ text: 'Übersicht', path: `/shop?tab=${shopTabIdx}` }); shopTabIdx++; } if (hasPermission('shop:view_overview')) { shopSubItems.push({ text: 'Übersicht', path: `/shop?tab=${shopTabIdx}` }); shopTabIdx++; }
shopSubItems.push({ text: 'Katalog', path: `/shop?tab=${shopTabIdx}` }); shopSubItems.push({ text: 'Katalog', path: `/shop?tab=${shopTabIdx}` });
// Build Issues sub-items dynamically (tab order must match Issues.tsx)
const issuesSubItems: SubItem[] = [{ text: 'Meine Issues', path: '/issues?tab=0' }];
if (hasPermission('issues:view_all')) {
issuesSubItems.push({ text: 'Alle Issues', path: '/issues?tab=1' });
}
const items = baseNavigationItems const items = baseNavigationItems
.map((item) => { .map((item) => {
if (item.path === '/fahrzeuge') return fahrzeugeItem; if (item.path === '/fahrzeuge') return fahrzeugeItem;
if (item.path === '/shop') return { ...item, subItems: shopSubItems }; if (item.path === '/shop') return { ...item, subItems: shopSubItems };
if (item.path === '/issues') return { ...item, subItems: issuesSubItems };
return item; return item;
}) })
.filter((item) => !item.permission || hasPermission(item.permission)); .filter((item) => !item.permission || hasPermission(item.permission));