diff --git a/apps/dispatch/app/(app)/dispatch/_components/pannel/MissionForm.tsx b/apps/dispatch/app/(app)/dispatch/_components/pannel/MissionForm.tsx index 9fc6e487..9740c983 100644 --- a/apps/dispatch/app/(app)/dispatch/_components/pannel/MissionForm.tsx +++ b/apps/dispatch/app/(app)/dispatch/_components/pannel/MissionForm.tsx @@ -145,6 +145,7 @@ export const MissionForm = () => { return; } for (const key in missionFormValues) { + console.debug(key, missionFormValues[key as keyof MissionOptionalDefaults]); if (key === "addressOSMways") continue; // Skip addressOSMways as it is handled separately form.setValue( key as keyof MissionOptionalDefaults, @@ -416,11 +417,20 @@ export const MissionForm = () => { In diesem Einsatz gibt es {form.watch("addressOSMways").length} Gebäude

-

- In diesem Einsatz gibt es {form.watch("xPlaneObjects").length} Objekte -

+
+

+ In diesem Einsatz gibt es {form.watch("xPlaneObjects").length} Objekte +

+ +
diff --git a/apps/dispatch/app/_components/map/ContextMenu.tsx b/apps/dispatch/app/_components/map/ContextMenu.tsx index d4b70496..7d65038f 100644 --- a/apps/dispatch/app/_components/map/ContextMenu.tsx +++ b/apps/dispatch/app/_components/map/ContextMenu.tsx @@ -13,6 +13,8 @@ import { Scan, Car, Ambulance, + Siren, + Flame, } from "lucide-react"; import { getOsmAddress } from "_querys/osm"; import { useEffect, useState } from "react"; @@ -43,15 +45,16 @@ export const ContextMenu = () => { setOpen, isOpen: isPannelOpen, } = usePannelStore((state) => state); - const [showRulerOptions, setShowRulerOptions] = useState(false); + const [showObjectOptions, setShowObjectOptions] = useState(false); const [rulerHover, setRulerHover] = useState(false); const [rulerOptionsHover, setRulerOptionsHover] = useState(false); const dispatcherConnected = useDispatchConnectionStore((s) => s.status) === "connected"; useEffect(() => { - setShowRulerOptions(rulerHover || rulerOptionsHover); - }, [rulerHover, rulerOptionsHover]); + const showObjectOptions = rulerHover || rulerOptionsHover; + setShowObjectOptions(showObjectOptions); + }, [isPannelOpen, rulerHover, rulerOptionsHover, setOpen]); useEffect(() => { const handleContextMenu = (e: any) => { @@ -198,8 +201,8 @@ export const ContextMenu = () => { > - {/* Ruler Options - shown when Ruler button is hovered or options are hovered */} - {showRulerOptions && ( + {/* XPlane Object Options - shown when Ruler button is hovered or options are hovered */} + {showObjectOptions && (
setRulerOptionsHover(true)} @@ -207,8 +210,8 @@ export const ContextMenu = () => { >
diff --git a/apps/dispatch/app/_components/map/MapAdditionals.tsx b/apps/dispatch/app/_components/map/MapAdditionals.tsx index f60a2829..6dea267e 100644 --- a/apps/dispatch/app/_components/map/MapAdditionals.tsx +++ b/apps/dispatch/app/_components/map/MapAdditionals.tsx @@ -8,6 +8,8 @@ import { HPGValidationRequired } from "_helpers/hpgValidationRequired"; import { getConnectedAircraftsAPI } from "_querys/aircrafts"; import { useMapStore } from "_store/mapStore"; import { useDispatchConnectionStore } from "_store/dispatch/connectionStore"; +import { is } from "date-fns/locale"; +import { XplaneObject } from "@repo/db"; export const MapAdditionals = () => { const { isOpen, missionFormValues } = usePannelStore((state) => state); @@ -53,6 +55,20 @@ export const MapAdditionals = () => { interactive={false} /> )} + {isOpen && + missionFormValues?.xPlaneObjects && + (missionFormValues.xPlaneObjects as unknown as XplaneObject[]).map((obj, index) => ( + + ))} {markersNeedingAttention.map((mission) => ( { return missionStationIds?.some((id) => { const aircraft = aircrafts?.find((a) => a.stationId === id); - return aircraft?.posXplanePluginActive; }); }; diff --git a/apps/dispatch/public/icons/ambulance.png b/apps/dispatch/public/icons/ambulance.png new file mode 100644 index 00000000..114a9abf Binary files /dev/null and b/apps/dispatch/public/icons/ambulance.png differ diff --git a/apps/dispatch/public/icons/fire_engine.png b/apps/dispatch/public/icons/fire_engine.png new file mode 100644 index 00000000..2f11c4e4 Binary files /dev/null and b/apps/dispatch/public/icons/fire_engine.png differ diff --git a/apps/dispatch/public/icons/police.png b/apps/dispatch/public/icons/police.png new file mode 100644 index 00000000..bd0132c4 Binary files /dev/null and b/apps/dispatch/public/icons/police.png differ