Skip to content
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

Conversation

Gwitchr
Copy link
Contributor

@Gwitchr Gwitchr commented Mar 29, 2022

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

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

To have consistent behaviour when creating a new tab with ctrl+t
return initialTitle;
}

return initialTitle;
Copy link
Contributor

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?

Copy link
Contributor Author

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 = (
Copy link
Contributor

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

@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 9, 2022
@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #19420 (9399fda) into master (b689ac2) will increase coverage by 0.06%.
The diff coverage is 53.76%.

❗ Current head 9399fda differs from pull request most recent head d96c3f8. Consider uploading reports for the commit d96c3f8 to get more accurate results

@@            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     
Flag Coverage Δ
javascript 51.17% <53.76%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ntrols/src/components/CertifiedIconWithTooltip.tsx 80.00% <ø> (ø)
...d/packages/superset-ui-chart-controls/src/index.ts 100.00% <ø> (ø)
...omponents/ColumnConfigControl/ColumnConfigItem.tsx 0.00% <ø> (ø)
...et-ui-chart-controls/src/shared-controls/index.tsx 36.19% <ø> (ø)
...ugins/legacy-plugin-chart-calendar/src/Calendar.js 0.00% <ø> (ø)
...legacy-plugin-chart-calendar/src/ReactCalendar.jsx 0.00% <0.00%> (ø)
...cy-plugin-chart-calendar/src/vendor/cal-heatmap.js 0.00% <ø> (ø)
...ugins/legacy-plugin-chart-chord/src/ReactChord.jsx 0.00% <0.00%> (ø)
.../legacy-plugin-chart-country-map/src/CountryMap.js 0.00% <ø> (ø)
...y-plugin-chart-country-map/src/ReactCountryMap.jsx 0.00% <0.00%> (ø)
... and 274 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b689ac2...d96c3f8. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@rusackas rusackas merged commit 56381f4 into apache:master Apr 15, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* 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
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL Lab: CTRL+T behaved differently from clicking "+"
4 participants