feat(analogInputs): automatisches Laden der Chart-Daten bei Tabellenklick via Redux
- analogInputsHistorySlice um `autoLoad` erweitert, um automatisches Laden zu triggern - handleSelect in AnalogInputsTable dispatcht jetzt `setAutoLoad(true)` - AnalogInputsChart lauscht auf `autoLoad` + `selectedId` und lädt Daten automatisch - `autoLoad` wird nach dem Laden wieder auf false zurückgesetzt
This commit is contained in:
@@ -15,6 +15,7 @@ export interface InputHistoryState {
|
||||
isLoading: boolean;
|
||||
error: string | null;
|
||||
data: Record<string, AnalogInputsHistoryEntry[]>;
|
||||
autoLoad: boolean;
|
||||
}
|
||||
|
||||
const initialState: InputHistoryState = {
|
||||
@@ -25,6 +26,7 @@ const initialState: InputHistoryState = {
|
||||
isLoading: false,
|
||||
error: null,
|
||||
data: {},
|
||||
autoLoad: false,
|
||||
};
|
||||
|
||||
export const analogInputsHistorySlice = createSlice({
|
||||
@@ -34,6 +36,9 @@ export const analogInputsHistorySlice = createSlice({
|
||||
setSelectedId: (state, action: PayloadAction<number | null>) => {
|
||||
state.selectedId = action.payload;
|
||||
},
|
||||
setAutoLoad: (state, action: PayloadAction<boolean>) => {
|
||||
state.autoLoad = action.payload; // ✅ AutoLoad steuern
|
||||
},
|
||||
setZeitraum: (state, action: PayloadAction<string>) => {
|
||||
state.zeitraum = action.payload;
|
||||
},
|
||||
@@ -64,6 +69,7 @@ export const analogInputsHistorySlice = createSlice({
|
||||
|
||||
export const {
|
||||
setSelectedId,
|
||||
setAutoLoad,
|
||||
setZeitraum,
|
||||
setVonDatum,
|
||||
setBisDatum,
|
||||
|
||||
Reference in New Issue
Block a user