feat(tickets): wire TicketDetailPage to real data (MAPPS-123) #68
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mapps-123-wire-ticket-detail"
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
TicketDetailPagewas 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 fetchedGET /tickets/:idbut 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
ticket.description(empty state when null).company_id), contact, queue, created + created_by. SLA unchanged.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).GET /time-entries?ticket_id=. Degrades to an empty state when that endpoint errors.Known dependency
GET /time-entries?ticket_id=currently returns 500 (server count-query placeholder bug inlist_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/:idreturns the real ticket (title "Test 2", description "Need fix", company "Niceguy IT", status "New", priority "Medium", SLA on_track) and/notesreturns{data:[],meta}- both decode into the new models.cargo check+cargo clippyclean onwasm32-unknown-unknown;cargo fmt --checkclean.🤖 Generated with Claude Code
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>