GRI-2075: let a global admin manage campuses from Settings #219

Merged
vivy merged 8 commits from feature/GRI-2075-panel-campus-admin into dev 2026-11-15 13:31:02 +00:00
Member

Summary

Closes #207.

A global admin had no way to add, edit or delete campuses, or open a campus's own settings, from the panel — only a campus-scoped user with a campus already on their account could reach CampusSettingsScreen.

  • Server (crates/server/src/campus.rs): GET /campuses now returns device/playlist counts per campus; DELETE /campuses/{id} returns a structured 409 campus_in_use naming what still uses the campus (media, playlists, devices, IP rules), instead of a bare error.
  • Panel: new CampusesScreen at /settings/campuses — list with counts, add, rename, delete. A refused delete surfaces the server's message naming what's in use. Selecting a campus opens the existing CampusSettingsScreen. Campus-scoped users still see only their own campus.

Contract was agreed with QA on forge #213 before implementation (13/13 of astraea's acceptance tests pass).

Test plan

  • ./scripts/local-gates.sh — cargo fmt/clippy/test/deny, frontend-web prettier/oxlint/tsc/vitest (63/63, 7 new), frontend-web build — all green
  • A global admin can create a campus, rename it, set its playback default, and delete an empty one, all from the panel
  • A campus admin cannot see other campuses
  • Deleting a campus still in use shows what's using it rather than a bare error
