-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Ability to share saved queries #24301
Changes from all commits
1eba12a
34e8b1f
65b259f
9c10e13
6c4fcc4
36052ed
eff8f24
11226f8
6e323eb
db575bd
2984e76
e4731dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ export interface QueryEditor { | |
selectedText?: string; | ||
queryLimit?: number; | ||
description?: string; | ||
uuid: string | null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we use an optional string like the ones above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that |
||
} | ||
|
||
export type toastState = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,10 +216,10 @@ function SavedQueryList({ | |
}; | ||
|
||
const copyQueryLink = useCallback( | ||
(id: number) => { | ||
(uuid: string) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does TypeScript support a UUID type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not that I'm aware of, didn't find anything on a quick google search either |
||
copyTextToClipboard(() => | ||
Promise.resolve( | ||
`${window.location.origin}/superset/sqllab?savedQueryId=${id}`, | ||
`${window.location.origin}/superset/sqllab?savedQueryId=${uuid}`, | ||
), | ||
) | ||
.then(() => { | ||
|
@@ -390,7 +390,7 @@ function SavedQueryList({ | |
handleSavedQueryPreview(original.id); | ||
}; | ||
const handleEdit = () => openInSqlLab(original.id); | ||
const handleCopy = () => copyQueryLink(original.id); | ||
const handleCopy = () => copyQueryLink(original.uuid); | ||
const handleExport = () => handleBulkSavedQueryExport([original]); | ||
const handleDelete = () => setQueryCurrentlyDeleting(original); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a concern that by switching to UUID existing URLs will break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing URLs will still work just fine as the get saved query endpoint still accepts numerical id's