feat(dashboard): render task actions, statuses and filters from the server catalog
Three surfaces stopped keeping hand-synced copies of the lifecycle vocabulary, so a status or action added on the backend shows up without a frontend change: - task actions render label/variant/confirm from taskstate.ActionCatalog via actionFor(); unknown actions no longer vanish behind a hardcoded switch and a new action needs no frontend case - status labels and pill severities come from taskstate.Statuses via statusLabel()/statusKind(); the local copy and the dom.js switch are gone - the status filter vocabulary and the "needs you" grouping derive from statusIds()/attentionStatusIds(); a new status appears in the filter and in the settings page's Work lifecycle card, driven by /api/task-meta Regenerated ui/dist so the embedded binary ships the new dashboard.
This commit is contained in:
1 parent
23e0895ea2
commit
cf06cd6a08
8 files changed
+332
-120
No files matched your search
+4
-21
@@ -52,27 +52,10 @@ export function pill(text, kind = "idle") {
|
||||
return el(`span.pill.pill-${kind}`, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map an archie task status onto a pill kind. Centralised so "merged" is the
|
||||
* same green everywhere it appears.
|
||||
*/
|
||||
export function statusKind(status) {
|
||||
switch (status) {
|
||||
case "running":
|
||||
return "info";
|
||||
case "merged":
|
||||
case "pr_open":
|
||||
return "ok";
|
||||
case "parked":
|
||||
case "waiting_human":
|
||||
return "warn";
|
||||
case "dead":
|
||||
case "rejected":
|
||||
return "danger";
|
||||
default:
|
||||
return "idle";
|
||||
}
|
||||
}
|
||||
// Re-exported from task-meta.js so the pill severity vocabulary has a single
|
||||
// source (the server catalog). Importers that pull statusKind from dom.js --
|
||||
// e.g. dashboard.js -- keep working, and the hardcoded switch is gone.
|
||||
export { statusKind } from "./task-meta.js";
|
||||
|
||||
/** Humanised relative time: "2 min ago". Raw timestamps make people do maths. */
|
||||
export function ago(value) {
|
||||
|
||||
Reference in new issue
Block a user