Path: blob/main/components/dashboard/src/projects/projects.routes.ts
2500 views
/**1* Copyright (c) 2022 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { Project } from "@gitpod/gitpod-protocol";7import { TabEntry } from "../components/Header";89export const projectsPathMain = "/projects";10export const projectsPathMainWithParams = [projectsPathMain, ":projectName", ":resourceOrPrebuild?"].join("/");1112export const projectsPathInstallGitHubApp = "/install-github-app";1314export function getProjectTabs(project: Project | undefined): TabEntry[] {15if (!project) {16return [];17}18return [19{20title: "Branches",21link: `/projects/${project.id}`,22},23{24title: "Prebuilds",25link: `/projects/${project.id}/prebuilds`,26},27{28title: "Settings",29link: `/projects/${project.id}/settings`,30alternatives: getProjectSettingsMenu(project).flatMap((e) => e.link),31},32];33}3435export function getProjectSettingsMenu(project?: Project) {36const slug = project?.id ?? "unknown";37return [38{39title: "General",40link: [`/projects/${slug}/settings`],41},42{43title: "Variables",44link: [`/projects/${slug}/variables`],45},46];47}484950