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 d7b88f36197 UI: Fix external plugin nav links not navigating on click 
(#73913)
d7b88f36197 is described below

commit d7b88f36197c16144c181e7217c3c0277c92b205
Author: vaishsriram <[email protected]>
AuthorDate: Fri Oct 2 15:23:11 2026 -0400

    UI: Fix external plugin nav links not navigating on click (#73913)
    
    * UI: Fix external plugin nav links not navigating on click
    
    * Add newsfragment
    
    * Remove newsfragment
    
    * Updating formatting and fixing title name
---
 .../src/airflow/ui/src/layouts/Nav/NavButton.test.tsx      | 14 ++++++++++++++
 airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.tsx  |  8 ++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.test.tsx 
b/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.test.tsx
index 1b7c6f58645..73c19872155 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.test.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.test.tsx
@@ -95,6 +95,20 @@ describe("NavButton", () => {
     });
   });
 
+  describe("isExternal", () => {
+    it("renders as an anchor link with target=_blank", () => {
+      render(<NavButton icon={FiHome} isExternal title="Icon Name" 
to="https://example.com"; />, {
+        wrapper: wrapperAt("/"),
+      });
+
+      const link = screen.getByRole("link", { name: "Icon Name" });
+
+      expect(link).toHaveAttribute("href", "https://example.com";);
+      expect(link).toHaveAttribute("target", "_blank");
+      expect(link).toHaveAttribute("rel", "noopener noreferrer");
+    });
+  });
+
   describe("matchPaths", () => {
     it("is active on an extra match path even though `to` points elsewhere", 
() => {
       render(<NavButton icon={FiHome} matchPaths={["dag_runs", 
"task_instances"]} title="Dags" to="dags" />, {
diff --git a/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.tsx 
b/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.tsx
index 48cfadb9256..8b04f107330 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Nav/NavButton.tsx
@@ -115,12 +115,12 @@ export const NavButton = ({
 
   if (isExternal) {
     return (
-      <Link asChild href={to} rel="noopener noreferrer" target="_blank">
-        <Button {...commonButtonProps}>
+      <Button {...commonButtonProps} asChild>
+        <a href={to} rel="noopener noreferrer" target="_blank">
           {pluginIcon ?? <Icon as={icon} boxSize={5} />}
           <Box {...commonLabelProps}>{title}</Box>
-        </Button>
-      </Link>
+        </a>
+      </Button>
     );
   }
 

Reply via email to