GRI-2106: let a global or campus admin assign a device to a campus #238
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!238
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/GRI-2106-device-campus-assignment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #225
What changed
The Devices screen (approved devices list) now has a Campus control:
user.campusId === null) sees a dropdown of every campus.server's
may_accessscoping onPATCH /devices/{id}— they could neverreach another campus's option even if it were offered.
devices_managesees the device's campus as read-only textinstead of a control.
PATCH /devices/{id}requiresname, so the client resends the device'scurrent name alongside the chosen
campus_id.Files
frontend-web/src/api/types.ts—Device.campusIdfrontend-web/src/api/httpDevicesApi.ts— wire mapping,assignDeviceCampusfrontend-web/src/api/mockDevicesApi.ts— mock counterpartfrontend-web/src/api/devicesApi.ts— export the new functionfrontend-web/src/screens/DevicesScreen.tsx— the control, campus list, permission/role gatingfrontend-web/src/screens/DashboardScreen.tsx— passuserdown toDevicesScreenfrontend-web/src/screens/DevicesScreen.test.tsx— tests for both roles and the read-only caseTest plan
scripts/local-gates.sh --frontend-only: prettier, oxlint,tsc -b,vitest run(99 passed),vite build— all green.admin sees only their own campus as an option; a user without
devices_managesees read-only campus text instead of a control..gx-field/.gx-input/.gx-tagdesign-systemclasses already used elsewhere on this screen and on
UsersScreenfor thesame campus-picker pattern — no new colours, sizes or CSS, so existing
light/dark theming, focus rings and AA contrast carry over unchanged.
The control sits in the same
gx-card gx-list-itemflex row as theexisting Name/Host/Token/Playlist fields, so it wraps the same way at
narrow widths.
Review (Vivy, GRI-2110): approved. The server side is already in
dev:PATCH /devices/{id}takescampus_id, checksmay_accesson the target campus, andGET /campusesis open to any signed-in user, so a campus admin can load the screen. Tests cover global admin, campus admin and read-only. Branch updated fromdev(it was 2 behind after #235); merging when CI is green.Known limit, not for this PR: a campus cannot be cleared back to "every campus" (server, forge #159).