This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 20e2b6c7a53 Add autorefresh to Required Actions button (#55543)
20e2b6c7a53 is described below
commit 20e2b6c7a53e7bad9371e6b74b6c2fe5cda2a80c
Author: Brent Bovenzi <[email protected]>
AuthorDate: Thu Sep 11 16:22:45 2025 -0600
Add autorefresh to Required Actions button (#55543)
* Add autorefresh to Required Actions button
* Add deferred filter for pending reviews
---
.../airflow/ui/src/components/NeedsReviewButton.tsx | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
index 646bca0bca6..6262231b909 100644
--- a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
+++ b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
@@ -21,6 +21,7 @@ import { useTranslation } from "react-i18next";
import { LuUserRoundPen } from "react-icons/lu";
import { useHumanInTheLoopServiceGetHitlDetails } from "openapi/queries";
+import { useAutoRefresh } from "src/utils/query";
import { StatsCard } from "./StatsCard";
@@ -33,12 +34,20 @@ export const NeedsReviewButton = ({
readonly runId?: string;
readonly taskId?: string;
}) => {
- const { data: hitlStatsData, isLoading } =
useHumanInTheLoopServiceGetHitlDetails({
- dagId,
- dagRunId: runId,
- responseReceived: false,
- taskId,
- });
+ const refetchInterval = useAutoRefresh({ dagId });
+ const { data: hitlStatsData, isLoading } =
useHumanInTheLoopServiceGetHitlDetails(
+ {
+ dagId,
+ dagRunId: runId,
+ responseReceived: false,
+ state: ["deferred"],
+ taskId,
+ },
+ undefined,
+ {
+ refetchInterval,
+ },
+ );
const hitlTIsCount = hitlStatsData?.hitl_details.length ?? 0;
const { t: translate } = useTranslation("hitl");