Release v2.0.4 #140

Merged
PxlLoewe merged 30 commits from staging into release 2025-12-08 18:48:53 +00:00
4 changed files with 27 additions and 5 deletions
Showing only changes of commit 4d43e2a36d - Show all commits

View File

@@ -88,7 +88,16 @@ router.patch("/:id", async (req, res) => {
});
io.to("dispatchers").emit("update-mission", { updatedMission });
if (req.body.state === "finished") {
updatedMission.missionStationUserIds?.forEach((userId) => {
const missionUsers = await prisma.missionOnStationUsers.findMany({
where: {
missionId: updatedMission.id,
},
select: {
userId: true,
},
});
console.log("Notifying users about mission closure:", missionUsers);
missionUsers?.forEach(({ userId }) => {
io.to(`user:${userId}`).emit("notification", {
type: "mission-closed",
status: "closed",

View File

@@ -164,6 +164,7 @@ export const MissionForm = () => {
const newFormValues = JSON.stringify(values);
if (currentStoreValues !== newFormValues) {
console.debug("Updating store missionFormValues", values);
setMissionFormValues(values as MissionOptionalDefaults);
}
});

View File

@@ -22,7 +22,7 @@ export function QueryProvider({ children }: { children: ReactNode }) {
defaultOptions: {
mutations: {
onError: (error) => {
toast.error("An error occurred: " + (error as Error).message, {
toast.error("Ein Fehler ist aufgetreten: " + (error as Error).message, {
position: "top-right",
});
},
@@ -88,6 +88,9 @@ export function QueryProvider({ children }: { children: ReactNode }) {
},
);
break;
case "mission-closed":
toast("Dein aktueller Einsatz wurde geschlossen.");
break;
default:
toast("unbekanntes Notification-Event");
break;

View File

@@ -58,8 +58,6 @@ export const MapAdditionals = () => {
openMissionMarker.find((openMission) => openMission.id === m.id),
);
console.log("markersNeedingAttention", showDetailedAdditionals);
return (
<>
{missionFormValues?.addressLat && missionFormValues?.addressLng && isOpen && (
@@ -70,7 +68,18 @@ export const MapAdditionals = () => {
iconSize: [40, 40],
iconAnchor: [20, 35],
})}
interactive={false}
draggable={true}
eventHandlers={{
dragend: (e) => {
const marker = e.target;
const position = marker.getLatLng();
setMissionFormValues({
...missionFormValues,
addressLat: position.lat,
addressLng: position.lng,
});
},
}}
/>
)}
{showDetailedAdditionals &&