fix/MAPPS-304-asset-save-spurious-error #335

Merged
YousifShkara merged 1 commit from fix/MAPPS-304-asset-save-spurious-error into main 2026-06-25 08:05:01 +02:00
Owner
No description provided.
feat(approvals): ticket-detail Approvals section + top-bar badge (PMS-486)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m53s
Create release / Create release from merged PR (pull_request) Has been skipped
dabbe6bc98
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
fix(assets): treat post-save decode quirks as success on the edit modal (MAPPS-304)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 12m13s
Create release / Create release from merged PR (pull_request) Has been skipped
1cfb097530
QA reported "every successful asset edit shows an error toast even though
the saved value persists". Investigation found the edit modal's save
path called the string-returning put_authed::<serde_json::Value, _>,
which collapses three distinct outcomes into one error string:
- the server returned a non-2xx (a real failure worth surfacing),
- the transport died before a response arrived (a real failure worth
  surfacing),
- the server returned 2xx but the JSON body could not be decoded into
  the target type (mutation succeeded; the post-mutation deserialize
  quirk is irrelevant because the page re-fetches the row).

The third case was being treated as a save failure and rendered inline
in the modal, which matches the QA symptom exactly: the row updated
on the server, the page reloads and shows the new value, but the
"could not save" message fires on the same response.

Switch to put_authed_typed::<serde_json::Value, _>, which returns
ApiError variants. Map Ok and Decode to the success path (close the
modal, refetch asset + audit, push a success toast); keep Status and
Network on the inline-error path so a genuine 4xx / 5xx still surfaces.

Also drops the bare loaded asset_resource / audit_resource restart in
favor of the same restart-on-success ordering plus a success toast, so
the user gets positive confirmation rather than silence.

Acceptance criteria:
- Editing an asset field shows a success toast and no error: covered
  by the Ok + Decode branches pushing AlertType::Success and clearing
  e_error.
- Change History panel + per-entry actor / timestamp / field / old /
  new shipped under PR #297 (PMS-304 audit panel three-state rework).

#MAPPS-304
YousifShkara deleted branch fix/MAPPS-304-asset-save-spurious-error 2026-06-25 08:05:02 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!335
No description provided.