feat/PMS-482-kb-open-ticket #326

Merged
YousifShkara merged 2 commits from feat/PMS-482-kb-open-ticket into main 2026-06-24 09:35:20 +02:00
Owner
No description provided.
PMS-452 phase 1 added `tickets.source_kb_article_id` server-side so a ticket can record which KB article inspired it; the SPA's KB article page had no affordance to drive the column. PMS-482 wires the "Open ticket about this article" button on the article detail page through to the existing ticket-new form, pre-fills it from the article, and stamps the column on the create body.

What landed:

* KB article detail page (`pages/knowledge_base.rs::KBArticleDetailPage`) gains an "Open ticket about this article" anchor in the OverflowActions row, between the visibility badges and the Edit button. Plain `<a>` so the user can right-click to open the form in a new tab and the query string survives intact. The query carries `from_kb_article=<id>` + `from_kb_title=<title>` + `from_kb_url=<article path>` so the destination form can pre-fill without re-fetching the article (cheap, race-free, and works even when the user lands while logged out and gets bounced through the login flow).

* `pages/tickets.rs::TicketNewPage` gains `read_kb_prefill_from_url` (mirrors the existing `read_company_prefill_from_url` shape) and seeds the `title` signal with the article title and the `description` signal with `Article: <title>\nLink: <url>` so the user lands on a pre-filled form they can immediately edit and submit.

* The create body now carries `source_kb_article_id` parsed defensively from the captured prefill (a hand-edited URL with a non-UUID value falls through to `null` so the server-side validator is the source of truth). The FnMut submit handler clones the captured id into a per-call binding so a user who submits, hits an error, and re-submits does not panic on a moved value.

Follow-up filed as PMS-485 for the "Top ticket-driving articles" widget on the KB landing page - the server endpoint that powers it does not exist yet (the spec sketched the SQL but did not wire a handler), so both halves land together once that endpoint ships.

#PMS-482
chore: cargo fmt (PMS-482 follow-up)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 2m55s
Create release / Create release from merged PR (pull_request) Has been skipped
0ffe20b88e
YousifShkara deleted branch feat/PMS-482-kb-open-ticket 2026-06-24 09:35:21 +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!326
No description provided.