From 228feb0512fd36386798be8464f17766721afbe6 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:57 -0700 Subject: [PATCH 1/4] fix deployment flow --- .github/workflows/deploy-production.yml | 4 ++-- apps/hub/app/(app)/events/page.tsx | 7 +++++-- packages/database/prisma/json/User.ts | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 6593c4fb..79c47532 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -38,7 +38,7 @@ jobs: - name: Build and start containers uses: appleboy/ssh-action@v1 with: - host: ${{ vars.STAGING_HOST }} + host: ${{ vars.PRODUCTION_HOST }} username: ${{ secrets.SSH_USERNAME }} password: ${{ secrets.SSH_PASSWORD }} port: 22 @@ -46,4 +46,4 @@ jobs: export NVM_DIR="$HOME/.nvm" source "$NVM_DIR/nvm.sh" cd ~/docker/var-monorepo - pnpm staging-start + pnpm prod-start diff --git a/apps/hub/app/(app)/events/page.tsx b/apps/hub/app/(app)/events/page.tsx index d8e2e93b..fbd72617 100644 --- a/apps/hub/app/(app)/events/page.tsx +++ b/apps/hub/app/(app)/events/page.tsx @@ -10,6 +10,9 @@ const page = async () => { if (!user) return null; const events = await prisma.event.findMany({ + where: { + hidden: false, + }, include: { Appointments: { where: { @@ -65,8 +68,8 @@ const page = async () => { return (
-

- Events & Kurse +

+ Events & Kurse

diff --git a/packages/database/prisma/json/User.ts b/packages/database/prisma/json/User.ts index 443dbd03..3c91a500 100644 --- a/packages/database/prisma/json/User.ts +++ b/packages/database/prisma/json/User.ts @@ -9,8 +9,8 @@ export interface PublicUser { } export const DISCORD_ROLES = { - ONLINE_DISPATCHER: "1287399540390891571", // Replace with actual role ID - ONLINE_PILOT: "1287399540390891571", // Replace with actual role ID + ONLINE_DISPATCHER: "1287399540390891571", + ONLINE_PILOT: "1287399540390891571", DISPATCHER: "1081247459994501222", PILOT: "1081247405304975390", }; From a905872f256910c32d57b6b20b385f9895f9d3ea Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:06:00 -0700 Subject: [PATCH 2/4] Fix Station-Select --- .../dispatch/_components/StationSelect.tsx | 27 ++++++++++++------- .../navbar/_components/Connection.tsx | 2 +- .../app/_components/map/MapAdditionals.tsx | 3 +++ .../app/_components/map/MissionMarkers.tsx | 22 +++++++-------- .../map/_components/MissionMarkerTabs.tsx | 11 +++++--- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx b/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx index f435050e..7c685caa 100644 --- a/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx +++ b/apps/dispatch/app/(app)/dispatch/_components/StationSelect.tsx @@ -45,16 +45,9 @@ export function StationsSelect({ queryFn: () => getStationsAPI(), }); - const [value, setValue] = useState(selectedStations?.map((id) => String(id)) || []); - - useEffect(() => { - setValue([ - ...(selectedStations || []).map((id) => String(id)), - ...(vehicleStates.hpgAmbulanceState !== HpgState.NOT_REQUESTED || undefined ? ["RTW"] : []), - ...(vehicleStates.hpgFireEngineState !== HpgState.NOT_REQUESTED || undefined ? ["FW"] : []), - ...(vehicleStates.hpgPoliceState !== HpgState.NOT_REQUESTED || undefined ? ["POL"] : []), - ]); - }, [selectedStations, vehicleStates]); + const [value, setValue] = useState( + selectedStations?.map((id) => String(id)) || [], + ); // Helper to check if a station is a vehicle and its state is NOT_REQUESTED const stationsOptions = [ @@ -101,6 +94,20 @@ export function StationsSelect({ return true; }); + useEffect(() => { + if (isMulti) { + setValue([ + ...(selectedStations || []).map((id) => String(id)), + ...(vehicleStates.hpgAmbulanceState !== HpgState.NOT_REQUESTED || undefined ? ["RTW"] : []), + ...(vehicleStates.hpgFireEngineState !== HpgState.NOT_REQUESTED || undefined ? ["FW"] : []), + ...(vehicleStates.hpgPoliceState !== HpgState.NOT_REQUESTED || undefined ? ["POL"] : []), + ]); + } else { + console.log("clear selected stations"); + setValue(null); + } + }, [selectedStations, vehicleStates, isMulti]); + return ( { const { isOpen, missionFormValues } = usePannelStore((state) => state); + const dispatcherConnectionState = useDispatchConnectionStore((state) => state.status); const { data: missions = [] } = useQuery({ queryKey: ["missions"], queryFn: () => @@ -32,6 +34,7 @@ export const MapAdditionals = () => { m.hpgValidationState === "POSITION_AMANDED" && m.state === "draft" && m.hpgLocationLat && + dispatcherConnectionState === "connected" && m.hpgLocationLng, ); diff --git a/apps/dispatch/app/_components/map/MissionMarkers.tsx b/apps/dispatch/app/_components/map/MissionMarkers.tsx index 36d2a8bc..3dee1d2e 100644 --- a/apps/dispatch/app/_components/map/MissionMarkers.tsx +++ b/apps/dispatch/app/_components/map/MissionMarkers.tsx @@ -82,7 +82,7 @@ const MissionPopupContent = ({ return ( <>
{ setOpenMissionMarker({ open: [], @@ -95,7 +95,7 @@ const MissionPopupContent = ({
{mission.state === "draft" && (
{ className="min-w-[320px] flex-1" isMulti={false} onChange={(v) => { + console.log("Selected Station:", v); setSelectedStation({ selectedStationId: v?.selectedStationIds[0], - hpgAmbulanceState: mission.hpgAmbulanceState || HpgState.NOT_REQUESTED, - hpgFireEngineState: mission.hpgFireEngineState || HpgState.NOT_REQUESTED, - hpgPoliceState: mission.hpgPoliceState || HpgState.NOT_REQUESTED, + hpgAmbulanceState: + v.hpgAmbulanceState || mission.hpgAmbulanceState || HpgState.NOT_REQUESTED, + hpgFireEngineState: + v.hpgFireEngineState || mission.hpgFireEngineState || HpgState.NOT_REQUESTED, + hpgPoliceState: + v.hpgPoliceState || mission.hpgPoliceState || HpgState.NOT_REQUESTED, }); }} selectedStations={mission.missionStationIds} @@ -548,6 +552,7 @@ const Rettungsmittel = ({ mission }: { mission: Mission }) => {