From 76f4b92fb518c521d542caadb5138ff97a82ee10 Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 2 Apr 2025 07:38:48 +0200 Subject: [PATCH] feat: Charttitel in ChartSwitcher dynamisch an Slot-Typ angepasst via loopChartTypeSlice - Neues Redux Slice erstellt zur Verwaltung des Titels - Dropdown-Auswahl in LoopChartActionBar aktualisiert Redux-Wert - ChartSwitcher verwendet dynamischen Titel statt statischem Text --- .../kue705FO/Charts/ChartSwitcher.tsx | 5 +++- .../LoopChartActionBar.tsx | 17 ++++++++++---- config/webVersion.ts | 2 +- redux/slices/loopChartTypeSlice.ts | 23 +++++++++++++++++++ redux/store.ts | 2 ++ 5 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 redux/slices/loopChartTypeSlice.ts diff --git a/components/main/kabelueberwachung/kue705FO/Charts/ChartSwitcher.tsx b/components/main/kabelueberwachung/kue705FO/Charts/ChartSwitcher.tsx index 4d829fc..1851352 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/ChartSwitcher.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/ChartSwitcher.tsx @@ -32,6 +32,9 @@ const ChartSwitcher: React.FC = ({ slotIndex, }) => { const dispatch = useDispatch(); + const chartTitle = useSelector( + (state: RootState) => state.loopChartType.chartTitle + ); // **Redux-States für aktive Messkurve (TDR oder Schleife)** const activeMode = useSelector( @@ -146,7 +149,7 @@ const ChartSwitcher: React.FC = ({ > {activeMode === "Schleife" ? ( <> -

Schleifenmessung

+

{chartTitle}

diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index c3fae95..89a643a 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -12,6 +12,7 @@ import { setChartOpen, } from "../../../../../../redux/slices/kabelueberwachungChartSlice"; import { setBrushRange } from "../../../../../../redux/slices/brushSlice"; +import { setChartTitle } from "../../../../../../redux/slices/loopChartTypeSlice"; const LoopChartActionBar: React.FC = () => { const dispatch = useDispatch(); @@ -154,13 +155,19 @@ const LoopChartActionBar: React.FC = () => {