GRI-2190: panel for the assign-playlist replace/campus-mismatch contract (forge #310) #319
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!319
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/GRI-2190-playlist-devices-panel"
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?
Panel half of forge #310, after the server contract (GRI-2201, merged to
devatc3e062a) and the server fail-first tests (GRI-2200/#315).PlaylistDevicesTab.tsx (playlist editor's Devices tab)
A device's checkbox is disabled, with a reason in its label, when:
(on <playlist name>), fromGET /device-playlist-assignments(every device's assignment, not just this playlist's);(different campus).Saving still sends
replace: false(the default) for newly ticked devices — unchanged, since a disabled checkbox already keeps a conflicting device out of the selection. The save error now shows the server's own message (e.g. a 409 from a race) instead of a generic one.DevicesScreen.tsx
Adds a playlist selector per approved device, gated on
content_assign(the permissionassign_playlistrequires), filtered to playlists of the device's own campus or open to every campus (mirrors the server's campus check). Choosing a playlist:replace: false) when the device shows none yet;<device>shows<A>. Move it to<B>?" first when it already shows one, and only sendsreplace: trueon confirmation — mirrors the inline confirm pattern already used for playlist deletion (PlaylistSettingsTab.tsx).API / types
assignPlaylistToDevice(httpPlaylistsApi.ts) takes an optionalreplace(defaultfalse) and sends it on the wire.ApiErrorDetailsgetscurrent_playlist,device_campus,playlist_campusto match the server'sdevice_already_assigned/campus_mismatchdetail shapes.mockPlaylistsApi.tsmirrors the server's checks (campus mismatch first, then already-assigned unlessreplace) so the mock-backed test suite exercises the real contract.Verified
./scripts/local-gates.sh --frontend-onlygreen in the working tree (prettier, oxlint, tsc, vitest — 205 tests, build) before push.PlaylistsScreen.test.tsx(disabled + reason for another-playlist and campus-mismatch devices),DevicesScreen.test.tsx(direct assign, move-confirm, cancel, campus-filtered selector, selector hidden withoutcontent_assign).gx-*classes and tokens already used by the surrounding rows (campus select, delete confirm).