Show associated event detail in the decisions review expander #126
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/decision-rationale-events"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Enriches the expandable Rationale section on the
/decisionslist page so a reviewer can approve or reject a decision without opening the underlying incident.For a decision whose classification subject is an incident, the expander now shows, below the rationale text:
/events/{id}, a meta line (timestamp, payload type, source), and a full payload field table rendered through the existingAdminText.PayloadFieldshelper.Rows without an incident keep the rationale-only view. The expander now also opens for review rows that carry events even when the rationale text is empty.
No related issue.
How was this tested?
dotnet build- 0 errors, 0 warnings (Viegard.AdminApi)dotnet test- all pass (Viegard.AdminApi.Tests: 194/194)End-to-end render check against a disposable in-memory instance (no real installation or database touched): a synthetic Require-approval decision backed by a multi-event incident (mixed payload types, two distinct source addresses, varied timestamps) was seeded directly into the running process's in-memory stores through a temporary env-gated hook, the real login flow was driven, and
/decisionswas fetched.GET /decisionsreturned HTTP 200.rationale-eventsblocks, per-event/events/{id}links, payload field rows).Checklist
The /decisions rationale expander now lists the resolved incident's events below the rationale so a reviewer can approve or reject without opening the incident. Events are newest first by occurrence, capped at 20 with a link to the incident for the full set, and each event shows full payload field detail (via AdminText.PayloadFields), a link to /events/{id}, and an aggregate line (event count, distinct source addresses, time span). Rows without an incident keep the rationale-only view, and the expander now opens for review rows that carry events even when the rationale text is empty. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>