Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import {
ImpendingDeletionText,
} from "components/WorkspaceDeletion"
import { getDisplayWorkspaceStatus } from "utils/workspace"
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"
import { styled } from "@mui/material/styles"
import Box from "@mui/material/Box"
import ErrorOutline from "@mui/icons-material/ErrorOutline"

export type WorkspaceStatusBadgeProps = {
workspace: Workspace
Expand All @@ -28,6 +32,27 @@ export const WorkspaceStatusBadge: FC<
<Cond condition={Boolean(LockedBadge({ workspace }))}>
<LockedBadge workspace={workspace} />
</Cond>
<Cond condition={workspace.latest_build.status === "failed"}>
<FailureTooltip
title={
<Box sx={{ display: "flex", alignItems: "center", gap: 1.25 }}>
<ErrorOutline
sx={{
width: 14,
height: 14,
color: (theme) => theme.palette.error.light,
}}
/>
<Box>{workspace.latest_build.job.error}</Box>
</Box>
}
placement="top"
>
<div>
<Pill className={className} icon={icon} text={text} type={type} />
</div>
</FailureTooltip>
</Cond>
<Cond>
<Pill className={className} icon={icon} text={text} type={type} />
</Cond>
Expand Down Expand Up @@ -66,6 +91,17 @@ export const WorkspaceStatusText: FC<
)
}

const FailureTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} />
))(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: theme.palette.background.paperLight,
border: `1px solid ${theme.palette.divider}`,
fontSize: 12,
padding: theme.spacing(1, 1.25),
},
}))

const useStyles = makeStyles((theme) => ({
root: { fontWeight: 600 },
"type-error": {
Expand Down