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

[Lens] Use datagrid with resizable columns for datatable #88069

Merged
merged 34 commits into from
Jan 29, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jan 12, 2021

Fixes #72504, built on top of #87152

This PR migrates the Lens data table visualization to data grid.

New features from previous implementation:

  • ✨ Resizable Columns

To do:

  • Add more functional tests
  • Fix functional tests
  • Clean up code (move individual memoized blocks into separate files)

Considerations

On dashboards we can't persist state at the moment. However it's possible to resize columns - on navigating away from the dashboard, this state is lost.

@dej611 dej611 added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 Feature:Lens v7.12.0 labels Jan 12, 2021
@dej611
Copy link
Contributor Author

dej611 commented Jan 14, 2021

@elasticmachine merge upstream

@dej611 dej611 marked this pull request as ready for review January 14, 2021 14:11
@dej611 dej611 requested a review from a team January 14, 2021 14:11
@dej611 dej611 requested a review from a team as a code owner January 14, 2021 14:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

I'm no expert on the datagrid component, but the SCSS change is minor/looks ok to me.

@ryankeairns ryankeairns self-requested a review January 14, 2021 21:56
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

While I appreciate the initiative (and love both Lens and Datagrid), I don't feel that the current UX set forth by this PR is in a releasable condition due to the resizing issue. You quickly end up in a situation where the table/grid overflows the Dashboard panel and you essentially can't fix the situation (at least, I couldn't). Presuming that is truly the case, it would be a considerable downgrade from the current basic table approach.

Perhaps there is a way to overcome this such that the datagrid fits the Dashboard panel container, but short of that I would not recommend shipping this change until the issue is resolved.

@ryankeairns
Copy link
Contributor

@MichaelMarcialis @dej611 We discussed this in a meeting last week. For now it's intentional to keep it to the editor, but we are planning to expose the functionality in a non-persistent way later on. It requires some refactoring of the internals though.

I will create an issue for this

This was my expectation as well based upon my conversation with Joe - that it would be Lens only, first.
Thanks for getting this initial version in, and I'll follow the separate issue.

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

I've left a few small CSS comments. Otherwise, looks good to me. Approving now so as to not hold you up further.

@@ -1,3 +1,8 @@
.lnsDataTableContainer {
height: 100%;
overflow: initial;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this overflow style necessary? It appears to be getting overridden by styles from .lnsVisualizationContainer. I assume it can be removed.

Comment on lines 20 to 22
.lnsDataTableCellContent {
@include euiTextTruncate;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unnecessary, as EuiDataGrid already truncates cell contents. Am I correct in assuming this style was added because the EuiDataGrid truncation stopped working when wrapping the cell contents with div.lnsDataTableCellContent? If that assumption is correct, we can fix this in one of two ways:

  • If this div isn't really necessary, simply removing it will allow the EuiDataGrid truncation to work properly again.
  • Alternatively, if wrapping element is necessary, changing it to an inline element (such as a span) should also allow the EuiDataGrid truncation to work properly.

Comment on lines 6 to 8
.lnsDataTable {
align-self: flex-start;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this selector being used still? I didn't see it in my testing. If not, should probably be removed.

Comment on lines 16 to 18
.lnsDataTable__filter:focus-within {
opacity: 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this selector being used still? I didn't see it in my testing. If not, should probably be removed.

@dej611
Copy link
Contributor Author

dej611 commented Jan 25, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Jan 25, 2021

@MichaelMarcialis integrated your feedback. I had to use an inline element as you proposed for the truncation to work properly.

@flash1293
Copy link
Contributor

@ryankeairns would this PR be ready from your side?

@flash1293
Copy link
Contributor

flash1293 commented Jan 25, 2021

@dej611 I tested a production build with the current version of EUI and for large tables it's definitely much slower than the basic table (for ~130 rows it renders for 2.4 seconds with data grid vs 0.9 seconds with basic table, with the performance optimizations data grid renders for 90 milliseconds). I wouldn't feel comfortable merging it like this as long as we aren't sure we will land the optimizations in 7.12 FYI @chandlerprall

@dej611
Copy link
Contributor Author

dej611 commented Jan 26, 2021

@elasticmachine merge upstream

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Yep, sorry for the late reply.

@dej611
Copy link
Contributor Author

dej611 commented Jan 27, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Jan 28, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Jan 28, 2021

@elasticmachine merge upstream

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 465 474 +9

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 853.2KB 859.3KB +6.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lens 34.2KB 34.3KB +97.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dej611 dej611 changed the title [Lens] Migrate data table visualization to data grid [Lens] Use datagrid with resizable columns for datatable Jan 29, 2021
@dej611 dej611 merged commit 9733d2f into elastic:master Jan 29, 2021
@dej611 dej611 deleted the lens/eui-data-grid branch January 29, 2021 11:09
dej611 added a commit to dej611/kibana that referenced this pull request Jan 29, 2021
dej611 added a commit that referenced this pull request Feb 1, 2021
@flash1293 flash1293 mentioned this pull request Feb 15, 2021
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Replace basic table with EuiDataGrid
8 participants