Skip to content

Commit

Permalink
Add "canceled" bulid status
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Oct 22, 2024
1 parent 370e327 commit 33ff29d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/helpers/buildMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const STATUS_OPTIONS: { [key: Build["status"]]: string } = {
COMPLETED: "Available",
QUEUED: "Queued",
FAILED: "Failed",
BUILDING: "Building"
BUILDING: "Building",
CANCELED: "Canceled"
};

const TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
Expand All @@ -25,7 +26,11 @@ export const buildDatetimeStatus = (
currentBuildId: number
): string => {
if (id === currentBuildId) {
return `${dateToTimezone(ended_on ?? scheduled_on)} - Active`;
let option = `${dateToTimezone(ended_on ?? scheduled_on)} - Active`;
if (status !== "COMPLETED") {
option += " - " + STATUS_OPTIONS[status];
}
return option;
} else if (status === "BUILDING") {
return `${dateToTimezone(scheduled_on)} - Building`;
} else if (status === "QUEUED") {
Expand Down

0 comments on commit 33ff29d

Please sign in to comment.