From 363a8241a8655faf5f43e532537d2d4fb46f01e7 Mon Sep 17 00:00:00 2001 From: nocnico Date: Tue, 3 Jun 2025 21:44:20 +0200 Subject: [PATCH] Only show drafts to dispatchers #28 --- .../app/_components/left/SituationBoard.tsx | 71 ++++++++++--------- apps/dispatch/app/globals.css | 5 ++ 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/apps/dispatch/app/_components/left/SituationBoard.tsx b/apps/dispatch/app/_components/left/SituationBoard.tsx index f65510a0..5e86f229 100644 --- a/apps/dispatch/app/_components/left/SituationBoard.tsx +++ b/apps/dispatch/app/_components/left/SituationBoard.tsx @@ -70,7 +70,7 @@ export const SituationBoard = () => { {/* head */} - ID + E-Nr. Stichwort Stadt Stationen @@ -78,39 +78,42 @@ export const SituationBoard = () => { {/* row 1 */} - {missions?.map((mission) => ( - { - setOpenMissionMarker({ - open: [ - { - id: mission.id, - tab: "home", - }, - ], - close: [], - }); - setMap({ - center: { - lat: mission.addressLat, - lng: mission.addressLng, - }, - zoom: 14, - }); - }} - key={mission.id} - className={cn(mission.state === "draft" && "bg-base-300")} - > - {mission.publicId} - {mission.missionKeywordAbbreviation} - {mission.addressCity} - - {(mission as any).MissionsOnStations?.map( - (mos: { Station: Station }) => mos.Station?.bosCallsignShort, - ).join(", ")} - - - ))} + {missions?.map( + (mission) => + (dispatcherConnected || mission.state !== "draft") && ( + { + setOpenMissionMarker({ + open: [ + { + id: mission.id, + tab: "home", + }, + ], + close: [], + }); + setMap({ + center: { + lat: mission.addressLat, + lng: mission.addressLng, + }, + zoom: 14, + }); + }} + key={mission.id} + className={cn(mission.state === "draft" && "missionListItem")} + > + {mission.publicId} + {mission.missionKeywordAbbreviation} + {mission.addressCity} + + {(mission as any).MissionsOnStations?.map( + (mos: { Station: Station }) => mos.Station?.bosCallsignShort, + ).join(", ")} + + + ), + )} diff --git a/apps/dispatch/app/globals.css b/apps/dispatch/app/globals.css index c64d71cc..ea6e4152 100644 --- a/apps/dispatch/app/globals.css +++ b/apps/dispatch/app/globals.css @@ -56,3 +56,8 @@ .leaflet-popup-close-button { display: none; } + +.missionListItem { + background-color: color-mix(in oklab, var(--color-info) 8%, var(--color-base-100)); + color: var(--color-info, var(--color-base-content)); +}