From 8e4552861740a472e5953a774ac209f9c0de5116 Mon Sep 17 00:00:00 2001 From: Muhammad Luqman <48401306+im-perativa@users.noreply.github.com> Date: Sat, 20 Jan 2024 14:07:26 +0700 Subject: [PATCH] fix(dagrun): copy bug (#36855) (cherry picked from commit 6e7085be6173ebec5e4c52c1223309460c632748) --- airflow/www/static/js/dag/details/dagRun/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/airflow/www/static/js/dag/details/dagRun/index.tsx b/airflow/www/static/js/dag/details/dagRun/index.tsx index ed9dce266ff97..2bbdc5cdb014b 100644 --- a/airflow/www/static/js/dag/details/dagRun/index.tsx +++ b/airflow/www/static/js/dag/details/dagRun/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useRef } from "react"; +import React, { useEffect, useRef } from "react"; import { Flex, Box, @@ -65,7 +65,12 @@ const DagRun = ({ runId }: Props) => { const offsetTop = useOffsetTop(detailsRef); const run = dagRuns.find((dr) => dr.runId === runId); - const { onCopy, hasCopied } = useClipboard(formatConf(run?.conf)); + const { onCopy, setValue, hasCopied } = useClipboard(formatConf(run?.conf)); + + useEffect(() => { + setValue(formatConf(run?.conf)); + }, [run, setValue]); + if (!run) return null; const { state,