From 93ae79ac7e5d518ebbc5d6d26632039f1810d86e Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 11 Jul 2025 09:33:06 +0200 Subject: [PATCH] feat: Zeitspanne-Funktion mit Von/Bis und Button-Trigger im DetailModal eingebaut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Chart-Daten werden jetzt erst bei Klick auf „Daten laden“ geladen - Von/Bis-Zeitauswahl über Redux-State korrekt eingebunden - Styling der Eingabefelder und Dropdowns vereinheitlicht (eine Zeile) - Lokalen State für Zeitspanne entfernt und durch Redux ersetzt --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 +++ .../DateRangePicker.tsx | 2 +- .../LoopChartActionBar.tsx | 2 +- components/main/system/DetailModal.tsx | 35 ++++++++++++++++--- package-lock.json | 4 +-- package.json | 2 +- 8 files changed, 43 insertions(+), 11 deletions(-) rename components/{main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart => common}/DateRangePicker.tsx (96%) diff --git a/.env.development b/.env.development index 21fc9e9..ba89a8f 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.587 +NEXT_PUBLIC_APP_VERSION=1.6.588 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 0d04beb..7e3ee9c 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.587 +NEXT_PUBLIC_APP_VERSION=1.6.588 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 848d453..ee6d905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.588] – 2025-07-11 + +- fix: Messwertlinie (m) im DIA0-Modus in DetailModal sichtbar gemacht + +--- ## [1.6.587] – 2025-07-11 - fix: Anzeige der Messwertlinie (m) im DIA0-Modus in DetailModal korrigiert diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/DateRangePicker.tsx b/components/common/DateRangePicker.tsx similarity index 96% rename from components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/DateRangePicker.tsx rename to components/common/DateRangePicker.tsx index 2a378f9..b233561 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/DateRangePicker.tsx +++ b/components/common/DateRangePicker.tsx @@ -1,4 +1,4 @@ -// /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/DateRangePicker.tsx +// /components/common/DateRangePicker.tsx import React, { useEffect } from "react"; import DatePicker from "react-datepicker"; import { useSelector, useDispatch } from "react-redux"; diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index 40e24ad..3b169ee 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -1,7 +1,7 @@ "use client"; // /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx import React from "react"; -import DateRangePicker from "./DateRangePicker"; +import DateRangePicker from "@/components/common/DateRangePicker"; import { useDispatch, useSelector } from "react-redux"; import { RootState } from "@/redux/store"; import { diff --git a/components/main/system/DetailModal.tsx b/components/main/system/DetailModal.tsx index 4ac5d19..d0b3205 100644 --- a/components/main/system/DetailModal.tsx +++ b/components/main/system/DetailModal.tsx @@ -6,6 +6,7 @@ import { useSelector, useDispatch } from "react-redux"; import { RootState } from "@/redux/store"; import { Listbox } from "@headlessui/react"; import { setFullScreen } from "@/redux/slices/kabelueberwachungChartSlice"; +import DateRangePicker from "@/components/common/DateRangePicker"; import { Chart as ChartJS, @@ -121,6 +122,14 @@ export const DetailModal = ({ const [chartData, setChartData] = useState({ datasets: [], }); + const vonDatum = useSelector( + (state: RootState) => state.kabelueberwachungChartSlice.vonDatum + ); + const bisDatum = useSelector( + (state: RootState) => state.kabelueberwachungChartSlice.bisDatum + ); + + const [filteredData, setFilteredData] = useState([]); const reduxData = useSelector((state: RootState) => { switch (selectedKey) { @@ -170,8 +179,19 @@ export const DetailModal = ({ loadZoomPlugin(); }, []); - useEffect(() => { - const sortedData = [...reduxData].reverse(); + const handleFetchData = () => { + let sortedData = [...reduxData].reverse(); + + if (vonDatum && bisDatum) { + const vonDate = new Date(vonDatum); + const bisDate = new Date(bisDatum); + sortedData = sortedData.filter((entry) => { + const entryDate = new Date(entry.t); + return entryDate >= vonDate && entryDate <= bisDate; + }); + } + + setFilteredData(sortedData); setChartData({ datasets: [ @@ -207,7 +227,7 @@ export const DetailModal = ({ }, ], }); - }, [reduxData]); + }; useEffect(() => { if (chartRef.current && selectedKey) { @@ -259,7 +279,8 @@ export const DetailModal = ({ -
+
+
@@ -312,6 +333,12 @@ export const DetailModal = ({
+
diff --git a/package-lock.json b/package-lock.json index c66983b..516dc90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.587", + "version": "1.6.588", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.587", + "version": "1.6.588", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index 3416a62..45e3eee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.587", + "version": "1.6.588", "private": true, "scripts": { "dev": "next dev",