mirror of
https://github.com/makeplane/plane.git
synced 2025-12-16 20:07:56 +01:00
* chore: move icons from ui package to propel package * chore: package and tsdown config updated * chore: migrate all icon imports from @plane/ui to @plane/propel/icons * chore: remove icon components from @plane/ui package (migrated to @plane/propel/icons) * chore: code refactoring * chore: migrate remaining icon components from @Plane/ui to @Plane/propel/icons * fix: lint error * chore: code refactor
80 lines
2.4 KiB
TypeScript
80 lines
2.4 KiB
TypeScript
import { FileText, Layers } from "lucide-react";
|
|
// plane imports
|
|
import { EUserPermissions, EProjectFeatureKey } from "@plane/constants";
|
|
import { ContrastIcon, DiceIcon, LayersIcon, Intake } from "@plane/propel/icons";
|
|
// components
|
|
import type { TNavigationItem } from "@/components/workspace/sidebar/project-navigation";
|
|
|
|
export const getProjectFeatureNavigation = (
|
|
workspaceSlug: string,
|
|
projectId: string,
|
|
project: {
|
|
cycle_view: boolean;
|
|
module_view: boolean;
|
|
issue_views_view: boolean;
|
|
page_view: boolean;
|
|
inbox_view: boolean;
|
|
}
|
|
): TNavigationItem[] => [
|
|
{
|
|
i18n_key: "sidebar.work_items",
|
|
key: EProjectFeatureKey.WORK_ITEMS,
|
|
name: "Work items",
|
|
href: `/${workspaceSlug}/projects/${projectId}/issues`,
|
|
icon: LayersIcon,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
|
shouldRender: true,
|
|
sortOrder: 1,
|
|
},
|
|
{
|
|
i18n_key: "sidebar.cycles",
|
|
key: EProjectFeatureKey.CYCLES,
|
|
name: "Cycles",
|
|
href: `/${workspaceSlug}/projects/${projectId}/cycles`,
|
|
icon: ContrastIcon,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
|
shouldRender: project.cycle_view,
|
|
sortOrder: 2,
|
|
},
|
|
{
|
|
i18n_key: "sidebar.modules",
|
|
key: EProjectFeatureKey.MODULES,
|
|
name: "Modules",
|
|
href: `/${workspaceSlug}/projects/${projectId}/modules`,
|
|
icon: DiceIcon,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
|
shouldRender: project.module_view,
|
|
sortOrder: 3,
|
|
},
|
|
{
|
|
i18n_key: "sidebar.views",
|
|
key: EProjectFeatureKey.VIEWS,
|
|
name: "Views",
|
|
href: `/${workspaceSlug}/projects/${projectId}/views`,
|
|
icon: Layers,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
|
shouldRender: project.issue_views_view,
|
|
sortOrder: 4,
|
|
},
|
|
{
|
|
i18n_key: "sidebar.pages",
|
|
key: EProjectFeatureKey.PAGES,
|
|
name: "Pages",
|
|
href: `/${workspaceSlug}/projects/${projectId}/pages`,
|
|
icon: FileText,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
|
shouldRender: project.page_view,
|
|
sortOrder: 5,
|
|
},
|
|
{
|
|
i18n_key: "sidebar.intake",
|
|
key: EProjectFeatureKey.INTAKE,
|
|
name: "Intake",
|
|
href: `/${workspaceSlug}/projects/${projectId}/intake`,
|
|
icon: Intake,
|
|
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
|
shouldRender: project.inbox_view,
|
|
sortOrder: 6,
|
|
},
|
|
];
|