From ab8baf71ca742c2dc90263f907bc08bb10e6beb9 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Wed, 28 Jan 2026 08:57:17 +0530 Subject: [PATCH 1/7] Add copy-to-clipboard button for file execution ID in LogModal Adds a copy icon button next to the file execution ID in the Execution Log Details modal, allowing users to quickly copy the ID to clipboard similar to the main execution ID functionality. Co-Authored-By: Claude Opus 4.5 --- .../components/logging/log-modal/LogModal.css | 25 +++++++++-- .../components/logging/log-modal/LogModal.jsx | 45 ++++++++++++++++++- 2 files changed, 65 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/logging/log-modal/LogModal.css b/frontend/src/components/logging/log-modal/LogModal.css index b2ed5754b8..f363408be3 100644 --- a/frontend/src/components/logging/log-modal/LogModal.css +++ b/frontend/src/components/logging/log-modal/LogModal.css @@ -1,4 +1,23 @@ -.clear-button{ - margin-left: 50px; - margin-top: 10px; +.clear-button { + margin-left: 50px; + margin-top: 10px; +} + +.log-modal-title { + display: inline-flex; + align-items: center; +} + +.log-modal-title .copy-btn-outlined { + border: 1px solid #d9d9d9; + background: #fff; + color: rgba(0, 0, 0, 0.65); + margin-left: 8px; + height: auto; + min-width: auto; +} + +.log-modal-title .copy-btn-outlined:hover { + border-color: #1677ff; + color: #1677ff; } diff --git a/frontend/src/components/logging/log-modal/LogModal.jsx b/frontend/src/components/logging/log-modal/LogModal.jsx index 61e5aed121..47a6345622 100644 --- a/frontend/src/components/logging/log-modal/LogModal.jsx +++ b/frontend/src/components/logging/log-modal/LogModal.jsx @@ -1,6 +1,7 @@ -import { Modal, Table, Tooltip } from "antd"; +import { Button, Modal, Table, Tooltip } from "antd"; import { useEffect, useState } from "react"; import PropTypes from "prop-types"; +import { CopyOutlined } from "@ant-design/icons"; import "./LogModal.css"; import { useExceptionHandler } from "../../../hooks/useExceptionHandler"; @@ -29,6 +30,32 @@ function LogModal({ const [loading, setLoading] = useState(false); const [selectedLogLevel, setSelectedLogLevel] = useState(null); const [ordering, setOrdering] = useState(null); + const displayId = fileId || executionId; + + const handleCopyToClipboard = (text, label = "Text") => { + if (!navigator.clipboard) { + setAlertDetails({ + type: "error", + content: "Clipboard not available in this browser", + }); + return; + } + navigator.clipboard.writeText(text).then( + () => { + setAlertDetails({ + type: "success", + content: `${label} copied to clipboard`, + }); + }, + (err) => { + setAlertDetails({ + type: "error", + content: `Failed to copy: ${err.message || "Unknown error"}`, + }); + }, + ); + }; + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, @@ -150,7 +177,21 @@ function LogModal({ }, [logDescModalOpen, pagination.current, selectedLogLevel, ordering]); return ( + Execution Log Details - {displayId} +