-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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: sql lab ctrl t behaved differently from clicking #19420
fix: sql lab ctrl t behaved differently from clicking #19420
Conversation
To have consistent behaviour when creating a new tab with ctrl+t
return initialTitle; | ||
} | ||
|
||
return initialTitle; |
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.
I know this was already present in the original code, but I think it's a bug.
If we reach this line, it means it's the first editor. In this case, the title is not translated.
Can you ensure "Untitled Query 1" is translated here as well?
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.
Nice catch!
const untitledQueryRegex = /^Untitled Query (\d+)$/; // Literal notation isn't recompiled | ||
const untitledQuery = 'Untitled Query '; | ||
|
||
export const newQueryTabName = ( |
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.
add a couple of tests for this file please
Codecov Report
@@ Coverage Diff @@
## master #19420 +/- ##
==========================================
+ Coverage 66.43% 66.49% +0.06%
==========================================
Files 1670 1682 +12
Lines 63958 64378 +420
Branches 6506 6586 +80
==========================================
+ Hits 42490 42809 +319
- Misses 19782 19888 +106
+ Partials 1686 1681 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
LGTM! Thanks!
* initial approach To have consistent behaviour when creating a new tab with ctrl+t * consistent behaviour when creating tabs * fixed bug and added tests * updates to pass checks
SUMMARY
fixes #11589
This changes an inconsistent behaviour when opening tabs in sqlLab with consistent query placeholder and tab sequential naming
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
Screen.Recording.2022-03-29.at.17.38.31.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION