feat(forms): inline create-company on contact, contract, and asset forms (PMS-352 AC3) #249

Merged
nrupard merged 1 commit from feat/pms-352-inline-create-remaining-pickers into main 2026-06-17 15:59:01 +02:00
Owner

What

Finishes PMS-352 AC3: the inline "+ Create new company" affordance (added to the New Ticket form in PR #188) now exists on every other company-required FK picker, so a first-time tenant with zero companies is never dead-ended on a create form.

Call sites converted (AC3 list)

Form Before After
New Ticket CompanyPicker + inline create unchanged (PR #188)
New/Edit Contact CompanyPicker, no inline create allow_inline_create: true (one flag - same component)
New Contract (create) plain company Select CompanyPicker + inline create
Edit Contract disabled Select unchanged (company is immutable post-create)
New Asset plain company Select CompanyPicker + inline create; dropped the now-unused company option list / fetch

Behavior

  • Create a company inline from any of these forms; on success it is auto-selected and the form returns with other fields preserved (the picker uses a modal - no navigation).
  • Populated state unchanged: CompanyPicker renders existing companies as the Select did.
  • CompanyPicker has no error prop, so the existing company_err inline message is surfaced just below the picker on the contract and asset forms.

Out of scope (documented, not skipped silently)

The time-entry Work Item picker is a required FK too, but its dependency is a ticket or project, not a company - CompanyPicker does not apply. It needs ticket/project inline-create (heavier; the issue's fallback #3 redirect-with-return pattern), tracked separately. It is unblocked transitively: ticket creation can now seed a company inline, so the no-company root cause no longer cascades.

Verification

cargo fmt --all --check, cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings, and a wasm cargo check all pass.

#PMS-352

## What Finishes PMS-352 AC3: the inline "+ Create new company" affordance (added to the New Ticket form in PR #188) now exists on every other company-required FK picker, so a first-time tenant with zero companies is never dead-ended on a create form. ## Call sites converted (AC3 list) | Form | Before | After | | --- | --- | --- | | New Ticket | CompanyPicker + inline create | unchanged (PR #188) | | New/Edit Contact | CompanyPicker, no inline create | `allow_inline_create: true` (one flag - same component) | | New Contract (create) | plain company `Select` | CompanyPicker + inline create | | Edit Contract | disabled `Select` | unchanged (company is immutable post-create) | | New Asset | plain company `Select` | CompanyPicker + inline create; dropped the now-unused company option list / fetch | ## Behavior - Create a company inline from any of these forms; on success it is auto-selected and the form returns with other fields preserved (the picker uses a modal - no navigation). - Populated state unchanged: CompanyPicker renders existing companies as the Select did. - CompanyPicker has no `error` prop, so the existing `company_err` inline message is surfaced just below the picker on the contract and asset forms. ## Out of scope (documented, not skipped silently) The time-entry **Work Item** picker is a required FK too, but its dependency is a **ticket or project**, not a company - CompanyPicker does not apply. It needs ticket/project inline-create (heavier; the issue's fallback #3 redirect-with-return pattern), tracked separately. It is unblocked transitively: ticket creation can now seed a company inline, so the no-company root cause no longer cascades. ## Verification `cargo fmt --all --check`, `cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings`, and a wasm `cargo check` all pass. #PMS-352
feat(forms): inline create-company on contact, contract, and asset forms (PMS-352 AC3)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m53s
Create release / Create release from merged PR (pull_request) Has been skipped
9e084d4983
PMS-352 added the inline "+ Create new company" affordance to the CompanyPicker on the New Ticket form, but the issue's AC3 asks for the same on every other required-FK picker so a first-time tenant with zero companies is never dead-ended. This finishes that sweep for the company-required forms:

- Contact form: the CompanyPicker already drives this required field, so just opt it into allow_inline_create.
- Contract create form: replace the company Select with CompanyPicker (allow_inline_create); the edit flow keeps its disabled Select since a contract's company is immutable post-create. CompanyPicker has no error prop, so company_err is surfaced just below it.
- New Asset form: replace the company Select with CompanyPicker (allow_inline_create) and drop the now-unused company option list / companies fetch (the picker fetches and filters its own list).

Each create form now lets the user create a company inline and returns to the form with it pre-selected and other fields preserved, matching the New Ticket behavior. The populated state is unchanged (CompanyPicker renders existing rows). The time-entry Work Item picker is intentionally not converted here: its dependency is a ticket or project, not a company, so it needs ticket/project inline-create rather than CompanyPicker; it is unblocked transitively now that ticket creation can seed a company inline.

#PMS-352
nrupard deleted branch feat/pms-352-inline-create-remaining-pickers 2026-06-17 15:59:01 +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!249
No description provided.