{status}
diff --git a/components/dashboard/src/projects/Project.tsx b/components/dashboard/src/projects/Project.tsx
index fa277fdca85907..06ffeda95e2899 100644
--- a/components/dashboard/src/projects/Project.tsx
+++ b/components/dashboard/src/projects/Project.tsx
@@ -5,9 +5,9 @@
*/
import moment from "moment";
-import { PrebuildInfo, PrebuildWithStatus, Project } from "@gitpod/gitpod-protocol";
+import { PrebuildWithStatus, Project } from "@gitpod/gitpod-protocol";
import { useContext, useEffect, useState } from "react";
-import { useHistory, useLocation, useRouteMatch } from "react-router";
+import { useLocation, useRouteMatch } from "react-router";
import Header from "../components/Header";
import { ItemsList, Item, ItemField, ItemFieldContextMenu } from "../components/ItemsList";
import { getGitpodService, gitpodHostUrl } from "../service/service";
@@ -20,7 +20,6 @@ import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
import { openAuthorizeWindow } from "../provider-utils";
export default function () {
- const history = useHistory();
const location = useLocation();
const { teams } = useContext(TeamsContext);
@@ -155,13 +154,17 @@ export default function () {
}
const triggerPrebuild = (branch: Project.BranchDetails) => {
- if (project) {
- getGitpodService().server.triggerPrebuild(project.id, branch.name)
+ if (!project) {
+ return;
}
+ getGitpodService().server.triggerPrebuild(project.id, branch.name);
}
- const openPrebuild = (pb: PrebuildInfo) => {
- history.push(`/${!!team ? 't/' + team.slug : 'projects'}/${projectName}/${pb.id}`);
+ const cancelPrebuild = (prebuildId: string) => {
+ if (!project) {
+ return;
+ }
+ getGitpodService().server.cancelPrebuild(project.id, prebuildId);
}
const formatDate = (date: string | undefined) => {
@@ -236,9 +239,9 @@ export default function () {