## Summary Closes #207. A global admin had no way to add, edit or delete campuses, or open a campus's own settings, from the panel — only a campus-scoped user with a campus already on their account could reach `CampusSettingsScreen`. - Server (`crates/server/src/campus.rs`): `GET /campuses` now returns device/playlist counts per campus; `DELETE /campuses/{id}` returns a structured `409 campus_in_use` naming what still uses the campus (media, playlists, devices, IP rules), instead of a bare error. - Panel: new `CampusesScreen` at `/settings/campuses` — list with counts, add, rename, delete. A refused delete surfaces the server's message naming what's in use. Selecting a campus opens the existing `CampusSettingsScreen`. Campus-scoped users still see only their own campus. Contract was agreed with QA on forge #213 before implementation (13/13 of astraea's acceptance tests pass). ## Test plan - [x] `./scripts/local-gates.sh` — cargo fmt/clippy/test/deny, frontend-web prettier/oxlint/tsc/vitest (63/63, 7 new), frontend-web build — all green - [x] A global admin can create a campus, rename it, set its playback default, and delete an empty one, all from the panel - [x] A campus admin cannot see other campuses - [x] Deleting a campus still in use shows what's using it rather than a bare error
GRI-2080: acceptance tests for campus CRUD counts and in-use delete details
Some checks failed
CI / the pre-push hook (pull_request) Successful in 27s
CI / cargo fmt (pull_request) Successful in 26s
CI / cargo clippy (pull_request) Successful in 2m16s
CI / cargo deny (pull_request) Successful in 1m55s
CI / cargo test (pull_request) Failing after 2m54s
CI / repository boundary (pull_request) Successful in 46s
CI / cargo deny advisories (pull_request) Successful in 2m12s
CI / frontend-web (pull_request) Successful in 1m48s
CI / CI (pull_request) Failing after 59s
CI / Notify gate failed (pull_request) Successful in 1m3s
b0cf7dd331
Server: GET /campuses now returns device/playlist counts per campus,
and DELETE returns a structured 409 campus_in_use naming what still
uses it. Panel: new Settings -> Campuses screen (list, add, rename,
delete with the server's in-use message surfaced) that opens into the
existing CampusSettingsScreen for a global admin.
GRI-2075: fix clippy expect_used in join_english
Some checks failed
CI / the pre-push hook (pull_request) Successful in 37s
CI / cargo fmt (pull_request) Successful in 38s
CI / cargo clippy (pull_request) Successful in 3m0s
CI / cargo deny (pull_request) Successful in 2m45s
CI / cargo deny advisories (pull_request) Successful in 2m37s
CI / cargo test (pull_request) Failing after 3m29s
CI / repository boundary (pull_request) Successful in 45s
CI / frontend-web (pull_request) Successful in 1m54s
CI / CI (pull_request) Failing after 40s
CI / Notify gate failed (pull_request) Successful in 40s
ab5e047a81
Settings is now a left-menu section (SettingsSectionScreen/CampusesTab,
NetworkSettingsTab, PlaybackSettingsTab) rather than one SettingsScreen.
Campus CRUD moves into CampusesTab, and opening one campus from that list
renders CampusSettingsScreen with a back link while the left menu stays on
Campuses.
GRI-2075: prettier parens on ternary in SettingsSectionScreen
Some checks failed
CI / the pre-push hook (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 1m11s
CI / cargo clippy (pull_request) Successful in 2m6s
CI / cargo deny advisories (pull_request) Successful in 1m35s
CI / repository boundary (pull_request) Successful in 1m3s
CI / frontend-web (pull_request) Successful in 1m50s
CI / cargo test (pull_request) Successful in 3m58s
CI / cargo fmt (pull_request) Failing after 14m19s
CI / CI (pull_request) Has been cancelled
CI / Notify gate failed (pull_request) Has been cancelled
061d2b1ccd
GRI-2075: retrigger CI (cargo fmt job hit its 10m timeout after 14m19s on 061d2b1, a hang not a formatting diff; cargo fmt --all --check passes locally on that commit)
All checks were successful
CI / the pre-push hook (pull_request) Successful in 12s
CI / cargo fmt (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 1m39s
CI / cargo deny advisories (pull_request) Successful in 1m39s
CI / cargo clippy (pull_request) Successful in 2m12s
CI / repository boundary (pull_request) Successful in 44s
CI / frontend-web (pull_request) Successful in 1m55s
CI / cargo test (pull_request) Successful in 3m53s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 19s
50d9a680d5
vivy requested changes 2026-11-15 12:35:19 +00:00
Dismissed
vivy left a comment

Server side is good: list counts, and the 409 campus_in_use now names what still uses the campus, with all four counts in details. Gating to global admin is right.

One change before merge: Delete (CampusesTab.tsx:138) acts on one click, with no confirmation. The server refuses a campus that is in use, but an empty campus and its settings (playback defaults etc.) are gone on a misclick, and less technical colleagues use this screen. Ask first: 'Delete campus ()? This cannot be undone.' with Cancel / Delete, and a test that Cancel sends no DELETE.

Also: dev moved (#214 merged), so merge origin/dev again; block_on_outdated_branch will refuse the merge otherwise.

Server side is good: list counts, and the 409 campus_in_use now names what still uses the campus, with all four counts in details. Gating to global admin is right. One change before merge: Delete (CampusesTab.tsx:138) acts on one click, with no confirmation. The server refuses a campus that is in use, but an empty campus and its settings (playback defaults etc.) are gone on a misclick, and less technical colleagues use this screen. Ask first: 'Delete campus <name> (<code>)? This cannot be undone.' with Cancel / Delete, and a test that Cancel sends no DELETE. Also: dev moved (#214 merged), so merge origin/dev again; block_on_outdated_branch will refuse the merge otherwise.
Merge remote-tracking branch 'origin/dev' into feature/GRI-2075-panel-campus-admin
All checks were successful
CI / the pre-push hook (pull_request) Successful in 10s
CI / cargo fmt (pull_request) Successful in 10s
CI / cargo deny advisories (pull_request) Successful in 1m35s
CI / cargo deny (pull_request) Successful in 1m36s
CI / cargo clippy (pull_request) Successful in 2m29s
CI / repository boundary (pull_request) Successful in 56s
CI / frontend-web (pull_request) Successful in 2m5s
CI / cargo test (pull_request) Successful in 4m7s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 17s
f182f89043
vivy approved these changes 2026-11-15 13:30:53 +00:00
vivy left a comment

Delete now asks for confirmation, with a Cancel test. Current with dev, CI green. Approved.

Delete now asks for confirmation, with a Cancel test. Current with dev, CI green. Approved.
vivy merged commit 91606c788d into dev 2026-11-15 13:31:02 +00:00
vivy deleted branch feature/GRI-2075-panel-campus-admin 2026-11-15 13:31:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
Grimoirix/grimoire-of-digital-signage!219
No description provided.