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: FilterableTable result div width #16912

Merged
merged 2 commits into from
Oct 6, 2021

Conversation

lyndsiWilliams
Copy link
Member

@lyndsiWilliams lyndsiWilliams commented Sep 30, 2021

SUMMARY

When a table exceeded 50 columns, some of the results would appear to be cut off. The results now show properly by setting the width of the div wrapping the result to inherit.

  • Note: This also seems to work the same with max-content but inherit seemed safer.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

before

AFTER

after

TESTING INSTRUCTIONS

Find/create a table that exceeds 50 columns and contains timestamps. Observe that the results are no longer cut off and display correctly.

  • If you use the longer superset examples (superset load-examples -b), you can repro this in SQL Lab's SQL editor with this query: SELECT * FROM wide_table

ADDITIONAL INFORMATION

@lyndsiWilliams lyndsiWilliams marked this pull request as draft September 30, 2021 05:44
@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #16912 (4fe63b1) into master (1cd0124) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16912   +/-   ##
=======================================
  Coverage   76.92%   76.92%           
=======================================
  Files        1030     1030           
  Lines       55022    55022           
  Branches     7465     7465           
=======================================
  Hits        42328    42328           
  Misses      12440    12440           
  Partials      254      254           
Flag Coverage Δ
javascript 70.90% <ø> (ø)

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

Impacted Files Coverage Δ
...src/components/FilterableTable/FilterableTable.tsx 81.86% <ø> (ø)

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 1cd0124...4fe63b1. Read the comment docs.

@lyndsiWilliams lyndsiWilliams marked this pull request as ready for review September 30, 2021 23:48
@geido
Copy link
Member

geido commented Oct 1, 2021

/testenv up

@@ -435,7 +435,7 @@ export default class FilterableTable extends PureComponent<
}}
className={`grid-cell ${this.rowClassName({ index: rowIndex })}`}
>
<div>{content}</div>
<div style={{ width: 'inherit' }}>{content}</div>
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to move this to a styled component. You have it available in this file already. In general, we are trying to avoid inline styles even when they are minimal like this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Heya, good catch! Since this is just a single-use style change I used css= for this case, as that's what the Frontend Guidelines suggest for cases like this. Changed in this commit.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

@geido Ephemeral environment spinning up at http://54.244.56.79:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@eschutho
Copy link
Member

eschutho commented Oct 4, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2021

@eschutho Ephemeral environment spinning up at http://34.209.73.62:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@eschutho
Copy link
Member

eschutho commented Oct 6, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2021

@eschutho Ephemeral environment spinning up at http://34.220.82.219:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@betodealmeida betodealmeida merged commit 90cfa7f into apache:master Oct 6, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2021

Ephemeral environment shutdown and build artifacts deleted.

@lyndsiWilliams lyndsiWilliams deleted the lyndsi/15554-fix branch October 6, 2021 21:08
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* FilterableTable result div width is now inherit

* Changed style to css
@AAfghahi
Copy link
Member

🏷 v1.4

eschutho pushed a commit that referenced this pull request Nov 22, 2021
* FilterableTable result div width is now inherit

* Changed style to css

(cherry picked from commit 90cfa7f)
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* FilterableTable result div width is now inherit

* Changed style to css
@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 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 v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants