From 07d1f0883746a28b3890f1170ef45b598c38e35f Mon Sep 17 00:00:00 2001 From: nocnico Date: Sun, 18 May 2025 16:39:18 +0200 Subject: [PATCH 1/3] New Btn Layout for running Missions --- .../map/_components/MissionMarkerTabs.tsx | 113 +++++++++++------- 1 file changed, 71 insertions(+), 42 deletions(-) diff --git a/apps/dispatch/app/dispatch/_components/map/_components/MissionMarkerTabs.tsx b/apps/dispatch/app/dispatch/_components/map/_components/MissionMarkerTabs.tsx index a63f2705..ed5fcd90 100644 --- a/apps/dispatch/app/dispatch/_components/map/_components/MissionMarkerTabs.tsx +++ b/apps/dispatch/app/dispatch/_components/map/_components/MissionMarkerTabs.tsx @@ -61,9 +61,36 @@ const Einsatzdetails = ({ mission }: { mission: Mission }) => { const { setMissionFormValues, setOpen } = usePannelStore((state) => state); return (
-

- Einsatzdetails -

+
+

+ Einsatzdetails +

+ {mission.state !== "draft" && ( +
+ +
+ )} +
-
-
- + {mission.state === "draft" && ( +
+
+
+ - - {mission.state === "draft" && ( - - )} -
+ + +
+
+ )}
); }; From f571f95b91151b3dd66b4fbf6d6f2ca34f078598 Mon Sep 17 00:00:00 2001 From: nocnico Date: Sun, 18 May 2025 17:08:53 +0200 Subject: [PATCH 2/3] update fms letter colors --- .../_components/map/AircraftMarker.tsx | 22 ++++++++++++++++++- .../map/_components/AircraftMarkerTabs.tsx | 16 ++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx b/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx index e97b48a8..6e390301 100644 --- a/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx +++ b/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx @@ -42,6 +42,16 @@ export const FMS_STATUS_COLORS: { [key: string]: string } = { "7": "rgb(140,10,10)", "8": "rgb(186,105,0)", "9": "rgb(10,134,25)", + E: "rgb(186,105,0)", + C: "rgb(186,105,0)", + F: "rgb(186,105,0)", + J: "rgb(186,105,0)", + L: "rgb(186,105,0)", + c: "rgb(186,105,0)", + d: "rgb(186,105,0)", + h: "rgb(186,105,0)", + o: "rgb(186,105,0)", + u: "rgb(186,105,0)", }; export const FMS_STATUS_TEXT_COLORS: { [key: string]: string } = { @@ -55,7 +65,17 @@ export const FMS_STATUS_TEXT_COLORS: { [key: string]: string } = { "7": "rgb(243,27,25)", "8": "rgb(255,143,0)", "9": "rgb(9,212,33)", - N: "rgb(153,153,153)", + N: "rgb(9,212,33)", + E: "rgb(255,143,0)", + C: "rgb(255,143,0)", + F: "rgb(255,143,0)", + J: "rgb(255,143,0)", + L: "rgb(255,143,0)", + c: "rgb(255,143,0)", + d: "rgb(255,143,0)", + h: "rgb(255,143,0)", + o: "rgb(255,143,0)", + u: "rgb(255,143,0)", }; const AircraftPopupContent = ({ diff --git a/apps/dispatch/app/dispatch/_components/map/_components/AircraftMarkerTabs.tsx b/apps/dispatch/app/dispatch/_components/map/_components/AircraftMarkerTabs.tsx index 82b28a19..18a635aa 100644 --- a/apps/dispatch/app/dispatch/_components/map/_components/AircraftMarkerTabs.tsx +++ b/apps/dispatch/app/dispatch/_components/map/_components/AircraftMarkerTabs.tsx @@ -161,9 +161,21 @@ const FMSStatusSelector = ({ !dispatcherConnected && "cursor-not-allowed", )} style={{ - backgroundColor: "var(--color-base-200)", - color: "gray", + backgroundColor: + hoveredStatus === status + ? FMS_STATUS_COLORS[6] + : aircraft.fmsStatus === status + ? FMS_STATUS_COLORS[status] + : "var(--color-base-200)", + color: + aircraft.fmsStatus === status + ? "white" + : hoveredStatus === status + ? "white" + : "gray", }} + onMouseEnter={() => setHoveredStatus(status)} + onMouseLeave={() => setHoveredStatus(null)} onClick={async () => { await changeAircraftMutation.mutateAsync({ id: aircraft.id, From 0983ca2320003b716a7da1b2a6c810985fbaddc2 Mon Sep 17 00:00:00 2001 From: nocnico Date: Mon, 19 May 2025 00:29:19 +0200 Subject: [PATCH 3/3] New Context Menu Design --- .../dispatch/_components/map/ContextMenu.tsx | 336 +++++++++++++----- apps/dispatch/package.json | 2 +- package-lock.json | 8 +- 3 files changed, 259 insertions(+), 87 deletions(-) diff --git a/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx b/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx index e8247ef0..401614f6 100644 --- a/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx +++ b/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx @@ -2,8 +2,16 @@ import { OSMWay } from "@repo/db"; import { useMapStore } from "_store/mapStore"; import { usePannelStore } from "_store/pannelStore"; -import { MapPinned, Search } from "lucide-react"; -import { useEffect } from "react"; +import { + MapPin, + MapPinned, + Radius, + Ruler, + Search, + RulerDimensionLine, + Scan, +} from "lucide-react"; +import { useEffect, useState } from "react"; import { Popup, useMap } from "react-leaflet"; export const ContextMenu = () => { @@ -11,11 +19,19 @@ export const ContextMenu = () => { const { contextMenu, setContextMenu, setSearchElements, setSearchPopup } = useMapStore(); const { setMissionFormValues, setOpen } = usePannelStore((state) => state); + const [showRulerOptions, setShowRulerOptions] = useState(false); + const [rulerHover, setRulerHover] = useState(false); + const [rulerOptionsHover, setRulerOptionsHover] = useState(false); + + useEffect(() => { + setShowRulerOptions(rulerHover || rulerOptionsHover); + }, [rulerHover, rulerOptionsHover]); + useEffect(() => { const handleContextMenu = (e: any) => { setContextMenu({ lat: e.latlng.lat, lng: e.latlng.lng }); }; - const handleClick = (e: any) => { + const handleClick = () => { setContextMenu(null); setSearchPopup(null); }; @@ -27,7 +43,7 @@ export const ContextMenu = () => { map.off("contextmenu", handleContextMenu); map.off("click", handleClick); }; - }, [contextMenu]); + }, [map, contextMenu, setContextMenu, setSearchPopup]); if (!contextMenu) return null; @@ -76,86 +92,242 @@ export const ContextMenu = () => { autoPan={false} > {/* // TODO: maske: */} -
- - + setOpen(true); + setMissionFormValues({ + addressLat: contextMenu.lat, + addressLng: contextMenu.lng, + addressCity: data.address.city || data.address.town, + addressStreet: `${data.address.road}, ${data.address.house_number || "keine HN"}`, + addressZip: data.address.postcode, + state: "draft", + addressOSMways: [(exactAddress || closestToContext) as any], + }); + }} + > + + + {/* Left Button */} + + {/* Bottom Button */} + + {/* Right Button (original Search button) */} + + {/* Ruler Options - shown when Ruler button is hovered or options are hovered */} + {showRulerOptions && ( +
setRulerOptionsHover(true)} + onMouseLeave={() => setRulerOptionsHover(false)} + > +
+ + + +
+
+ )} +
); diff --git a/apps/dispatch/package.json b/apps/dispatch/package.json index 117864a5..802a889f 100644 --- a/apps/dispatch/package.json +++ b/apps/dispatch/package.json @@ -22,7 +22,7 @@ "leaflet": "^1.9.4", "livekit-client": "^2.9.7", "livekit-server-sdk": "^2.10.2", - "lucide-react": "^0.482.0", + "lucide-react": "^0.511.0", "next": "^15.1.0", "next-auth": "^4.24.11", "postcss": "^8.5.1", diff --git a/package-lock.json b/package-lock.json index c3712661..19c28091 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "leaflet": "^1.9.4", "livekit-client": "^2.9.7", "livekit-server-sdk": "^2.10.2", - "lucide-react": "^0.482.0", + "lucide-react": "^0.511.0", "next": "^15.1.0", "next-auth": "^4.24.11", "postcss": "^8.5.1", @@ -83,9 +83,9 @@ } }, "apps/dispatch/node_modules/lucide-react": { - "version": "0.482.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.482.0.tgz", - "integrity": "sha512-XM8PzHzSrg8ATmmO+fzf+JyYlVVdQnJjuyLDj2p4V2zEtcKeBNAqAoJIGFv1x2HSBa7kT8gpYUxwdQ0g7nypfw==", + "version": "0.511.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.511.0.tgz", + "integrity": "sha512-VK5a2ydJ7xm8GvBeKLS9mu1pVK6ucef9780JVUjw6bAjJL/QXnd4Y0p7SPeOUMC27YhzNCZvm5d/QX0Tp3rc0w==", "license": "ISC", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"