feat(ui): add Projects page to the sidebar

This commit is contained in:
Andras Bacsai
2026-10-21 13:31:37 +02:00
parent 54febeffd6
commit 58b7f85e1e
2 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -104,8 +104,8 @@
// An entry with children opens a submenu in place of the main menu (back button + its pages).
$navSections = collect([
'Workspace' => [
// The dashboard lists projects and links to all of them, so project pages count as Dashboard.
['label' => 'Dashboard', 'icon' => 'dashboard', 'href' => '/', 'active' => request()->is('/', 'dashboard/*', 'projects', 'projects/*', 'project/*', 'canvas')],
['label' => 'Dashboard', 'icon' => 'dashboard', 'href' => '/', 'active' => request()->is('/', 'dashboard/*', 'canvas')],
['label' => 'Projects', 'icon' => 'projects', 'href' => route('project.index'), 'active' => request()->is('projects', 'projects/*', 'project/*')],
['label' => 'Monitoring', 'icon' => 'graph', 'children' => [
['label' => 'Analytics', 'icon' => 'analytics', 'href' => route('analytics'), 'active' => request()->is('analytics')],
['label' => 'Metrics', 'icon' => 'graph', 'href' => route('metrics'), 'active' => request()->is('metrics')],
+9
View File
@@ -131,3 +131,12 @@ test('a parent entry opens its submenu in place on mobile and desktop', function
->not->toMatch('#<a title="Monitoring"#');
}
});
test('the projects entry links to the projects page and is active on project pages', function () {
loginNavbarUser('member');
expect(renderNavbarAt('/project/abc'))
->toContain('href="'.route('project.index').'"')
->toMatch('#title="Projects"[^>]*menu-item-active#s')
->not->toMatch('#title="Dashboard"[^>]*menu-item-active#s');
});