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(sqllab): Query limit dropdown number breaks to separate lines #17382

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

lyndsiWilliams
Copy link
Member

@lyndsiWilliams lyndsiWilliams commented Nov 9, 2021

SUMMARY

The query limit dropdown number in SQL Lab editor would break into separate lines when the screen was at smaller widths and the number is "1 000" or higher. This is corrected by giving the number result white-space: nowrap.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

limit-broken

AFTER

limit-fixed

TESTING INSTRUCTIONS

  • Go to the SQL Lab editor
  • Set the query limit dropdown to "1 000" or higher
  • Adjust the screen's width and observe that the number no longer breaks to separate lines

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

@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #17382 (7131a32) into master (561d1ac) will decrease coverage by 0.04%.
The diff coverage is 44.44%.

❗ Current head 7131a32 differs from pull request most recent head f7e4643. Consider uploading reports for the commit f7e4643 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17382      +/-   ##
==========================================
- Coverage   77.07%   77.02%   -0.05%     
==========================================
  Files        1036     1038       +2     
  Lines       55756    56021     +265     
  Branches     7630     7735     +105     
==========================================
+ Hits        42972    43150     +178     
- Misses      12529    12613      +84     
- Partials      255      258       +3     
Flag Coverage Δ
javascript 71.22% <42.51%> (-0.21%) ⬇️

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

Impacted Files Coverage Δ
...frontend/src/SqlLab/components/SqlEditor/index.jsx 54.14% <ø> (ø)
...ontend/src/common/hooks/apiResources/dashboards.ts 40.00% <0.00%> (ø)
superset-frontend/src/constants.ts 100.00% <ø> (ø)
...et-frontend/src/dashboard/actions/sliceEntities.js 11.76% <0.00%> (-1.14%) ⬇️
...nd/src/dashboard/components/nativeFilters/types.ts 100.00% <ø> (ø)
...perset-frontend/src/dashboard/containers/Chart.jsx 92.85% <ø> (ø)
...ntend/src/dashboard/containers/DashboardHeader.jsx 100.00% <ø> (ø)
...t-frontend/src/dashboard/containers/SliceAdder.jsx 0.00% <0.00%> (ø)
.../CRUD/data/database/DatabaseModal/ExtraOptions.tsx 93.18% <ø> (ø)
superset/config.py 91.50% <ø> (ø)
... and 22 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 561d1ac...f7e4643. Read the comment docs.

@@ -125,6 +125,10 @@ const StyledToolbar = styled.div`
}
}
}

.limitDropdown {
width: max-content;
Copy link
Member

Choose a reason for hiding this comment

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

this is great! Super small nit, but white-space: nowrap may be more explicit here. You're saying "don't wrap on the white space", rather than "make the width of the element match the content." With white-spaceif you wanted to change the width later and make it larger, you still can.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a lot safer of a method, thanks! Fixed in this commit.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Super! small comment

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

looks great! thanks for the fix!

@eschutho eschutho merged commit 1beda79 into apache:master Nov 10, 2021
@eschutho eschutho deleted the lyndsi/fix-limit-break branch November 10, 2021 18:58
AAfghahi pushed a commit that referenced this pull request Jan 10, 2022
…7382)

* Limit break fixed

* Used white-space: nowrap instead of width: max-content
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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 preset-io size/XS 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants