printedparts stage 12: admin settings page + settings-rail card
Some checks failed
CI / backend (push) Successful in 1m42s
CI / naming (push) Successful in 1s
CI / frontend (push) Successful in 7s
CI / migrations-mysql (push) Failing after 7s

PrintedPartsSettings edits the four plugin settings (code prefix,
default threshold, kiosk badge policy, alert recipients) through the
core settings API; the route rides the plugin's router file and the
settings shell nests it into the rail; get_settings_cards contributes
the catalog card while the plugin is enabled.
This commit is contained in:
cproudlock
2026-07-17 08:25:33 -04:00
parent df918ed38f
commit 427eb0de8c
4 changed files with 142 additions and 0 deletions

View File

@@ -306,6 +306,20 @@ CONTRACT ADDITION, because the mailer was not on the plugin surface:
crossing, no re-fire while below, rearm after restock (see
`test_lowstock_alert_fires_on_crossing_only`).
## Stage 12 (extension) - the admin settings page
A get_settings_cards card needs a PAGE to link, which is why stage 9 deferred
it. The page is ordinary:
1. `frontend/src/views/settings/PrintedPartsSettings.vue` - load the four
keys via `settingsApi.list({category: 'printedparts'})`, save each with
`settingsApi.update(key, value)` (admin-gated server-side).
2. Route in the PLUGIN's router file with path `settings/printedparts` +
`requiresAuth, requiresAdmin, plugin` meta - the router shell
automatically nests any `settings/...` path under the two-pane settings
rail.
3. `get_settings_cards` on the plugin pointing at `/settings/printedparts` -
the card appears in the rail's catalog while the plugin is enabled.
---
## Where each pattern lives (cheat sheet)