feat(approvals): ticket-detail Approvals section + top-bar badge (PMS-486) #334
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!334
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-486-approvals-tab-and-badge"
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?
PMS-481 shipped the standalone /approvals queue; PMS-486 lands the
two remaining surfaces that touch existing high-traffic chrome.
Top-bar pending-approvals chip (ApprovalsBadge in components/layout.rs):
GET /approvals/pendingon mount + on every active-org switch.no extra chrome.
the /approvals page; carries an aria-label so screen readers
announce the count.
Ticket-detail Approvals section (ApprovalsSection in pages/tickets.rs):
the Activity timeline; owns its own fetch
(
GET /tickets/{id}/approvals), modal state, and refresh cycle sothe diff to TicketDetailPage stays at one line.
("To: name" / "Role: role"), requester, requested-at, optional
notes, and decision + decided-at + decision_notes once decided.
(mutually exclusive with) a free-text role Input, plus an optional
notes Textarea. Submit POSTs
/tickets/{id}/approvalsand refreshesthe list on success; the server's XOR validator surfaces inline if
both or neither are filled.
Tabs primitive in use today, so a tab would have meant introducing
a new component just for one section. A Card matches every other
ticket-detail section (Details, Activity, etc.).
#PMS-486
PMS-481 shipped the standalone /approvals queue; PMS-486 lands the two remaining surfaces that touch existing high-traffic chrome. Top-bar pending-approvals chip (ApprovalsBadge in components/layout.rs): - Polls `GET /approvals/pending` on mount + on every active-org switch. - Collapses to an empty span when count == 0 so non-approver users see no extra chrome. - Otherwise renders a yellow rounded chip ("Approvals N") linking to the /approvals page; carries an aria-label so screen readers announce the count. Ticket-detail Approvals section (ApprovalsSection in pages/tickets.rs): - Self-contained component invoked once from TicketDetailPage above the Activity timeline; owns its own fetch (`GET /tickets/{id}/approvals`), modal state, and refresh cycle so the diff to TicketDetailPage stays at one line. - Lists every approval row with a state Badge, approver scope ("To: name" / "Role: role"), requester, requested-at, optional notes, and decision + decided-at + decision_notes once decided. - "Request approval" button opens a Modal with a user-picker Select (mutually exclusive with) a free-text role Input, plus an optional notes Textarea. Submit POSTs `/tickets/{id}/approvals` and refreshes the list on success; the server's XOR validator surfaces inline if both or neither are filled. - Rendered as a Card rather than a tab: the ticket-detail page has no Tabs primitive in use today, so a tab would have meant introducing a new component just for one section. A Card matches every other ticket-detail section (Details, Activity, etc.). #PMS-486