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 {
|
import {
|
||||||
setVonDatum,
|
setVonDatum,
|
||||||
setBisDatum,
|
setBisDatum,
|
||||||
|
setSelectedMode,
|
||||||
|
setSelectedSlotType,
|
||||||
} from "../../../../../redux/slices/kabelueberwachungChartSlice";
|
} from "../../../../../redux/slices/kabelueberwachungChartSlice";
|
||||||
|
|
||||||
interface ChartSwitcherProps {
|
interface ChartSwitcherProps {
|
||||||
@@ -52,18 +54,25 @@ const ChartSwitcher: React.FC<ChartSwitcherProps> = ({
|
|||||||
|
|
||||||
// **Modal schließen + Redux-Status zurücksetzen**
|
// **Modal schließen + Redux-Status zurücksetzen**
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
// Zeitbereich zurücksetzen
|
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const thirtyDaysAgo = new Date();
|
const thirtyDaysAgo = new Date();
|
||||||
thirtyDaysAgo.setDate(today.getDate() - 30);
|
thirtyDaysAgo.setDate(today.getDate() - 30);
|
||||||
|
|
||||||
const toISO = (date: Date) => date.toLocaleDateString("sv-SE");
|
const toISO = (date: Date) => date.toLocaleDateString("sv-SE");
|
||||||
|
|
||||||
|
// Reset Datum
|
||||||
dispatch(setVonDatum(toISO(thirtyDaysAgo)));
|
dispatch(setVonDatum(toISO(thirtyDaysAgo)));
|
||||||
dispatch(setBisDatum(toISO(today)));
|
dispatch(setBisDatum(toISO(today)));
|
||||||
|
|
||||||
|
// Reset Dropdowns
|
||||||
|
dispatch(setSelectedMode("DIA0"));
|
||||||
|
dispatch(setSelectedSlotType("isolationswiderstand"));
|
||||||
|
|
||||||
|
// Sonstiges Reset
|
||||||
dispatch(setChartOpen(false));
|
dispatch(setChartOpen(false));
|
||||||
dispatch(setFullScreen(false));
|
dispatch(setFullScreen(false));
|
||||||
dispatch(resetBrushRange());
|
dispatch(resetBrushRange());
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.218";
|
const webVersion = "1.6.219";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
Reference in New Issue
Block a user