fix: ChartSwitcher bei Schließen vollständig zurückgesetzt
- Datum auf letzten 30 Tage zurückgesetzt - Dropdowns auf "Alle Messwerte" und "Isolationswiderstand" zurückgesetzt - Chart-Titel ebenfalls zurückgesetzt
This commit is contained in:
@@ -24,6 +24,8 @@ import { useLoopChartLoader } from "./LoopMeasurementChart/LoopChartActionBar";
|
||||
import {
|
||||
setVonDatum,
|
||||
setBisDatum,
|
||||
setSelectedMode,
|
||||
setSelectedSlotType,
|
||||
} from "../../../../../redux/slices/kabelueberwachungChartSlice";
|
||||
|
||||
interface ChartSwitcherProps {
|
||||
@@ -52,18 +54,25 @@ const ChartSwitcher: React.FC<ChartSwitcherProps> = ({
|
||||
|
||||
// **Modal schließen + Redux-Status zurücksetzen**
|
||||
const handleClose = () => {
|
||||
// Zeitbereich zurücksetzen
|
||||
const today = new Date();
|
||||
const thirtyDaysAgo = new Date();
|
||||
thirtyDaysAgo.setDate(today.getDate() - 30);
|
||||
|
||||
const toISO = (date: Date) => date.toLocaleDateString("sv-SE");
|
||||
|
||||
// Reset Datum
|
||||
dispatch(setVonDatum(toISO(thirtyDaysAgo)));
|
||||
dispatch(setBisDatum(toISO(today)));
|
||||
|
||||
// Reset Dropdowns
|
||||
dispatch(setSelectedMode("DIA0"));
|
||||
dispatch(setSelectedSlotType("isolationswiderstand"));
|
||||
|
||||
// Sonstiges Reset
|
||||
dispatch(setChartOpen(false));
|
||||
dispatch(setFullScreen(false));
|
||||
dispatch(resetBrushRange());
|
||||
|
||||
onClose();
|
||||
};
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||
|
||||
*/
|
||||
const webVersion = "1.6.218";
|
||||
const webVersion = "1.6.219";
|
||||
export default webVersion;
|
||||
|
||||
Reference in New Issue
Block a user