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

[Discover] Remove column from sorting array when removed from table #65990

Conversation

kertal
Copy link
Member

@kertal kertal commented May 11, 2020

Summary

When you removed a column in Discover, that was part of the sorting array, the sorting by this field was still active, and there was no way to remove it except modifying the URL. This caused confusion especially when you switched index pattern. The suggested solution is automatically removing the field from the sorting array, when you remove the column from the table.
Fixes #54345

How to test

  • Add a column to to the doc table, sort by the column.
  • Take a look at the URL, the field should be part of the sort: part.
  • Remove the column.
  • The URL should no longer contain the field in the sort: part.

Checklist

Delete any items that are not applicable to this PR.

@kertal kertal added the Feature:Discover Discover Application label May 11, 2020
@kertal kertal self-assigned this May 11, 2020
@kertal
Copy link
Member Author

kertal commented May 11, 2020

@elasticmachine merge upstream

@kertal kertal changed the title [Discover] Remove sort by column if column is removed [Discover] Remove column from sorting array when removed from table May 19, 2020
@kertal kertal requested a review from timroes May 19, 2020 06:33
@kertal
Copy link
Member Author

kertal commented Jun 30, 2020

@elasticmachine merge upstream

@kertal kertal marked this pull request as ready for review June 30, 2020 07:55
@kertal kertal requested a review from a team June 30, 2020 07:55
@kertal kertal added release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jun 30, 2020
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested, works as expected - removing a column which is sorted by and re-adding it will remove the sort. LGTM

Thanks for adding a functional test. It could be made slightly more stable by not checking the URL but whether the little triangle in the column header is not rendered after adding the column again. Not a blocker though.

@kertal
Copy link
Member Author

kertal commented Jun 30, 2020

thx @flash1293, good reminder about the potential flakiness, so I started a flaky test runner to be sure
https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/557/ - it' s not flaky
I've implemented it that way because it also intially works when EuiDataGrid is introduced, I'll revisit it then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discover: Removing a field keeps sorting by it
4 participants