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

feat: Use AntD table in FilterableTable #23035

Conversation

EugeneTorap
Copy link
Contributor

@EugeneTorap EugeneTorap commented Feb 8, 2023

SUMMARY

react-virtualized does not support for react 17 and react 18.
This PR is:

  • Removing react-virtualized lib.
  • Refactoring FilterableTable to use our AntD table.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

@EugeneTorap EugeneTorap force-pushed the feat/use-antd-table-in-filterable-table branch from e60d7f3 to 5fdff26 Compare February 18, 2023 18:00
@EugeneTorap EugeneTorap marked this pull request as ready for review February 18, 2023 19:26
@EugeneTorap EugeneTorap force-pushed the feat/use-antd-table-in-filterable-table branch from ea1cfef to 97f9e5f Compare February 19, 2023 08:28
@lilykuang
Copy link
Member

LGTM. I'd like to get more eyes on this PR. requested more reviewers

@eschutho eschutho requested a review from lilykuang March 27, 2023 16:56
@Antonio-RiveroMartnez
Copy link
Member

Wondering if we need this PR or just bump to latest version that includes react 17 and 18? https://github.com/bvaughn/react-virtualized/releases/tag/v9.22.4 @EugeneTorap @lilykuang

@EugeneTorap
Copy link
Contributor Author

@Antonio-RiveroMartnez I think this lib is useless for us we should drop it and use only antd table here

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @EugeneTorap. I left-some first-pass comments.

@michael-s-molina
Copy link
Member

Can you also debounce the search in SQL Lab? It's re-rendering the table for each typed character.

Screen.Recording.2023-04-23.at.11.44.38.mov

@michael-s-molina
Copy link
Member

I fixed the Frontend CI error here

@EugeneTorap EugeneTorap force-pushed the feat/use-antd-table-in-filterable-table branch from 97f9e5f to f915aac Compare May 1, 2023 11:05
@justinpark
Copy link
Member

justinpark commented May 4, 2023

@michael-s-molina I cleaned up all addressed issues.

I also added the debounced search including loading indicator for better UX

debounced_search.mov

cc: @EugeneTorap

@pull-request-size pull-request-size bot added size/XL and removed size/L labels May 4, 2023
.ReactVirtualized__Table__rowColumn,
.grid-cell {
.ant-table-cell,
.virtual-table-cell {
Copy link
Member

Choose a reason for hiding this comment

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

@justinpark @EugeneTorap Can you provide some context why the default Table theming is not sufficient? The reason I'm asking is because one of the main reason we have a table component is to make sure all tables look and behave the same throughout the application. What are the behaviors that the default Table is missing? Can we implement them on the default Table?

Copy link
Member

Choose a reason for hiding this comment

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

Good point. There's a bunch of differences between this update and existing one.

screenshot
Existing one Screenshot 2023-05-05 at 3 27 30 PM
Table component (no stripes, bigger font size, bigger padding) Screenshot 2023-05-05 at 3 28 52 PM
Table with custom style (no stripes, bigger padding but same font size) Screenshot 2023-05-05 at 3 28 14 PM

The major style update is font-size since it impacts the number of visible rows due to increased row height.
I can add this custom style on default Table if applicable for other cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like how Table with custom style looks!

Copy link
Member

Choose a reason for hiding this comment

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

For me, the important part is that tables look consistent. So I'm ok with either option as long as it's applied globally to the table component and not only to SQL Lab. To make this type of decision, we need to consider the table use cases globally. I think @kasiazjc should be the one to decide which style is more appropriate.

Copy link
Member

Choose a reason for hiding this comment

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

@kasiazjc could you give us an input for design side?

@michael-s-molina
Copy link
Member

michael-s-molina commented May 5, 2023

@michael-s-molina I cleaned up all addressed issues.

I also added the debounced search including loading indicator for better UX

Awesome! Thank you for the changes. I left second review comments.

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #23035 (b1dcddb) into master (fd3030f) will decrease coverage by 1.57%.
The diff coverage is 85.29%.

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

@@            Coverage Diff             @@
##           master   #23035      +/-   ##
==========================================
- Coverage   68.11%   66.55%   -1.57%     
==========================================
  Files        1938     1942       +4     
  Lines       74973    75224     +251     
  Branches     8141     8145       +4     
==========================================
- Hits        51068    50063    -1005     
- Misses      21826    23076    +1250     
- Partials     2079     2085       +6     
Flag Coverage Δ
javascript 54.52% <63.76%> (+0.04%) ⬆️
presto ?
unit ?

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

Impacted Files Coverage Δ
...chart-controls/src/shared-controls/dndControls.tsx 58.33% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...s/legacy-plugin-chart-calendar/src/controlPanel.ts 50.00% <ø> (ø)
...rts/src/BigNumber/BigNumberTotal/transformProps.ts 0.00% <0.00%> (ø)
...lugin-chart-echarts/src/BigNumber/BigNumberViz.tsx 0.00% <0.00%> (ø)
...chart-echarts/src/MixedTimeseries/controlPanel.tsx 56.52% <ø> (ø)
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 66.41% <ø> (+0.08%) ⬆️
...frontend/src/SqlLab/components/ResultSet/index.tsx 63.05% <ø> (+0.39%) ⬆️
... and 114 more

... and 88 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@EugeneTorap
Copy link
Contributor Author

Hi @michael-s-molina! Can we merge this PR in order to unblock the PR of ReactJS 17 support.
We will improve styles of the table in SQL Lab in next PR.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM with the condition of revisiting the Table style in a follow-up. @kasiazjc

@michael-s-molina michael-s-molina merged commit 1670275 into apache:master May 12, 2023
@EugeneTorap EugeneTorap deleted the feat/use-antd-table-in-filterable-table branch May 12, 2023 20:54
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.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/XXL 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants