feat(settings): project type editor in the Settings hub (MAPPS-173) #151

Merged
nrupard merged 2 commits from feat/mapps-173-project-type-editor into main 2026-06-15 17:38:22 +02:00
Owner

What

MAPPS-173: the client editor for project types, wired to the project_types lookup table + CRUD that shipped in PMS-322. This finishes the MAPPS-169 standard-type editors.

A Project Types card in the hub's "Service & Asset Types" group links to /settings/project-types: a paginated list with a create/edit/delete modal, admin-gated, refetching on tenant switch, reusing the shared save_lookup / delete_lookup / SettingFormModal / ActiveBadge helpers.

Fields match the server DTO: name, is_default, is_active, sort_order (is_system is server-owned and never sent).

System rows

PMS-322 seeds client / internal as is_system rows, which the server refuses to delete. The editor honors that:

  • a gray System badge in the list,
  • on a system row the modal disables the name field and hides the Delete button (via a new deletable prop on SettingFormModal, defaulted to true so the other eight editors are unchanged),
  • default / active / sort-order remain editable on system rows.

Notes

  • No mokosh-server changes; depends on PMS-322 (merged).
  • Not compiled locally (no Rust toolchain here). Mirrors the existing AssetType editor; gated by CI (cargo clippy --all-targets -- -D warnings).

Test plan

  • As an admin, open /settings: "Project Types" appears under "Service & Asset Types".
  • Create / edit / delete a non-system type; list refreshes; non-admins see the admin-only notice.
  • Open a seeded client / internal row: name field is disabled, no Delete button, but toggling default/active and changing sort order still saves.
  • Attempt nothing destructive on system rows; confirm the server-side delete refusal is never reachable from the UI.
## What MAPPS-173: the client editor for project types, wired to the `project_types` lookup table + CRUD that shipped in PMS-322. This finishes the MAPPS-169 standard-type editors. A **Project Types** card in the hub's "Service & Asset Types" group links to `/settings/project-types`: a paginated list with a create/edit/delete modal, admin-gated, refetching on tenant switch, reusing the shared `save_lookup` / `delete_lookup` / `SettingFormModal` / `ActiveBadge` helpers. Fields match the server DTO: `name`, `is_default`, `is_active`, `sort_order` (`is_system` is server-owned and never sent). ## System rows PMS-322 seeds `client` / `internal` as `is_system` rows, which the server refuses to delete. The editor honors that: - a gray **System** badge in the list, - on a system row the modal disables the name field and hides the Delete button (via a new `deletable` prop on `SettingFormModal`, defaulted to `true` so the other eight editors are unchanged), - default / active / sort-order remain editable on system rows. ## Notes - No mokosh-server changes; depends on PMS-322 (merged). - Not compiled locally (no Rust toolchain here). Mirrors the existing AssetType editor; gated by CI (`cargo clippy --all-targets -- -D warnings`). ## Test plan - As an admin, open `/settings`: "Project Types" appears under "Service & Asset Types". - Create / edit / delete a non-system type; list refreshes; non-admins see the admin-only notice. - Open a seeded `client` / `internal` row: name field is disabled, no Delete button, but toggling default/active and changing sort order still saves. - Attempt nothing destructive on system rows; confirm the server-side delete refusal is never reachable from the UI.
feat(settings): project type editor in the Settings hub
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 56s
267414e211
MAPPS-173. Adds the client editor for the PMS-322 project_types lookup table to the Settings hub, completing the MAPPS-169 standard-type editors.

A "Project Types" card in the hub's "Service & Asset Types" group links to /settings/project-types: a paginated list with a create/edit/delete modal, admin-gated, refetching on tenant switch, reusing the shared save_lookup/delete_lookup/SettingFormModal/ActiveBadge helpers from the existing editors. Fields match the server DTO: name, is_default, is_active, sort_order (is_system is server-owned and not sent).

The seeded client/internal rows carry is_system, which the server refuses to delete. The editor honors that: a System badge in the list, and on those rows the modal disables the name field and hides the Delete button (via a new defaulted `deletable` prop on SettingFormModal) while still allowing default/active/sort-order changes.

Not compiled locally (no Rust toolchain in this environment); mirrors the established AssetType editor and is gated by CI (cargo clippy --all-targets -- -D warnings).

#MAPPS-173

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(settings): stop showing the empty-state message when a list fetch fails
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 58s
Create release / Create release from merged PR (pull_request) Has been skipped
623f1b4c1c
Code-review follow-up. On a failed list fetch the editors showed the LoadError banner AND the "No X yet. Click New X to add one." empty row, because the empty branch only checked rows.is_empty(). Guard it with !fetch_failed so a fetch failure shows just the banner (the table body renders empty), while a genuinely empty list still shows the prompt. Applied uniformly to all nine Settings editors so they stay consistent.

#MAPPS-173

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/mapps-173-project-type-editor 2026-06-15 17:38:22 +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!151
No description provided.