From 28612f9cd030ed970fd0a18174d8bc95e44d71d0 Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 10 Sep 2025 08:13:37 +0200 Subject: [PATCH] feat: TDR Meldungen DateRangePicker --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 + .../kue705FO/Charts/TDRChart/TDRChart.tsx | 4 +- .../Charts/TDRChart/TDRChartActionBar.tsx | 259 +++++++++--------- .../kue705FO/Charts/TDRChart/TDRChartView.tsx | 3 + package-lock.json | 4 +- package.json | 2 +- 8 files changed, 146 insertions(+), 135 deletions(-) diff --git a/.env.development b/.env.development index e3843aa..422c5ec 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.886 +NEXT_PUBLIC_APP_VERSION=1.6.887 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 6d25b84..05c87db 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.886 +NEXT_PUBLIC_APP_VERSION=1.6.887 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e5edd..6ae6bac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.887] – 2025-09-10 + +- style: actionbar in RSL und ISO + +--- ## [1.6.886] – 2025-09-10 - WIP: von bis Zeitraum in ISO und TDR, aber TDR ist WIP diff --git a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChart.tsx b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChart.tsx index 9bcab41..5c5ae37 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChart.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChart.tsx @@ -7,7 +7,6 @@ import { AppDispatch } from "../../../../../../redux/store"; import { Chart, registerables } from "chart.js"; import "chartjs-adapter-date-fns"; import { getColor } from "../../../../../../utils/colors"; -import TDRChartActionBar from "./TDRChartActionBar"; import { getReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/getReferenceCurveBySlotThunk"; const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => { @@ -212,8 +211,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => { //-------------------------------------- return ( -
- +
{tdrChartData.length === 0 ? (
diff --git a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx index 5def401..9f5b0bb 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx @@ -153,7 +153,8 @@ const TDRChartActionBar: React.FC = () => { return ( <> -
+
+ {/* KÜ number left, controls right, like IsoChartActionBar */}
KÜ @@ -162,141 +163,145 @@ const TDRChartActionBar: React.FC = () => { {selectedSlot !== null ? selectedSlot + 1 : "-"}
- {/* Date range only in Meldungen (requirement) */} - {isMeldungen && } - {isMeldungen ? ( - - ) : ( - <> - {selectedId !== null && ( +
+ {isMeldungen ? ( + <> + - )} - -
- { - setSelectedId(id); - if (id !== null) dispatch(getTDRChartDataByIdThunk(id)); - }} - disabled={idsForSlot.length === 0} + + ) : ( + <> + {selectedId !== null && ( + + )} + +
+ { + setSelectedId(id); + if (id !== null) dispatch(getTDRChartDataByIdThunk(id)); + }} + disabled={idsForSlot.length === 0} + > +
+ + + {selectedId + ? (() => { + const selected = idsForSlot.find( + (e) => e.id === selectedId + ); + return selected + ? `${new Date(selected.t).toLocaleString( + "de-DE", + { + day: "2-digit", + month: "2-digit", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + } + )} – Fehlerstelle: ${selected.d} m` + : "Wähle Messung"; + })() + : "Wähle Messung"} + + + + + {idsForSlot.map((entry) => { + const dateLabel = new Date(entry.t).toLocaleString( + "de-DE", + { + day: "2-digit", + month: "2-digit", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + } + ); + const fullText = `${dateLabel} – Fehlerstelle: ${entry.d} m`; + return ( + { + const base = + "px-3 h-8 cursor-pointer rounded-sm m-0.5 flex items-center justify-start transition-colors text-[13px]"; + if (selected) + return `${base} dropdown-option-active font-medium`; + if (active) return `${base} dropdown-option-hover`; + return `${base}`; + }} + > + {fullText} + + ); + })} + +
+
+
+ + )} +
+ {/* Progress Overlay */} + {tdrRunning && ( +
+
+

+ TDR Messung läuft... kann bis zu zwei Minuten dauern +

+

+ Bitte warten…{" "} + {Math.min( + 100, + Math.round((tdrProgress / TDR_TOTAL_DURATION) * 100) + )} + % +

- +
+
+
+
)}
- {tdrRunning && ( -
-
-

- TDR Messung läuft... kann bis zu zwei Minuten dauern -

-

- Bitte warten…{" "} - {Math.min( - 100, - Math.round((tdrProgress / TDR_TOTAL_DURATION) * 100) - )} - % -

-
-
-
-
-
- )} ); }; diff --git a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartView.tsx b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartView.tsx index 4012ed8..8c7dcb9 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartView.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartView.tsx @@ -3,6 +3,7 @@ import React, { useEffect } from "react"; import ReactModal from "react-modal"; import TDRChart from "./TDRChart"; +import TDRChartActionBar from "./TDRChartActionBar"; import { useSelector, useDispatch } from "react-redux"; import { AppDispatch, RootState } from "@/redux/store"; import { @@ -166,6 +167,8 @@ const TDRChartView: React.FC = ({
+ {/* Action Bar (wie bei ISO / Loop) */} +
{chartTitle === "Messkurve" ? ( diff --git a/package-lock.json b/package-lock.json index 69c35ff..bbf9f45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.886", + "version": "1.6.887", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.886", + "version": "1.6.887", "dependencies": { "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", diff --git a/package.json b/package.json index e3938a6..25fb42d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.886", + "version": "1.6.887", "private": true, "scripts": { "dev": "next dev -p 3000",