feat: overhaul project workspace navigation
This commit is contained in:
@@ -2,17 +2,12 @@
|
||||
import { Link, usePage } from '@inertiajs/vue3';
|
||||
import {
|
||||
ArrowLeft,
|
||||
BellRing,
|
||||
BookOpen,
|
||||
CirclePlus,
|
||||
Folder,
|
||||
FolderGit2,
|
||||
KanbanSquare,
|
||||
LayoutGrid,
|
||||
Layers3,
|
||||
ListTodo,
|
||||
SlidersHorizontal,
|
||||
Tags,
|
||||
Shield,
|
||||
Users,
|
||||
} from 'lucide-vue-next';
|
||||
@@ -36,17 +31,7 @@ import { index as projectTemplatesIndex } from '@/routes/project-templates';
|
||||
import {
|
||||
create as projectsCreate,
|
||||
index as projectsIndex,
|
||||
show as projectShow,
|
||||
} from '@/routes/projects';
|
||||
import { index as projectBacklog } from '@/routes/projects/backlog';
|
||||
import { index as projectBoard } from '@/routes/projects/board';
|
||||
import {
|
||||
board as projectSettingsBoard,
|
||||
general as projectSettingsGeneral,
|
||||
metadata as projectSettingsMetadata,
|
||||
notifications as projectSettingsNotifications,
|
||||
repositories as projectSettingsRepositories,
|
||||
} from '@/routes/projects/settings';
|
||||
import { index as teamsIndex } from '@/routes/teams';
|
||||
import type { AppSidebarProps, NavItem } from '@/types';
|
||||
|
||||
@@ -54,67 +39,6 @@ const props = defineProps<AppSidebarProps>();
|
||||
|
||||
const page = usePage();
|
||||
|
||||
const isProjectSettings = computed(() => page.url.includes('/settings/'));
|
||||
|
||||
const projectNavItems = computed<NavItem[]>(() => {
|
||||
if (!props.project) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
title: 'Overview',
|
||||
href: projectShow(props.project.id),
|
||||
icon: LayoutGrid,
|
||||
isActive: page.url === projectShow.url(props.project.id),
|
||||
},
|
||||
{
|
||||
title: 'Board',
|
||||
href: projectBoard(props.project.id),
|
||||
icon: KanbanSquare,
|
||||
},
|
||||
{
|
||||
title: 'Backlog',
|
||||
href: projectBacklog(props.project.id),
|
||||
icon: ListTodo,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
const projectSettingsNavItems = computed<NavItem[]>(() => {
|
||||
if (!props.project || !isProjectSettings.value) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
title: 'General',
|
||||
href: projectSettingsGeneral(props.project.id),
|
||||
icon: SlidersHorizontal,
|
||||
},
|
||||
{
|
||||
title: 'Board',
|
||||
href: projectSettingsBoard(props.project.id),
|
||||
icon: KanbanSquare,
|
||||
},
|
||||
{
|
||||
title: 'Metadata',
|
||||
href: projectSettingsMetadata(props.project.id),
|
||||
icon: Tags,
|
||||
},
|
||||
{
|
||||
title: 'Repositories',
|
||||
href: projectSettingsRepositories(props.project.id),
|
||||
icon: FolderGit2,
|
||||
},
|
||||
{
|
||||
title: 'Notifications',
|
||||
href: projectSettingsNotifications(props.project.id),
|
||||
icon: BellRing,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
const mainNavItems = computed<NavItem[]>(() => {
|
||||
const items: NavItem[] = [
|
||||
{
|
||||
@@ -198,12 +122,6 @@ const footerNavItems: NavItem[] = [
|
||||
{{ project.name }}
|
||||
</div>
|
||||
</div>
|
||||
<NavMain :items="projectNavItems" label="Project" />
|
||||
<NavMain
|
||||
v-if="projectSettingsNavItems.length > 0"
|
||||
:items="projectSettingsNavItems"
|
||||
label="Project settings"
|
||||
/>
|
||||
<div class="mt-auto px-3 pb-3">
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user