feat(web): show repair draft status in Runs
Some checks failed
Code Review / ai-code-review (push) Successful in 21s
CD Pipeline / tests (push) Successful in 1m40s
CD Pipeline / build-and-deploy (push) Successful in 5m23s
CD Pipeline / post-deploy-checks (push) Successful in 1m45s
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-25 20:29:24 +08:00
parent 195ad031da
commit cbe6e64f8a
6 changed files with 110 additions and 4 deletions

View File

@@ -2211,6 +2211,20 @@ function recurrenceRepairStatusLabelKey(status?: string | null) {
return "repairStatuses.no_repair_record";
}
function recurrenceWorkItemStatusLabelKey(status?: string | null) {
if (
status === "owner_review_ready" ||
status === "draft_ready" ||
status === "open" ||
status === "blocked" ||
status === "closed" ||
status === "none"
) {
return `workItemStatuses.${status}`;
}
return "workItemStatuses.unknown";
}
function EventRecurrencePanel({
recurrence,
error,
@@ -2344,6 +2358,17 @@ function EventRecurrencePanel({
const workItem = item.work_item;
const repairKey = recurrenceRepairStatusLabelKey(repair?.status);
const repairLabel = t(repairKey as never);
const workItemStatusLabel = workItem
? t(recurrenceWorkItemStatusLabelKey(workItem.status) as never)
: null;
const workItemTone =
workItem?.status === "owner_review_ready" || workItem?.status === "draft_ready"
? "owner_review"
: workItem?.status === "blocked"
? "blocked"
: workItem?.status === "open"
? "open"
: "neutral";
const runHref = item.latest_run_id
? `/awooop/runs/${item.latest_run_id}?project_id=${encodeURIComponent(recurrence?.project_id ?? "awoooi")}`
: null;
@@ -2391,6 +2416,22 @@ function EventRecurrencePanel({
>
{repairLabel}
</span>
{workItemStatusLabel ? (
<span
className={cn(
"border px-2 py-0.5 text-xs font-semibold",
workItemTone === "owner_review"
? "border-[#b9a6d9] bg-[#f5f0ff] text-[#51358f]"
: workItemTone === "blocked"
? "border-[#e2a29b] bg-[#fff0ef] text-[#9f2f25]"
: workItemTone === "open"
? "border-[#d9b36f] bg-[#fff7e8] text-[#8a5a08]"
: "border-[#d8d3c7] bg-[#faf9f3] text-[#5f5b52]"
)}
>
{workItemStatusLabel}
</span>
) : null}
{runHref ? (
<Link
href={runHref as never}