feat(settings): centralized Settings hub with standard-type editors (MAPPS-169) #148

Merged
nrupard merged 2 commits from feat/mapps-169-settings-hub into main 2026-06-15 15:49:41 +02:00
Owner

What

MAPPS-169 slice 1: a centralized Settings hub. One admin-gated left-nav entry lands on /settings, a grouped card index that gathers the previously-scattered "type 2" configuration surfaces.

Net-new "standard type" editors (full CRUD, no server change)

Wired to existing mokosh-server endpoints, each a paginated list with a create/edit/delete modal mirroring TaxRateListPage:

  • Work Types -> /work-types (/settings/work-types)
  • Task Statuses -> /task-statuses (/settings/task-statuses)
  • Asset Types -> /asset-types (/settings/asset-types)

Re-homed surfaces (reuse existing page components)

/settings/* sub-routes render the SAME page components as their original routes, so there is one source of truth per surface: SLA Management, Rate Cards, Tax Rates, Payment Gateways. Per the chosen scope the old nav items and the Invoice-page buttons are kept in place, so existing entry points and bookmarks keep working.

Decisions (confirmed with the issue owner before building)

  • IA: hub page + /settings/* sub-routes (not a nav section, not a single tabbed page).
  • Scope: existing surfaces + net-new type editors.
  • Old links: keep them and add Settings alongside (no removals/redirects this pass).

Deferred (need backend work, follow-ups)

  • Ticket statuses / types / priorities editors: the server exposes these read-only (GET only, no POST/PUT/DELETE).
  • Project types: hardcoded VARCHAR CHECK enums on projects, not a lookup table. A meaningful editor needs a migration to a lookup table first.

These are listed so the "anything with a standard type" part of the issue is tracked, not silently dropped.

Notes

  • Adds a CogIcon (Heroicons cog-6-tooth) for the nav entry.
  • Updates dev-docs/client-server-integration.md row 13.
  • No mokosh-server changes required.
  • Not compiled locally (no Rust toolchain in this environment). Relies on mirroring the established billing/SLA page idioms; gated by CI (cargo clippy --all-targets -- -D warnings).

Test plan

  • Sign in as an admin: "Settings" appears in the sidebar Admin group; /settings shows two card groups.
  • Each type editor: create, edit, delete a row; list refreshes; non-admins see the admin-only notice.
  • Re-homed cards open SLA / Rate Cards / Tax Rates / Payment Gateways; original nav items and Invoice buttons still work.
## What MAPPS-169 slice 1: a centralized **Settings** hub. One admin-gated left-nav entry lands on `/settings`, a grouped card index that gathers the previously-scattered "type 2" configuration surfaces. ### Net-new "standard type" editors (full CRUD, no server change) Wired to existing mokosh-server endpoints, each a paginated list with a create/edit/delete modal mirroring `TaxRateListPage`: - **Work Types** -> `/work-types` (`/settings/work-types`) - **Task Statuses** -> `/task-statuses` (`/settings/task-statuses`) - **Asset Types** -> `/asset-types` (`/settings/asset-types`) ### Re-homed surfaces (reuse existing page components) `/settings/*` sub-routes render the SAME page components as their original routes, so there is one source of truth per surface: SLA Management, Rate Cards, Tax Rates, Payment Gateways. Per the chosen scope the old nav items and the Invoice-page buttons are kept in place, so existing entry points and bookmarks keep working. ## Decisions (confirmed with the issue owner before building) - IA: hub page + `/settings/*` sub-routes (not a nav section, not a single tabbed page). - Scope: existing surfaces + net-new type editors. - Old links: keep them and add Settings alongside (no removals/redirects this pass). ## Deferred (need backend work, follow-ups) - Ticket statuses / types / priorities editors: the server exposes these read-only (`GET` only, no `POST/PUT/DELETE`). - Project types: hardcoded `VARCHAR` CHECK enums on `projects`, not a lookup table. A meaningful editor needs a migration to a lookup table first. These are listed so the "anything with a standard type" part of the issue is tracked, not silently dropped. ## Notes - Adds a `CogIcon` (Heroicons `cog-6-tooth`) for the nav entry. - Updates `dev-docs/client-server-integration.md` row 13. - No mokosh-server changes required. - Not compiled locally (no Rust toolchain in this environment). Relies on mirroring the established billing/SLA page idioms; gated by CI (`cargo clippy --all-targets -- -D warnings`). ## Test plan - Sign in as an admin: "Settings" appears in the sidebar Admin group; `/settings` shows two card groups. - Each type editor: create, edit, delete a row; list refreshes; non-admins see the admin-only notice. - Re-homed cards open SLA / Rate Cards / Tax Rates / Payment Gateways; original nav items and Invoice buttons still work.
feat(settings): centralized Settings hub with standard-type editors
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 41s
80f008f113
MAPPS-169 slice 1. Adds a single left-nav "Settings" entry (admin-gated) that lands on a new `/settings` hub of grouped cards, gathering the scattered "type 2" configuration surfaces in one place.

Net-new "standard type" editors, wired full-CRUD to existing server endpoints (no mokosh-server change needed): Work Types (`/work-types`), Task Statuses (`/task-statuses`), Asset Types (`/asset-types`). Each is a paginated list with a create/edit/delete modal, mirroring the proven `TaxRateListPage` pattern in billing.rs.

Re-homed configuration surfaces get `/settings/*` sub-routes that render the SAME existing page components (one source of truth per surface): SLA Management, Rate Cards, Tax Rates, Payment Gateways. Per the chosen scope the old nav items and Invoice-page buttons are left in place, so existing entry points and bookmarks keep working.

Deferred (need backend work, tracked as follow-ups): editors for ticket statuses/types/priorities (server exposes these read-only, no POST/PUT/DELETE) and project types (hardcoded VARCHAR CHECK enums, not a lookup table). Building those first requires server CRUD / a migration to a lookup table.

Adds a `CogIcon` (Heroicons cog-6-tooth) for the nav entry. Updates the client/server integration doc row 13 to reflect the new hub.

Not compiled locally (no Rust toolchain in this environment); relies on mirroring established page idioms and is gated by CI (`cargo clippy --all-targets -- -D warnings`).

#MAPPS-169

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(settings): correct modal prop types and admin-check borrow
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 50s
Create release / Create release from merged PR (pull_request) Has been skipped
7ae3ae563d
Two compile errors from CI:

- `use_is_admin` returned a value borrowed from a temporary `auth.read()` guard that was dropped at the end of the block (E0597). Bind the read guard to a named local so it outlives the returned `bool`, matching the `AuthGuard` pattern in lib.rs.

- `SettingFormModal`'s `title` and `create_label` props were `&'static str`, but rsx! coerces string-literal prop values to `String`, so every call site passed a `String` into a `&str` field (E0308). Make both props `String` and hand them owned values at the call sites.

#MAPPS-169

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/mapps-169-settings-hub 2026-06-15 15:49:41 +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!148
No description provided.