You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2026/05/07 19:51:59 UTC

(airflow) branch main updated: UI: Hide the `Next Run` timestamp for paused Dags. (#66552)

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 fd8a956a706 UI:  Hide the `Next Run` timestamp for paused Dags. (#66552)
fd8a956a706 is described below

commit fd8a956a706d01f82c5d6cb5f5ea5caa1ed0f0f2
Author: hojeong park <pa...@gmail.com>
AuthorDate: Fri May 8 04:51:48 2026 +0900

    UI:  Hide the `Next Run` timestamp for paused Dags. (#66552)
    
    * UI: Hide Next Run for a paused Dag
    
    * UI: Add tests for paused Dag Next Run
    
    * UI: Fix Header test translation key
    
    Co-authored-by: Brent Bovenzi <br...@gmail.com>
    
    ---------
    
    Co-authored-by: Brent Bovenzi <br...@gmail.com>
---
 airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx   | 11 +++++++++++
 airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx        | 13 +++++++------
 .../src/airflow/ui/src/pages/DagsList/DagCard.test.tsx      |  8 ++++++++
 airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.tsx  |  2 +-
 airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx |  2 +-
 5 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx b/airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx
index 10fbf3169ee..d17683892eb 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx
@@ -61,4 +61,15 @@ describe("Header", () => {
     expect(screen.queryByText(i18n.t("dag:dagDetails.nextRun"))).not.toBeInTheDocument();
     expect(screen.queryByRole("button", { name: "Reparse Dag" })).not.toBeInTheDocument();
   });
+
+  it("does not render next run timestamp for a paused Dag", () => {
+    render(
+      <Wrapper>
+        <Header dag={{ ...mockDag, is_paused: true, is_stale: false }} />
+      </Wrapper>,
+    );
+
+    expect(screen.getByText(i18n.t("dag:dagDetails.nextRun"))).toBeInTheDocument();
+    expect(screen.queryByText("2024-08-22 19:00:00")).not.toBeInTheDocument();
+  });
 });
diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx b/airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx
index 651bb2ad79b..7367e7ea0a8 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx
@@ -65,12 +65,13 @@ export const Header = ({
     : [
         {
           label: translate("dagDetails.nextRun"),
-          value: Boolean(dag?.next_dagrun_run_after) ? (
-            <DagRunInfo
-              logicalDate={dag?.next_dagrun_logical_date}
-              runAfter={dag?.next_dagrun_run_after as string}
-            />
-          ) : undefined,
+          value:
+            !dag?.is_paused && Boolean(dag?.next_dagrun_run_after) ? (
+              <DagRunInfo
+                logicalDate={dag?.next_dagrun_logical_date}
+                runAfter={dag?.next_dagrun_run_after as string}
+              />
+            ) : undefined,
         },
       ];
 
diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.test.tsx b/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.test.tsx
index f43e392b035..14532199258 100644
--- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.test.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.test.tsx
@@ -209,6 +209,14 @@ describe("DagCard", () => {
     expect(nextRunElement).toHaveTextContent("2024-08-22 19:00:00");
   });
 
+  it("DagCard should not render next run timestamp for a paused Dag", () => {
+    render(<DagCard dag={{ ...mockDag, is_paused: true }} />, { wrapper: GMTWrapper });
+    const nextRunElement = screen.getByTestId("next-run");
+
+    expect(nextRunElement).toBeInTheDocument();
+    expect(nextRunElement).not.toHaveTextContent("2024-08-22 19:00:00");
+  });
+
   it("DagCard should render StateBadge as success", () => {
     render(<DagCard dag={mockDag} />, { wrapper: GMTWrapper });
     const stateBadge = screen.getByTestId("state-badge");
diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.tsx b/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.tsx
index 57b21d315e6..b8dbe516b8a 100644
--- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagCard.tsx
@@ -100,7 +100,7 @@ export const DagCard = ({ dag }: Props) => {
           ) : undefined}
         </Stat>
         <Stat data-testid="next-run" label={translate("dagDetails.nextRun")}>
-          {Boolean(dag.next_dagrun_run_after) ? (
+          {!dag.is_paused && Boolean(dag.next_dagrun_run_after) ? (
             <DagRunInfo
               logicalDate={dag.next_dagrun_logical_date}
               runAfter={dag.next_dagrun_run_after as string}
diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
index acbe61dd80a..deda3679f65 100644
--- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
@@ -101,7 +101,7 @@ const createColumns = (
   {
     accessorKey: "next_dagrun",
     cell: ({ row: { original } }) =>
-      Boolean(original.next_dagrun_run_after) ? (
+      !original.is_paused && Boolean(original.next_dagrun_run_after) ? (
         <DagRunInfo
           logicalDate={original.next_dagrun_logical_date}
           runAfter={original.next_dagrun_run_after as string}