feat(tickets): wire TicketDetailPage to real data (MAPPS-123) #68

Merged
longjacksonle merged 1 commit from feat/mapps-123-wire-ticket-detail into main 2026-06-05 21:03:38 +02:00

What

TicketDetailPage was almost entirely hardcoded demo content (the "Exchange server" description, John Smith / Jane Doe activity timeline, "1.5 hours" time logged, Acme Corp / Bob Johnson details). It fetched GET /tickets/:id but read only the SLA fields, so on a real ticket it rendered someone else's fake data. This wires the whole page to real data.

Changes

  • Description -> ticket.description (empty state when null).
  • Details -> real status/priority badges, assignee, company (linked by company_id), contact, queue, created + created_by. SLA unchanged.
  • Activity -> real notes from GET /tickets/:id/notes, refreshed after Add Note; empty state when none. NOTE: there is no audit/event feed, so status-change / assignment events are intentionally not shown (notes only).
  • Time Logged -> total + per-entry list from GET /time-entries?ticket_id=. Degrades to an empty state when that endpoint errors.
  • Removed the fabricated Related (Contract/Asset) card - no backend data for it.

Known dependency

GET /time-entries?ticket_id= currently returns 500 (server count-query placeholder bug in list_time_entries), so Time Logged shows its empty state until that server fix lands (tracked separately). The page itself is robust to the failure.

Verification

Against the real ticket a5e696de-...: GET /tickets/:id returns the real ticket (title "Test 2", description "Need fix", company "Niceguy IT", status "New", priority "Medium", SLA on_track) and /notes returns {data:[],meta} - both decode into the new models. cargo check + cargo clippy clean on wasm32-unknown-unknown; cargo fmt --check clean.

🤖 Generated with Claude Code

## What `TicketDetailPage` was almost entirely hardcoded demo content (the "Exchange server" description, John Smith / Jane Doe activity timeline, "1.5 hours" time logged, Acme Corp / Bob Johnson details). It fetched `GET /tickets/:id` but read only the SLA fields, so on a real ticket it rendered someone else's fake data. This wires the whole page to real data. ## Changes - **Description** -> `ticket.description` (empty state when null). - **Details** -> real status/priority badges, assignee, company (linked by `company_id`), contact, queue, created + created_by. SLA unchanged. - **Activity** -> real notes from `GET /tickets/:id/notes`, refreshed after Add Note; empty state when none. NOTE: there is no audit/event feed, so status-change / assignment events are intentionally not shown (notes only). - **Time Logged** -> total + per-entry list from `GET /time-entries?ticket_id=`. Degrades to an empty state when that endpoint errors. - Removed the fabricated **Related** (Contract/Asset) card - no backend data for it. ## Known dependency `GET /time-entries?ticket_id=` currently returns **500** (server count-query placeholder bug in `list_time_entries`), so Time Logged shows its empty state until that server fix lands (tracked separately). The page itself is robust to the failure. ## Verification Against the real ticket `a5e696de-...`: `GET /tickets/:id` returns the real ticket (title "Test 2", description "Need fix", company "Niceguy IT", status "New", priority "Medium", SLA on_track) and `/notes` returns `{data:[],meta}` - both decode into the new models. `cargo check` + `cargo clippy` clean on `wasm32-unknown-unknown`; `cargo fmt --check` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(tickets): wire TicketDetailPage to real ticket data (MAPPS-123)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 43s
Create release / Create release from merged PR (pull_request) Has been skipped
fd1c2d21e3
The detail page was almost entirely hardcoded template ("Exchange server" description, John Smith / Jane Doe activity, "1.5 hours" time, Acme Corp details). It fetched GET /tickets/:id but read only the SLA fields, so a real ticket rendered someone else's fake data. Masked until the auth/dummy-data fix landed; obvious now that real tickets render.

Drive the page off the real ticket plus its notes and time entries:
- Description: ticket.description (empty state when null).
- Details: real status/priority badges, assigned_to_name, company_name (linked by company_id), contact_name, queue_name, created (with created_by). SLA badge/due unchanged.
- Activity: real ticket notes from GET /tickets/:id/notes, refreshed after Add Note; empty state when none. There is no audit/event feed, so status-change/assignment events are intentionally not shown.
- Time Logged: total + per-entry list from GET /time-entries?ticket_id=. Degrades to an empty state when that endpoint errors (it currently 500s on the ticket_id filter due to a server count-query bug, tracked separately).
- Removed the fabricated Related (Contract/Asset) card; the ticket response carries no such data.

Adds RemoteTicketDetail / RemoteNote / RemoteTimeEntry / Paginated<T> models and shared status/priority badge-variant + datetime helpers. cargo check + clippy clean on wasm32; fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/mapps-123-wire-ticket-detail 2026-06-05 21:03:38 +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!68
No description provided.