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

Migrate Table visualization to React Part 1: Renderer #3963

Merged
merged 25 commits into from
Jul 31, 2019

Conversation

kravets-levko
Copy link
Collaborator

@kravets-levko kravets-levko commented Jul 8, 2019

What type of PR is this? (check all applicable)

  • Refactor

Description

  • Replace <dynamic-table> with Ant's <Table> component
  • Implement custom features:
    • number, date/time, boolean formatting;
    • HTML features (simple formatting, highlight links);
    • Image column;
    • Link column;
    • JSON column;
    • search in data;
    • sort data by column click (multi-column sort);
  • Cleanup
  • Tests

Related Tickets & Documents

#3301 (Migrate Visualizations to React -> Table)

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Mostly the same as before:

image
image
image
image

@kravets-levko kravets-levko self-assigned this Jul 8, 2019
@arikfr arikfr mentioned this pull request Jul 8, 2019
24 tasks
@kravets-levko kravets-levko marked this pull request as ready for review July 17, 2019 15:11
@kravets-levko
Copy link
Collaborator Author

kravets-levko commented Jul 17, 2019

@arikfr @ranbena @gabrieldutra I still need to create some tests for Table visualization, but this code is ready for review. Also, someone who had that issue with horizontal scroll - please test it again with new component (I removed that CSS because entire <dynamic-table> was replaced, but I may need to restore it if that bug reproduces with Ant's Table as well). Thanks!

@kravets-levko kravets-levko changed the title Migrate Table visualization to React Part 1: Renderer (WIP) Migrate Table visualization to React Part 1: Renderer Jul 23, 2019
…essary updates (by default React compares references only)
@kravets-levko kravets-levko changed the title (WIP) Migrate Table visualization to React Part 1: Renderer Migrate Table visualization to React Part 1: Renderer Jul 24, 2019
@arikfr
Copy link
Member

arikfr commented Jul 25, 2019

@kravets-levko considering that Ant takes care of the indicators in new version, let's keep as is. 👍

@ranbena
Copy link
Contributor

ranbena commented Jul 25, 2019

@ranbena when you move the cursor out, does it hide the scrollbar?

@arikfr usually yes, but after numerous attempts it eventually sticks.

@ranbena
Copy link
Contributor

ranbena commented Jul 26, 2019

Hold up! This might have been fixed finally for Chrome 76 https://bugs.chromium.org/p/chromium/issues/detail?id=914844#c77

@ranbena
Copy link
Contributor

ranbena commented Jul 31, 2019

@kravets-levko perhaps upgrade Ant so the new table header design kicks in?

@ranbena
Copy link
Contributor

ranbena commented Jul 31, 2019

Hold up! This might have been fixed finally for Chrome 76 https://bugs.chromium.org/p/chromium/issues/detail?id=914844#c77

Just upgraded and can't repro bug 👍

@ranbena
Copy link
Contributor

ranbena commented Jul 31, 2019

Just upgraded and can't repro bug 👍

Nope, I just did 👎

@kravets-levko
Copy link
Collaborator Author

perhaps upgrade Ant so the new table header design kicks in?

Already doing (need to resolve conflicts as well).

Just upgraded and can't repro bug 👍

Nope, I just did 👎

You reproduced the bug in Chrome 76?

@ranbena
Copy link
Contributor

ranbena commented Jul 31, 2019

You reproduced the bug in Chrome 76?

Yes but I just realized I got v76.0.3809 and the fix is on v76.0.3901..

@kravets-levko
Copy link
Collaborator Author

@ranbena
image

P.S. Ant's Table is a bit stupid: it has built-in sorting feature, which supports single-column sort. It's also possible to disable it (sorter: true and then set sortOrder per column where needed) - table will just show sorter icons and will not actually sort data. But it does not allow to display sort order on multiple columns - always only one column can have active (blue) arrow, others will be ignored 🤦‍♂️

Copy link
Contributor

@ranbena ranbena left a comment

Choose a reason for hiding this comment

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

@kravets-levko it looks great!

Regarding the cell height, I prefer the original 33px only for the sake of backwards compatibility, if you think it's important.

Regarding the th ellipsis we chose max-width: 100px but it does have a downside - it'll get clipped even if there's room for the whole title.

  1. Perhaps consider a higher max value so only absurdly long titles get clipped.
  2. In a following PR, allow users to edit viz setting with full/clipped/multi-row.

@kravets-levko
Copy link
Collaborator Author

@ranbena

Regarding the cell height, I prefer the original 33px only for the sake of backwards compatibility, if you think it's important.

I'm not sure it's so important. Auto-height feature exists to deal with variable-height tables, and it may mess up dashboard layout any time (not only after CSS changes, but also after re-running query, changing visualization options, etc.). Considering this, I prefer to not override line-height for the visualization.

  1. Totally agree. What could be a better value for this - how do you think? I think 200px should be more than enough, but who knows 🤔
  2. I think it's better to create an issue (you can even assign it to me, or label as "Help wanted").

@ranbena
Copy link
Contributor

ranbena commented Jul 31, 2019

  1. Totally agree. What could be a better value for this - how do you think? I think 200px should be more than enough, but who knows 🤔

200 is better than 100 in this case 👍 and having the setting later will make sure everyone's happy.

  1. I think it's better to create an issue (you can even assign it to me, or label as "Help wanted").

Will do.

@kravets-levko
Copy link
Collaborator Author

@arikfr @gabrieldutra If everyone is happy with this PR - I'll merge it

@arikfr
Copy link
Member

arikfr commented Jul 31, 2019

👍

@kravets-levko kravets-levko merged commit 9b29091 into master Jul 31, 2019
@kravets-levko kravets-levko deleted the migrate-visualization-table branch July 31, 2019 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants