E Nr, Karte Zentrieren, Statin-select
This commit is contained in:
@@ -63,7 +63,7 @@ router.put("/", async (req, res) => {
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0"); // Months are zero-based
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
|
||||
const publicId = `__${year}${month}${day}${missionsTodayCount ? missionsTodayCount + 1 : 1}`;
|
||||
const publicId = `ENr.: ${year}${month}${day}${missionsTodayCount ? missionsTodayCount + 1 : 1}`;
|
||||
const newMission = await prisma.mission.create({
|
||||
data: {
|
||||
...req.body,
|
||||
|
||||
@@ -50,9 +50,9 @@ export function StationsSelect({
|
||||
useEffect(() => {
|
||||
setValue([
|
||||
...(selectedStations || []).map((id) => String(id)),
|
||||
...(vehicleStates.hpgAmbulanceState !== HpgState.NOT_REQUESTED ? ["RTW"] : []),
|
||||
...(vehicleStates.hpgFireEngineState !== HpgState.NOT_REQUESTED ? ["FW"] : []),
|
||||
...(vehicleStates.hpgPoliceState !== HpgState.NOT_REQUESTED ? ["POL"] : []),
|
||||
...(vehicleStates.hpgAmbulanceState !== HpgState.NOT_REQUESTED || undefined ? ["RTW"] : []),
|
||||
...(vehicleStates.hpgFireEngineState !== HpgState.NOT_REQUESTED || undefined ? ["FW"] : []),
|
||||
...(vehicleStates.hpgPoliceState !== HpgState.NOT_REQUESTED || undefined ? ["POL"] : []),
|
||||
]);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [selectedStations, vehicleStates]);
|
||||
@@ -110,18 +110,9 @@ export function StationsSelect({
|
||||
onChange={(v) => {
|
||||
setValue(v);
|
||||
if (!isMulti) return onChange?.(v);
|
||||
const hpgAmbulanceState =
|
||||
vehicleStates.hpgAmbulanceState === "NOT_REQUESTED" && v.includes("RTW")
|
||||
? HpgState.DISPATCHED
|
||||
: vehicleStates.hpgAmbulanceState;
|
||||
const hpgFireEngineState =
|
||||
vehicleStates.hpgFireEngineState === "NOT_REQUESTED" && v.includes("FW")
|
||||
? HpgState.DISPATCHED
|
||||
: vehicleStates.hpgFireEngineState;
|
||||
const hpgPoliceState =
|
||||
vehicleStates.hpgPoliceState === "NOT_REQUESTED" && v.includes("POL")
|
||||
? HpgState.DISPATCHED
|
||||
: vehicleStates.hpgPoliceState;
|
||||
const hpgAmbulanceState = v.includes("RTW") ? HpgState.DISPATCHED : HpgState.NOT_REQUESTED;
|
||||
const hpgFireEngineState = v.includes("FW") ? HpgState.DISPATCHED : HpgState.NOT_REQUESTED;
|
||||
const hpgPoliceState = v.includes("POL") ? HpgState.DISPATCHED : HpgState.NOT_REQUESTED;
|
||||
|
||||
onChange?.({
|
||||
selectedStationIds: v
|
||||
|
||||
@@ -3,7 +3,6 @@ import React, { useEffect } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { BellRing, BookmarkPlus, Radio } from "lucide-react";
|
||||
import { Select } from "_components/Select";
|
||||
import { KEYWORD_CATEGORY, Mission, missionType, Prisma } from "@repo/db";
|
||||
import {
|
||||
JsonValueType,
|
||||
@@ -254,6 +253,7 @@ export const MissionForm = () => {
|
||||
isMulti
|
||||
selectedStations={form.watch("missionStationIds")}
|
||||
onChange={(v) => {
|
||||
console.log("Selected stations:", v);
|
||||
form.setValue("missionStationIds", v.selectedStationIds);
|
||||
form.setValue("hpgAmbulanceState", v.hpgAmbulanceState);
|
||||
form.setValue("hpgFireEngineState", v.hpgFireEngineState);
|
||||
|
||||
@@ -71,7 +71,7 @@ const AircraftPopupContent = ({
|
||||
}
|
||||
}, [currentTab, aircraft, mission]);
|
||||
|
||||
const setOpenAircraftMarker = useMapStore((state) => state.setOpenAircraftMarker);
|
||||
const { setOpenAircraftMarker, setMap } = useMapStore((state) => state);
|
||||
const { anchor } = useSmartPopup();
|
||||
return (
|
||||
<>
|
||||
@@ -133,7 +133,13 @@ const AircraftPopupContent = ({
|
||||
style={{
|
||||
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
|
||||
}}
|
||||
/* onClick={() => handleTabChange("fms")} */
|
||||
onClick={() => {
|
||||
if (!aircraft.posLat || !aircraft.posLng) return;
|
||||
setMap({
|
||||
center: [aircraft.posLat, aircraft.posLng],
|
||||
zoom: 14,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<ChevronsRightLeft className="text-sm" />
|
||||
</div>
|
||||
|
||||
@@ -442,6 +442,7 @@ const SDSTab = ({
|
||||
<button
|
||||
className="btn btn-sm btn-primary btn-outline"
|
||||
onClick={() => {
|
||||
if (!note.trim()) return;
|
||||
sendSds();
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user