Fix: Messkurven-Modal (ISO/RSL) lädt Kurve automatisch, setzt Dropdown & DateRangePicker korrekt zurück
- Dropdown für Messkurven (ISO/RSL) wird beim Öffnen auf 'Alle Messwerte' (DIA0) gesetzt - Messkurve wird beim Öffnen des Modals automatisch geladen - Beim Schließen werden vonDatum, bisDatum, Dropdown und DateRangePicker zurückgesetzt - Gleiches Verhalten für ISO- und RSL/Loop-Modal
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
"use client";
|
||||
// /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, {
|
||||
useEffect,
|
||||
useState,
|
||||
forwardRef,
|
||||
useImperativeHandle,
|
||||
} from "react";
|
||||
import { useAppDispatch } from "@/redux/store";
|
||||
import { getMessagesThunk } from "@/redux/thunks/getMessagesThunk";
|
||||
import { RSL_DURATION_SECONDS, NODE_ENV } from "@/utils/env";
|
||||
@@ -94,7 +99,7 @@ export const useLoopChartLoader = () => {
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------------LoopChartActionBar
|
||||
const LoopChartActionBar: React.FC = () => {
|
||||
const LoopChartActionBar = forwardRef((_props, ref) => {
|
||||
const dispatch = useAppDispatch();
|
||||
// RSL Progress State – Dauer konfigurierbar über NEXT_PUBLIC_RSL_DURATION_SECONDS
|
||||
const TOTAL_DURATION = RSL_DURATION_SECONDS;
|
||||
@@ -272,6 +277,10 @@ const LoopChartActionBar: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
handleFetchData,
|
||||
}));
|
||||
|
||||
return (
|
||||
<div className="flex justify-between p-1 bg-gray-100 rounded-lg ">
|
||||
<div className="flex items-center">
|
||||
@@ -393,6 +402,7 @@ const LoopChartActionBar: React.FC = () => {
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
LoopChartActionBar.displayName = "LoopChartActionBar";
|
||||
export default LoopChartActionBar;
|
||||
|
||||
Reference in New Issue
Block a user