feat(picker): inline '+ Create new contact' on ContactPicker (MAPPS-276) #312

Merged
YousifShkara merged 1 commit from feat/MAPPS-276-picker-inline-create into main 2026-06-21 12:29:55 +02:00
Owner

Mirrors the CompanyPicker pattern (PMS-352): an allow_inline_create: bool prop opts the picker into a "+ Create new contact" button in the empty-list and populated-list dropdown branches, plus an inline modal that POSTs /contacts/contacts and auto-selects the newly-created row via the existing onselect callback. The modal seeds first/last from the typed query ("Jane Doe" -> first=Jane, last=Doe) so the form isn't blank when the user invokes it after typing. Inherits the picker's company_filter so the new contact lands attached to the company the parent form already picked (the New Ticket form's case).

The New Ticket form opts in - this was the QA's specific dead-end (a tenant whose only contact wasn't in the picked company couldn't finish a New Ticket flow without leaving the form). Other ContactPicker call sites stay opt-out by default.

AssetPicker still needs the same affordance - parking that as a sibling follow-up under this ticket. The Asset create form is heavier (asset type lookup, serial / tag, etc.) so a stripped inline modal is less obviously the right UX; recommend reviewing that one before adding it.

#MAPPS-276

Mirrors the CompanyPicker pattern (PMS-352): an `allow_inline_create: bool` prop opts the picker into a "+ Create new contact" button in the empty-list and populated-list dropdown branches, plus an inline modal that POSTs `/contacts/contacts` and auto-selects the newly-created row via the existing `onselect` callback. The modal seeds first/last from the typed query (`"Jane Doe"` -> first=Jane, last=Doe) so the form isn't blank when the user invokes it after typing. Inherits the picker's `company_filter` so the new contact lands attached to the company the parent form already picked (the New Ticket form's case). The New Ticket form opts in - this was the QA's specific dead-end (a tenant whose only contact wasn't in the picked company couldn't finish a New Ticket flow without leaving the form). Other ContactPicker call sites stay opt-out by default. AssetPicker still needs the same affordance - parking that as a sibling follow-up under this ticket. The Asset create form is heavier (asset type lookup, serial / tag, etc.) so a stripped inline modal is less obviously the right UX; recommend reviewing that one before adding it. #MAPPS-276
feat(picker): inline '+ Create new contact' on ContactPicker (MAPPS-276)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m14s
Create release / Create release from merged PR (pull_request) Has been skipped
22c8572238
Mirrors the CompanyPicker pattern (PMS-352): an `allow_inline_create: bool` prop opts the picker into a "+ Create new contact" button in the empty-list and populated-list dropdown branches, plus an inline modal that POSTs `/contacts/contacts` and auto-selects the newly-created row via the existing `onselect` callback. The modal seeds first/last from the typed query (`"Jane Doe"` -> first=Jane, last=Doe) so the form isn't blank when the user invokes it after typing. Inherits the picker's `company_filter` so the new contact lands attached to the company the parent form already picked (the New Ticket form's case).

The New Ticket form opts in - this was the QA's specific dead-end (a tenant whose only contact wasn't in the picked company couldn't finish a New Ticket flow without leaving the form). Other ContactPicker call sites stay opt-out by default.

AssetPicker still needs the same affordance - parking that as a sibling follow-up under this ticket. The Asset create form is heavier (asset type lookup, serial / tag, etc.) so a stripped inline modal is less obviously the right UX; recommend reviewing that one before adding it.

#MAPPS-276
YousifShkara deleted branch feat/MAPPS-276-picker-inline-create 2026-06-21 12:29:55 +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!312
No description provided.