fix(sqllab): Allow opening of SQL Lab in new browser tab #25582
Merged
justinpark merged 4 commits intoOct 13, 2023
Merged
Conversation
justinpark
commented
Oct 9, 2023
| <Menu.Item key={CHANGE_DATASET}>{t('Swap dataset')}</Menu.Item> | ||
| {!isMissingDatasource && canAccessSqlLab && ( | ||
| <Menu.Item> | ||
| <Menu.Item key={VIEW_IN_SQL_LAB}> |
Member
Author
There was a problem hiding this comment.
justinpark
commented
Oct 9, 2023
| }, | ||
| }); | ||
| } else { | ||
| SupersetClient.postForm(redirectUrl, { |
Member
Author
There was a problem hiding this comment.
justinpark
commented
Oct 9, 2023
Comment on lines
+44
to
+47
| if form_data := request.form.get("form_data"): | ||
| with contextlib.suppress(json.JSONDecodeError): | ||
| payload["requested_query"] = json.loads(form_data) | ||
| return self.render_app_template(payload) |
Member
Author
There was a problem hiding this comment.
cccs-rc
pushed a commit
to CybercentreCanada/superset
that referenced
this pull request
Mar 6, 2024
vinothkumar66
pushed a commit
to vinothkumar66/superset
that referenced
this pull request
Nov 11, 2024
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Fixes the addressed issue (no. 6) on #25151 (comment)
Since the #25151 replaces the SupersetClient.postForm by the router navigation, it loses the way to open the sql link in the new browser tab.
This commit recovers the way of opening sql in the new browser tab forcefully (when opening the link with the command/window key pressed).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
before--cmd-open.mov
After:
after--cmd-open.mov
TESTING INSTRUCTIONS
Go to Explore and open the control menu
Click the Open in SQL Lab link with the cmd key (cmd + click/win + click)
The editor with the populated sql will be opened in the new browser tab
ADDITIONAL INFORMATION