mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
feat(ui): add Projects page to the sidebar
This commit is contained in:
@@ -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')],
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user