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

[ML] Data Frame Analytics exploration: adds actions column with link to discover #151482

Merged

Conversation

alvarezmelissa87
Copy link
Contributor

Summary

Related issue: #150375

This PR adds an 'Actions' column to the results data grid and provides a link to Discover filtering for the row's field/values shown in the columns.

image

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

query: indexData.visibleColumns
.filter((column) => !column.includes(resultsField!))
.map((column) => {
if (item[column] !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

if item[column] is undefined it looks like this string will be incorrect as undefined will be added to it.
Maybe there should be a filter before the map to remove this risk?

Copy link
Contributor Author

@alvarezmelissa87 alvarezmelissa87 Feb 16, 2023

Choose a reason for hiding this comment

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

Oh yes! Good catch - I'll add it to the filter above 👍
Fixed in 7aea101

@walterra
Copy link
Contributor

The reference in the EUI docs uses a bit of a different layout (different icon, narrower column with no label, instead the "Actions" label is in the tooltip). Wonder if we should stick more to the reference?

image

@alvarezmelissa87
Copy link
Contributor Author

alvarezmelissa87 commented Feb 21, 2023

The reference in the EUI docs uses a bit of a different layout (different icon, narrower column with no label, instead the "Actions" label is in the tooltip). Wonder if we should stick more to the reference?

image

Yeah - I can do that. Right now it reflects the anomalies table Actions column - so depends on if we want to be consistent with the example or the anomalies table. cc @walterra, @peteharverson

@alvarezmelissa87
Copy link
Contributor Author

This is ready for another look when you get a chance 🙏 cc @jgowdyelastic, @walterra (@peteharverson for layout approval)

Copy link
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 and LGTM.

A follow-up for the future would be to enable cell-level drilldown to Discover, similar to what is available in the Lens data table:

image

filters: data.query.filterManager.getFilters(),
query: {
language: SEARCH_QUERY_LANGUAGE.KUERY,
// Filter for all visible column values of supported types - except the results field values
Copy link
Contributor

Choose a reason for hiding this comment

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

I did wonder if we should add all columns to the filter, but that could potentially be a lot of columns. This way the user can control the filter by showing / hiding columns from the grid, so I think this makes sense.

Copy link
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 minor comments, but otherwise LGTM

}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[indexData?.visibleColumns, discoverLocator, dataViewId, resultsField, tableItems]
Copy link
Member

Choose a reason for hiding this comment

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

can data be included here to remove the need to suppress this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Included in 1664d29

];

return (
<>
Copy link
Member

Choose a reason for hiding this comment

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

looks like this fragment isn't needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 1664d29

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
ml 3.5MB 3.5MB +2.5KB

History

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

cc @alvarezmelissa87

@alvarezmelissa87 alvarezmelissa87 merged commit 0916510 into elastic:main Feb 23, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 23, 2023
@alvarezmelissa87 alvarezmelissa87 deleted the ml-dfa-column-discover-link branch February 23, 2023 16:09
@szabosteve szabosteve changed the title [ML] Data Frame Analytics exploration: add actions column with link to discover [ML] Data Frame Analytics exploration: adds actions column with link to discover Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Data Frame Analytics ML data frame analytics features :ml release_note:enhancement v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants