feat(web): admin settings page — module cards, toggles, config forms #105

Merged
forbes merged 4 commits from feat-admin-settings-api into main 2026-02-15 09:09:18 +00:00
Owner

Summary

Add admin-only Module Configuration section to the Settings page (issue #100).

Changes

New components:

  • AdminModules.tsx — Top-level section fetching GET /api/modules + GET /api/admin/settings, rendering Infrastructure/Features groups with restart-required banner
  • ModuleCard.tsx — Collapsible card per module with:
    • Toggle switch for optional modules (dependency validation)
    • Status badges (Active / Disabled / Error)
    • Module-specific field layouts (read-only for infrastructure, editable for features)
    • Save button (PUT /api/admin/settings/{module})
    • Test Connection button for database and storage (POST /api/admin/settings/{module}/test)

Modified:

  • types.ts — Added ModuleInfo, ModulesResponse, AdminSettingsResponse, UpdateSettingsResponse, TestConnectivityResponse
  • SettingsPage.tsx — Renders <AdminModules /> for admin users

Backend (included from prior commits on this branch)

  • SettingsRepository for module_state and settings_overrides tables
  • Admin settings API endpoints: GET/PUT settings, POST test connectivity
  • Handler tests

Closes #100

## Summary Add admin-only Module Configuration section to the Settings page (issue #100). ### Changes **New components:** - `AdminModules.tsx` — Top-level section fetching `GET /api/modules` + `GET /api/admin/settings`, rendering Infrastructure/Features groups with restart-required banner - `ModuleCard.tsx` — Collapsible card per module with: - Toggle switch for optional modules (dependency validation) - Status badges (Active / Disabled / Error) - Module-specific field layouts (read-only for infrastructure, editable for features) - Save button (`PUT /api/admin/settings/{module}`) - Test Connection button for database and storage (`POST /api/admin/settings/{module}/test`) **Modified:** - `types.ts` — Added `ModuleInfo`, `ModulesResponse`, `AdminSettingsResponse`, `UpdateSettingsResponse`, `TestConnectivityResponse` - `SettingsPage.tsx` — Renders `<AdminModules />` for admin users ### Backend (included from prior commits on this branch) - `SettingsRepository` for `module_state` and `settings_overrides` tables - Admin settings API endpoints: GET/PUT settings, POST test connectivity - Handler tests Closes #100
forbes added 4 commits 2026-02-15 09:01:56 +00:00
Provides CRUD operations on the module_state and settings_overrides
tables (created in migration 016).

- GetModuleStates / SetModuleState — upsert module enabled/disabled
- GetOverrides / SetOverride / DeleteOverride — JSONB config overrides

Part of #99
Add four admin-only endpoints under /api/admin/settings:

- GET  /                — full config (secrets redacted)
- GET  /{module}        — single module config
- PUT  /{module}        — toggle modules + persist config overrides
- POST /{module}/test   — test external connectivity (database, storage)

PUT publishes a settings.changed SSE event. Config overrides are
persisted for future hot-reload support; changes to database/storage/
server/schemas namespaces return restart_required: true.

Wires SettingsRepository into Server struct.

Closes #99
- TestGetAllSettings — all module keys present, secrets redacted
- TestGetModuleSettings — single module response
- TestGetModuleSettings_Unknown — 404 for unknown module
- TestToggleModule — disable projects, verify registry state
- TestToggleModule_DependencyError — enable dag without jobs, expect 400
- TestToggleRequiredModule — disable core, expect 400
- TestTestConnectivity_Database — ping database, expect success
- TestTestConnectivity_NotTestable — core module, expect 400
Add admin-only Module Configuration section to the Settings page.
Each module gets a collapsible card with enable/disable toggle,
status badge, module-specific config fields, save and test
connectivity buttons.

- AdminModules: fetches GET /api/modules + GET /api/admin/settings,
  renders Infrastructure and Features groups, restart banner
- ModuleCard: collapsible card with toggle, status badge, field
  layouts per module, save (PUT) and test (POST) actions
- TypeScript types for ModuleInfo, ModulesResponse, admin settings
  API response shapes

Ref: #100
forbes merged commit decb32c3e7 into main 2026-02-15 09:09:18 +00:00
forbes deleted branch feat-admin-settings-api 2026-02-15 09:09:18 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#105