feat(settings): Load demo data button in Settings -> Data (PMS-679) #437

Merged
nrupard merged 2 commits from feat/PMS-679-load-demo-data-button into main 2026-07-22 17:39:39 +02:00
Owner

What

Adds a "Load demo data" button to Settings -> Data (the Import & Export page). One click populates an empty tenant with Mokosh's built-in demo dataset so a fresh account can be explored without touching the CLI.

Why

The Data settings group could export and import tenant data, but loading the demo dataset was CLI-only (mokosh-bootstrap qa-seed / the auto-seed on first visit). Nate wanted a UI button that works with seed data, not just a just/CLI command, for standing up and re-populating the demo.

How

A new SeedDemoPanel on the Import & Export page POSTs /data/seed-demo (the admin-only server endpoint added in the companion mokosh-server PMS-679 PR) via post_authed_typed and renders the outcome: green when the demo company/contacts/tickets were loaded, amber when the tenant already has data. This matches the server's additive, only-if-empty contract: it never overwrites existing data. The button is gated on use_can_mutate like the import panel, so the write is blocked while the server is unreachable. The page is already admin-only.

Depends on

mokosh-server PMS-679 (POST /api/v1/data/seed-demo). Merge that first so the endpoint exists.

PMS-679

## What Adds a "Load demo data" button to Settings -> Data (the Import & Export page). One click populates an empty tenant with Mokosh's built-in demo dataset so a fresh account can be explored without touching the CLI. ## Why The Data settings group could export and import tenant data, but loading the demo dataset was CLI-only (`mokosh-bootstrap qa-seed` / the auto-seed on first visit). Nate wanted a UI button that works with seed data, not just a `just`/CLI command, for standing up and re-populating the demo. ## How A new `SeedDemoPanel` on the Import & Export page POSTs `/data/seed-demo` (the admin-only server endpoint added in the companion mokosh-server PMS-679 PR) via `post_authed_typed` and renders the outcome: green when the demo company/contacts/tickets were loaded, amber when the tenant already has data. This matches the server's additive, only-if-empty contract: it never overwrites existing data. The button is gated on `use_can_mutate` like the import panel, so the write is blocked while the server is unreachable. The page is already admin-only. ## Depends on mokosh-server PMS-679 (`POST /api/v1/data/seed-demo`). Merge that first so the endpoint exists. PMS-679
feat(settings): add "Load demo data" button to Settings -> Data (PMS-679)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m17s
8527fa9cd9
The Data settings group could export and import tenant data but offered no way to populate an empty tenant with the built-in demo dataset; loading demo data was CLI-only. Add a SeedDemoPanel to the Import & Export page that POSTs /data/seed-demo (the admin-only server endpoint added in the mokosh-server PMS-679 change) and reports the outcome: green when the demo company/contacts/tickets were loaded, amber when the tenant already has data (the additive, only-if-empty contract - it never overwrites). The button is gated on use_can_mutate like the import panel so the write is blocked while the server is unreachable.

#PMS-679

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
style(settings): drop the dash in the Load demo data copy (PMS-679)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m17s
Create release / Create release from merged PR (pull_request) Has been skipped
aba014d807
Match the MAPPS-376 copy cleanup: "This only loads into an empty tenant - it never overwrites existing data." becomes two sentences ("...empty tenant. It never overwrites existing data.").

#PMS-679

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/PMS-679-load-demo-data-button 2026-07-22 17:39:39 +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!437
No description provided.