feat(tickets): wire Add Note, New, Log Time, Detail title (PMC-23) #28

Closed
David wants to merge 0 commits from feat/pmc-23-tickets-ui into main
Owner

Summary

Closes PMC-23 (Tickets UI). Four commits, one per actionable sub-task. Already-resolved PMC-24 was closed in the audit pass; PMC-29 (filter/sort/pagination) and PMC-30 (search) were deferred to a follow-up that lands after the list-wire from PR #26 (PMC-2) merges, since both require a real Vec of remote tickets to operate on rather than hardcoded TicketRow rsx blocks.

  • PMC-28: detail-page header uses Ticket {props.id} instead of the hardcoded "TKT-1234: Email server not responding" so every route gets a distinct browser title.
  • PMC-26: Log Time button is now a Link to TimeEntryNew instead of a dead Button. Pre-populating the ticket via a query param is a follow-up that requires extending the router.
  • PMC-27: TicketNewPage submit POSTs /api/v1/tickets and navigates to the new detail page on success. Company UUID handling is best-effort until the company dropdown gets the contacts wire; failures surface on the console for now (toast lands with PMC-10 once #26 merges).
  • PMC-25: Add Note modal binds note_type / note_content signals to its inputs and POSTs to /api/v1/tickets/{id}/notes. Empty content short-circuits; failures keep the modal open for retry.

Test plan

  • cargo check --features web clean
  • Navigate to /tickets/abc123 and confirm the header reads "Ticket abc123" and the browser tab title matches
  • On TicketDetail, click Log Time and confirm navigation to /time/new
  • On TicketNew, submit the form and confirm the network POST hits /api/v1/tickets; on auth-free dev, expect a 401 in devtools and the form staying mounted
  • On TicketDetail, open Add Note, type content, submit; confirm the POST and the modal closing on a 2xx, staying open on error

🤖 Generated with Claude Code

## Summary Closes PMC-23 (Tickets UI). Four commits, one per actionable sub-task. Already-resolved PMC-24 was closed in the audit pass; PMC-29 (filter/sort/pagination) and PMC-30 (search) were deferred to a follow-up that lands after the list-wire from PR #26 (PMC-2) merges, since both require a real Vec of remote tickets to operate on rather than hardcoded `TicketRow` rsx blocks. - `PMC-28`: detail-page header uses `Ticket {props.id}` instead of the hardcoded "TKT-1234: Email server not responding" so every route gets a distinct browser title. - `PMC-26`: Log Time button is now a Link to TimeEntryNew instead of a dead Button. Pre-populating the ticket via a query param is a follow-up that requires extending the router. - `PMC-27`: TicketNewPage submit POSTs `/api/v1/tickets` and navigates to the new detail page on success. Company UUID handling is best-effort until the company dropdown gets the contacts wire; failures surface on the console for now (toast lands with PMC-10 once #26 merges). - `PMC-25`: Add Note modal binds `note_type` / `note_content` signals to its inputs and POSTs to `/api/v1/tickets/{id}/notes`. Empty content short-circuits; failures keep the modal open for retry. ## Test plan - [ ] `cargo check --features web` clean - [ ] Navigate to `/tickets/abc123` and confirm the header reads "Ticket abc123" and the browser tab title matches - [ ] On TicketDetail, click Log Time and confirm navigation to `/time/new` - [ ] On TicketNew, submit the form and confirm the network POST hits `/api/v1/tickets`; on auth-free dev, expect a 401 in devtools and the form staying mounted - [ ] On TicketDetail, open Add Note, type content, submit; confirm the POST and the modal closing on a 2xx, staying open on error 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replace the hardcoded "TKT-1234: Email server not responding" header with "Ticket {props.id}" so every detail-page URL gets a distinct title and the browser tab/back-button history reflect the route the user actually navigated to. Real ticket numbers and subjects will replace the bare id once the detail-page fetch lands (tracked under the API client story).

#PMC-28 State Done
The Log Time button on TicketDetailPage had no onclick handler. Wrap it in a Link to Route::TimeEntryNew so the click navigates to the time entry form instead of being a dead affordance. The destination form does not yet pre-select the originating ticket; threading a ticket_id query param into TimeEntryNew is a follow-up that requires extending the router and the TimeEntryNewPage form, tracked as part of the time-tracking story.

#PMC-26 State Done
TicketNewPage no longer rides a 1-second mock timeout. The submit handler now POSTs the form data to /api/v1/tickets and navigates to the new ticket's detail page on success.

The company dropdown still serves the hardcoded "1"/"2"/"3" placeholder options pending the contacts wire; non-UUID values are mapped to `Uuid::nil()` so the request exercises the wire and the server returns a validation error rather than 400ing on JSON shape. On failure the error is logged to the browser console and the form stays mounted so the user can retry without losing input. Toast surfacing of the error lands with the API client story (PMC-10).

#PMC-27 State Done
feat(tickets): wire Add Note modal submit + inputs (PMC-25)
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 4s
Create release / Create release from merged PR (pull_request) Has been skipped
85473f9006
The Add Note modal on TicketDetailPage was a UI shell: the Select and Textarea fed no signals, and the footer Add Note button had no onclick. Bind `note_type` / `note_content` signals to the inputs, wire the footer button to POST `/api/v1/tickets/{id}/notes` (using the route's `props.id`), close the modal and clear the textarea on success.

Empty-content submissions short-circuit instead of round-tripping. POST failures log to the browser console; the toast surface from PMC-10 isn't on this branch yet so we keep the modal open and let the user retry.

#PMC-25 State Done
vas2000-work closed this pull request 2026-05-21 01:21:55 +02:00
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 4s
Required
Details
Create release / Create release from merged PR (pull_request) Has been skipped

Pull request closed

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!28
No description provided.