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: Uses new table component in Drill to Detail #22173

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented Nov 20, 2022

SUMMARY

Uses the new table component in Drill to Detail to benefit from virtualization and deal with tables with many columns.

It also extends the new Table component with new cell and header renderers.

@eric-briscoe

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-11-28.at.10.03.11.AM.mov
Screen.Recording.2022-11-28.at.9.58.38.AM.mov

TESTING INSTRUCTIONS

  • Check that the pagination is working as intended
  • Check that the columns are correctly formatted
  • Check that you can select formatting for time columns

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

@michael-s-molina
Copy link
Member Author

@eric-briscoe I noticed an error in the browser console when paginating. It seems an internal table error. Can you check?

Copy link
Contributor

@eric-briscoe eric-briscoe left a comment

Choose a reason for hiding this comment

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

Overall looks great! I left one set of comments about testing bad values for data cell which I think would be worthwhile.

expect(screen.getByText('2022-01-01')).toBeInTheDocument();
});

test('renders with number', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@michael-s-molina can we add tests that pass a mixture of null | undefined| invalid time formats as we as mix of invalid DATE values to ensure the cell renderer does not throw runtime error and break app in case a single row has bad / missing data? I think we want to make cell renderers fault tolerant especially when doing error prone translations like dates. antd does not give us an error protection on cell rendering so we have to make sure our cell renderers do not throw error that will break the render loop for entire table component / app

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. Added ✅

Comment on lines 31 to 32
const timeFormatter = getTimeFormatter(format);
return <span>{timeFormatter.format(value)}</span>;
Copy link
Contributor

Choose a reason for hiding this comment

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

@michael-s-molina pairing this with comment on superset-frontend/src/components/Table/cell-renderers/TimeCell/TimeCell.test.tsx for testing with bad data formats / formats value mismatch to make sure we are handling any potential errors due to bad dat values for a row

Copy link
Member Author

Choose a reason for hiding this comment

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

👍🏼

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #22173 (19ce6ce) into master (eba7b3d) will increase coverage by 0.03%.
The diff coverage is 54.22%.

❗ Current head 19ce6ce differs from pull request most recent head 87d4041. Consider uploading reports for the commit 87d4041 to get more accurate results

@@            Coverage Diff             @@
##           master   #22173      +/-   ##
==========================================
+ Coverage   66.86%   66.89%   +0.03%     
==========================================
  Files        1840     1845       +5     
  Lines       70160    70281     +121     
  Branches     7657     7683      +26     
==========================================
+ Hits        46909    47012     +103     
+ Misses      21281    21277       -4     
- Partials     1970     1992      +22     
Flag Coverage Δ
javascript 53.79% <52.66%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
...ages/superset-ui-core/src/query/types/Dashboard.ts 100.00% <ø> (ø)
...superset-ui-core/src/query/types/PostProcessing.ts 100.00% <ø> (ø)
...packages/superset-ui-core/src/query/types/Query.ts 100.00% <ø> (ø)
...ins/plugin-chart-echarts/src/BoxPlot/buildQuery.ts 66.66% <ø> (ø)
...s/plugin-chart-echarts/src/BoxPlot/controlPanel.ts 5.55% <ø> (ø)
...ugins/plugin-chart-echarts/src/Radar/buildQuery.ts 0.00% <0.00%> (ø)
...charts/src/Timeseries/Regular/Bar/controlPanel.tsx 35.71% <ø> (+4.46%) ⬆️
.../plugin-chart-echarts/src/Timeseries/buildQuery.ts 71.42% <ø> (ø)
.../plugin-chart-pivot-table/src/plugin/buildQuery.ts 42.85% <ø> (ø)
...ugin-chart-pivot-table/src/plugin/controlPanel.tsx 4.16% <0.00%> (ø)
... and 48 more

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

@geido
Copy link
Member

geido commented Nov 29, 2022

/testenv up

@github-actions
Copy link
Contributor

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

@geido
Copy link
Member

geido commented Nov 29, 2022

/testenv up FEATURE_DRILL_TO_DETAIL=true

@github-actions
Copy link
Contributor

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

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

LGMT! Just two nits

We can improve the spacing
Screenshot 2022-11-29 at 18 06 13

{ label: t('Formatted value'), value: 'formatted' },
]}
value={
timeFormatting[column] === 'original' ? 'original' : 'formatted'
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using an Enum for these two values?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✅

Copy link
Member

@codyml codyml left a comment

Choose a reason for hiding this comment

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

This looks great! One issue I'm seeing is that the fixed-height table doesn't play well with the adjustable-height modal:

Screen Shot 2022-11-29 at 12 37 27 PM

Screen Shot 2022-11-29 at 12 38 25 PM

Is there any way to make the table adjustable height, so it fills the modal vertically when expanded and leaves the pagination controls visible when minimizing? If not, should we maybe make the modal height fixed to match the fixed height of the table?

@michael-s-molina
Copy link
Member Author

@geido @codyml I addressed your comments in the last commit.

Screen.Recording.2022-11-30.at.11.06.05.AM.mov

@michael-s-molina michael-s-molina merged commit 3ffe782 into apache:master Nov 30, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/XL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants