diff --git a/components/dashboard/src/projects/Project.tsx b/components/dashboard/src/projects/Project.tsx index 4fc57ab96ffc85..dffff80f0b8944 100644 --- a/components/dashboard/src/projects/Project.tsx +++ b/components/dashboard/src/projects/Project.tsx @@ -398,26 +398,29 @@ export default function () { - prebuild && cancelPrebuild(prebuild.info.id), - }, - ] - : [ - { - title: `${prebuild ? "Rerun" : "Run"} Prebuild (${ - branch.name - })`, - onClick: () => triggerPrebuild(branch), - }, - ] - } + ? { + title: "Cancel Prebuild", + customFontStyle: + "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300", + onClick: () => + prebuild && cancelPrebuild(prebuild.info.id), + } + : { + title: `${prebuild ? "Rerun" : "Run"} Prebuild (${ + branch.name + })`, + onClick: () => triggerPrebuild(branch), + }, + ]} /> diff --git a/components/dashboard/src/projects/ProjectListItem.tsx b/components/dashboard/src/projects/ProjectListItem.tsx index 672ebf322b2c4c..93c971dcf2e702 100644 --- a/components/dashboard/src/projects/ProjectListItem.tsx +++ b/components/dashboard/src/projects/ProjectListItem.tsx @@ -13,6 +13,7 @@ import { useCurrentTeam } from "../teams/teams-context"; import { RemoveProjectModal } from "./RemoveProjectModal"; import { toRemoteURL } from "./render-utils"; import { prebuildStatusIcon } from "./Prebuilds"; +import { gitpodHostUrl } from "../service/service"; type ProjectListItemProps = { project: Project; @@ -40,7 +41,14 @@ export const ProjectListItem: FunctionComponent = ({ proje menuEntries={[ { title: "New Workspace", - href: `/#${project.cloneUrl}`, + href: gitpodHostUrl.withContext(`${project.cloneUrl}`).toString(), + separator: true, + }, + { + title: "New Workspace ...", + href: gitpodHostUrl + .withContext(`${project.cloneUrl}`, { showOptions: true }) + .toString(), separator: true, }, { diff --git a/components/gitpod-protocol/src/util/gitpod-host-url.ts b/components/gitpod-protocol/src/util/gitpod-host-url.ts index a952d35ac22b14..9481d02bdea145 100644 --- a/components/gitpod-protocol/src/util/gitpod-host-url.ts +++ b/components/gitpod-protocol/src/util/gitpod-host-url.ts @@ -77,8 +77,15 @@ export class GitpodHostUrl { return updated.with((url) => ({ pathname: `/api${url.pathname}` })); } - withContext(contextUrl: string) { - return this.with((url) => ({ hash: contextUrl })); + withContext( + contextUrl: string, + startOptions?: { showOptions?: boolean; editor?: string; workspaceClass?: string }, + ) { + const searchParams = new URLSearchParams(); + if (startOptions?.showOptions) { + searchParams.append("showOptions", "true"); + } + return this.with((url) => ({ hash: contextUrl, search: searchParams.toString() })); } asWebsocket(): GitpodHostUrl {