This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 8e4552861740a472e5953a774ac209f9c0de5116
Author: Muhammad Luqman <[email protected]>
AuthorDate: Sat Jan 20 14:07:26 2024 +0700

    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 ed9dce266f..2bbdc5cdb0 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,

Reply via email to