Files
archie/ui/src/runs/state.ts
T
sam a88f5630fe feat(runs): the first step that sets an outcome ends the run (#2042)
Add workflow.finish (completed, parked, waiting_approval, declined). A failed
step parks the run unless it continues on failure, and a parked run retries
from a top-level step, replaying the earlier steps' recorded results. Adds the
retry-run operation and a Retry button on the run page.
2026-11-21 13:52:52 +11:00

27 lines
658 B
TypeScript

/** The Badge and StatusDot tone for a run, approval or effect state the server
* reports. A state this build does not know reads as idle. */
export function stateTone(state: string): "ok" | "warn" | "danger" | "info" | "idle" {
switch (state) {
case "succeeded":
case "approved":
case "done":
return "ok";
case "waiting":
case "waiting_approval":
case "parked":
case "pending":
case "unknown":
return "warn";
case "failed":
case "denied":
case "expired":
case "refused":
return "danger";
case "running":
case "queued":
return "info";
default:
return "idle";
}
}