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

justinpark pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/5.0 by this push:
     new 752f7aa80c chore(saved_query): Copy link to clipboard before redirect 
to edit (#34567)
752f7aa80c is described below

commit 752f7aa80c9eb0c3e7ce708f2ab08bceef5793a9
Author: JUST.in DO IT <justin.p...@airbnb.com>
AuthorDate: Thu Aug 7 11:10:05 2025 -0700

    chore(saved_query): Copy link to clipboard before redirect to edit (#34567)
---
 superset-frontend/src/pages/SavedQueryList/index.tsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/superset-frontend/src/pages/SavedQueryList/index.tsx 
b/superset-frontend/src/pages/SavedQueryList/index.tsx
index 9a5fd63e4c..75bf9b384f 100644
--- a/superset-frontend/src/pages/SavedQueryList/index.tsx
+++ b/superset-frontend/src/pages/SavedQueryList/index.tsx
@@ -53,6 +53,7 @@ import { commonMenuData } from 
'src/features/home/commonMenuData';
 import { QueryObjectColumns, SavedQueryObject } from 'src/views/CRUD/types';
 import Tag from 'src/types/TagType';
 import ImportModelsModal from 'src/components/ImportModal/index';
+import copyTextToClipboard from 'src/utils/copy';
 import { ModifiedInfo } from 'src/components/AuditInfo';
 import { loadTags } from 'src/components/Tags/utils';
 import Icons from 'src/components/Icons';
@@ -224,6 +225,15 @@ function SavedQueryList({
 
   // Action methods
   const openInSqlLab = (id: number, openInNewWindow: boolean) => {
+    copyTextToClipboard(() =>
+      Promise.resolve(`${window.location.origin}/sqllab?savedQueryId=${id}`),
+    )
+      .then(() => {
+        addSuccessToast(t('Link Copied!'));
+      })
+      .catch(() => {
+        addDangerToast(t('Sorry, your browser does not support copying.'));
+      });
     if (openInNewWindow) {
       window.open(`/sqllab?savedQueryId=${id}`);
     } else {

Reply via email to