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 cc16f48171 fix(triggered-dag-runs): refactor how triggered dag run url 
is replaced (#41259)
cc16f48171 is described below

commit cc16f481717c34f7dabcfc84de87c66505483f8d
Author: Wei Lee <[email protected]>
AuthorDate: Mon Aug 5 21:50:01 2024 +0800

    fix(triggered-dag-runs): refactor how triggered dag run url is replaced 
(#41259)
---
 airflow/www/static/js/components/TriggeredDagRuns.tsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/airflow/www/static/js/components/TriggeredDagRuns.tsx 
b/airflow/www/static/js/components/TriggeredDagRuns.tsx
index 26cf1abac6..98d95e4256 100644
--- a/airflow/www/static/js/components/TriggeredDagRuns.tsx
+++ b/airflow/www/static/js/components/TriggeredDagRuns.tsx
@@ -35,6 +35,7 @@ type CardProps = {
 };
 
 const gridUrl = getMetaValue("grid_url");
+const dagId = getMetaValue("dag_id");
 
 const TriggeredDagRuns = ({ createdDagRuns, showLink = true }: CardProps) => {
   const containerRef = useContainerRef();
@@ -43,11 +44,10 @@ const TriggeredDagRuns = ({ createdDagRuns, showLink = true 
}: CardProps) => {
     <Flex alignItems="center">
       {createdDagRuns.map((run) => {
         const runId = (run as any).dagRunId; // For some reason the type is 
wrong here
-        const splitGridUrl = gridUrl.split("/");
-        splitGridUrl[2] = run.dagId || "";
-        const url = `${splitGridUrl.join("/")}?dag_run_id=${encodeURIComponent(
-          runId
-        )}`;
+        const url = `${gridUrl.replace(
+          dagId,
+          run.dagId || ""
+        )}?dag_run_id=${encodeURIComponent(runId)}`;
 
         return (
           <Tooltip

Reply via email to