Skip to content

[ML] Use EuiDataGrid for transform wizard.#52510

Merged
walterra merged 33 commits intoelastic:masterfrom
walterra:ml-eui-data-grid
Mar 3, 2020
Merged

[ML] Use EuiDataGrid for transform wizard.#52510
walterra merged 33 commits intoelastic:masterfrom
walterra:ml-eui-data-grid

Conversation

@walterra
Copy link
Copy Markdown
Contributor

@walterra walterra commented Dec 9, 2019

Summary

Part of #51288.
Fixes #49849.

Replaces the custom EuiInMemoryTable component with EuiDataGrid for the transforms wizard.

Note for reviewing SCSS: The hard coded px values are temporary. We plan to do a redesign of the transforms wizard as a follow up to move from the two-column layout to a single-column layout and should be able to get rid of those hard coded by then.

image

TODO / Fix

Checklist

For maintainers

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

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

@walterra walterra added release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0 Feature:Transforms Transforms refactoring labels Feb 18, 2020
@walterra walterra marked this pull request as ready for review February 18, 2020 17:46
@walterra walterra requested review from a team as code owners February 18, 2020 17:46
@walterra walterra added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes refactoring labels Feb 18, 2020
@walterra
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@peteharverson
Copy link
Copy Markdown
Contributor

Found a problem with the paging for the source table - here I moved to the last page (2000) with 5 rows per page, and then edited the rows per page to 25:

image

@peteharverson
Copy link
Copy Markdown
Contributor

Paging doesn't seem to work for the preview table. Here the cell values aren't changing, just the alignment of heading and cell text:

data_grid_preview

@peteharverson
Copy link
Copy Markdown
Contributor

'Hide all' on the source table can cause the toolbar to disappear. It will reappear if you hit page 5 (but not pages 1 -4 !):

image

@peteharverson
Copy link
Copy Markdown
Contributor

Is it worth defaulting to a max of say 10 columns, rather than a default of showing all columns? For a filebeat-apache2-bootcamp index, with 173 fields, performance is very slow when showing the default of all columns.

@walterra
Copy link
Copy Markdown
Contributor Author

@peteharverson

  • I couldn't reproduce the CPUtilization column showing up in the preview with the same configuration, can you try again on the latest version?
  • Fixed the sorting for the pivot preview in 5934d22.
  • Fixed the paging for the pivot preview in f5bfba0.
  • Fixed the issue where paging broke the page in the source index table in 2e8e52f. When changing the item count on the page, the current page should now adapt and not be out of bounds anymore.
  • I could reproduce the issue with the grid header disappearing but haven't found out how to fix it, not sure if it's a problem on our side or data grid itself. Ok for a follow-up?
  • Introducing a limit for default columns to show up would also be something I'd like to investigate for a follow up, it might introduce quite a bit of code churn at this stage.

@peteharverson
Copy link
Copy Markdown
Contributor

With the latest commits, the second column in the preview table is always showing the selected aggregation in the JSON format e.g.

image

@peteharverson
Copy link
Copy Markdown
Contributor

Another paging issue with the Preview table - where I guess it is trying to restore the page number if the group by, or aggregation changes. Here I grouped by instance, switched to the last page (page 16), then switched to grouping by region (which only has 5 values), and the table is blank:

image

This also affects the source table (here use farequote, search over all airlines, go to page 2000, and then add an airline:AAL query:

image

Maybe we should reset the page number if the query / Group by / Aggregation change?

@peteharverson
Copy link
Copy Markdown
Contributor

Agree that these can be done in follow-ups:

  • header disappearing sometimes when using 'Hide all' on the source table
  • introduce a limit for default number of columns

And as a workaround for #52510 (comment), I would vote to hide all object type fields from the tables.

@walterra
Copy link
Copy Markdown
Contributor Author

walterra commented Mar 2, 2020

@peteharverson

  • Added a filter to skip object type properties from the pivot preivew e9f8ef7
  • Added a check to reset paging for the source page and pivot preview 5bc6460

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest edits, and LGTM!

Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Added a couple of questions.
But on the whole LGTM!


type SourceIndexSearchResponse = ErrorResponse | SearchResponse<any>;
// The types specified in `@types/elasticsearch` are out of date and still have `total: number`.
interface SearchResponse7 extends SearchResponse<any> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why the 7 at the end of the name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The @types/elasticsearch types are quite out of date (6.something) so I put the 7 there as a fix saying for 7.x. Hope this is temporary and at some point we get updated types.

setStarted(true);
setLoading(false);
} else {
throw new Error();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this error contains no text so it looks like the toast body below will be empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f080f31.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

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

@walterra walterra merged commit 63cb9ff into elastic:master Mar 3, 2020
@walterra walterra deleted the ml-eui-data-grid branch March 3, 2020 16:43
walterra added a commit that referenced this pull request Mar 3, 2020
Replaces the custom EuiInMemoryTable component with EuiDataGrid for the transforms wizard.
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.

[ML] Transforms: Wizard preview is missing option to toggle column visibility

6 participants