feat(tickets): inline 'Create new company' affordance in CompanyPicker on New Ticket #188
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!188
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-352-inline-create-company-on-ticket-form"
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?
A first-time technician on a tenant with zero companies could not complete the New Ticket flow: Company is required, the picker only surfaced "No companies yet" or "No matches", and there was no inline action to seed one. The only path forward was to leave the form, navigate to Companies, create one, return, retype the title + description, and resubmit. PMS-352 reviewer flagged this as a hard dead-end that bites every new tenant on day one.
CompanyPicker grows an opt-in
allow_inline_createprop (default off so the Contact / time-entry pickers stay unchanged). When true the dropdown renders a "+ Create new company" action under both the empty and populated states; clicking it opens a slim Modal carrying a name input that seeds from whatever the user already typed into the picker's search (so the rare "I searched 'Acme' and Acme isn't here, create it" case auto-fills the name and you just hit Create). On a successful POST /contacts/companies the new row is fed through the picker's existingonselecthandler, so the New Ticket form lands with the just-created company already picked and every other field preserved.The minimal POST body matches the server's CreateCompanyRequest defaults (Client type, Active status, portal_enabled true) so the modal doesn't have to surface those decisions on a fast-path create; the user can refine them later from the company detail page. A short note under the input says exactly that so the convention isn't a surprise. The picker's underlying companies list refetches after the POST so a later "Change" reload sees the new row in the dropdown.
#PMS-352