Skip to content

Commit

Permalink
improvement(dashboard): add taskCancelled support to stack graph page
Browse files Browse the repository at this point in the history
  • Loading branch information
benstov authored and thsig committed Jul 10, 2019
1 parent b6d8846 commit 76c154b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions dashboard/src/components/graph/graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
stroke: #02f2b4;
}

g.taskCancelled > rect {
stroke: #BBB;
}

g.taskError > rect {
stroke: red;
}
Expand Down
18 changes: 14 additions & 4 deletions dashboard/src/components/graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class Chart extends Component<Props, ChartState> {
<Span>
<span
className={css`
color: ${colors.gardenGreen};
color: ${colors.taskState.ready};
`}
>
{" "}
Expand All @@ -394,7 +394,7 @@ class Chart extends Component<Props, ChartState> {
<Span>
<span
className={css`
color: ${colors.gardenPink};
color: ${colors.taskState.pending};
`}
>
{" "}
Expand All @@ -404,7 +404,7 @@ class Chart extends Component<Props, ChartState> {
<Span>
<span
className={css`
color: ${colors.gardenPink};
color: ${colors.taskState.processing};
`}
>
--{" "}
Expand All @@ -414,7 +414,17 @@ class Chart extends Component<Props, ChartState> {
<Span>
<span
className={css`
color: red;
color: ${colors.taskState.cancelled};
`}
>
{" "}
</span>
Cancelled
</Span>
<Span>
<span
className={css`
color: ${colors.taskState.error};
`}
>
{" "}
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/context/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import { Extends } from "garden-service/build/src/util/util"

// FIXME: We shouldn't repeat the keys for both the type and the set below
export type SupportedEventName = Extends<
EventName, "taskPending" | "taskProcessing" | "taskComplete" | "taskGraphComplete" | "taskError"
EventName, "taskPending" | "taskProcessing" | "taskComplete" | "taskGraphComplete" | "taskError" | "taskCancelled"
>

export const supportedEventNames: Set<SupportedEventName> = new Set(
["taskPending", "taskProcessing", "taskComplete", "taskGraphComplete", "taskError"],
["taskPending", "taskProcessing", "taskComplete", "taskGraphComplete", "taskError", "taskCancelled"],
)

export type WsEventMessage = ServerWebsocketMessage & {
Expand Down
7 changes: 7 additions & 0 deletions dashboard/src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,11 @@ export const colors = {
},
},
},
taskState: {
cancelled: "#BBB",
pending: "#ed83cc",
processing: "#ed83cc",
ready: "#66ffcc",
error: "red",
},
}

0 comments on commit 76c154b

Please sign in to comment.