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
This commit is contained in:
ISA
2025-04-02 07:38:48 +02:00
parent 60eba4aa01
commit 76f4b92fb5
5 changed files with 42 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
// redux/slices/loopChartTypeSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
interface LoopChartTypeState {
chartTitle: string;
}
const initialState: LoopChartTypeState = {
chartTitle: "Schleifenmessung", // Standardwert
};
const loopChartTypeSlice = createSlice({
name: "loopChartType",
initialState,
reducers: {
setChartTitle: (state, action: PayloadAction<string>) => {
state.chartTitle = action.payload;
},
},
});
export const { setChartTitle } = loopChartTypeSlice.actions;
export default loopChartTypeSlice.reducer;

View File

@@ -21,6 +21,7 @@ import kueDataReducer from "./slices/kueDataSlice";
import selectedChartDataReducer from "./slices/selectedChartDataSlice";
import tdmSingleChartReducer from "./slices/tdmSingleChartSlice";
import tdrReferenceChartDataBySlotReducer from "./slices/tdrReferenceChartDataBySlotSlice";
import loopChartTypeSlice from "./slices/loopChartTypeSlice";
const store = configureStore({
reducer: {
@@ -44,6 +45,7 @@ const store = configureStore({
selectedChartDataSlice: selectedChartDataReducer,
tdmSingleChartSlice: tdmSingleChartReducer,
tdrReferenceChartDataBySlotSlice: tdrReferenceChartDataBySlotReducer,
loopChartType: loopChartTypeSlice,
},
});