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] Fix index pattern switch behavior #92131

Conversation

kertal
Copy link
Member

@kertal kertal commented Feb 22, 2021

Summary

This PR takes care of an issue introduced in #92132 when you switch index patterns, found while testing for #88426

  • When you were switching from an index pattern with a timeField with no columns selected to an index pattern without a timeField which contained the same timeField, the sorting by the timefield was preserved, but it was just in the URL, so you had to add the column to remove the sorting (more likely you thought, why does sorting not work ... when trying to sort by another column)
  • When you were switching from index pattern with timeFieldA to an index pattern with timeFieldB, timeFieldA was removed, but timeFieldB was not applied
  • Furthermore it removed another usage of _source as default column when switching index patterns. This is now handled in state management

Testing

  • Install kibana_sample_data_ecommerce demo data
  • Create an index pattern kibana_sample_data-eco*, without time field
  • Go to Discover
  • Select kibana_sample_data_ecommerce
  • Switch to kibana_sample_data-eco*
  • Take a look at the sort part of the URL, it should be empty. Before it was containing order_date,desc. So it was still sorted, but you had to add the order_date column to change this (Or edit the URL) ... confusing

Furthermore

  • Switch between index pattern with timeFieldA to timeFieldB (e.g. from kibana_sample_data_ecommerce to kibana_sample_data_flights)
  • After switching the data table should be sorted by timeFieldB

Checklist

@kertal kertal added the Feature:Discover Discover Application label Feb 22, 2021
@kertal
Copy link
Member Author

kertal commented Feb 22, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 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
discover 400.2KB 400.2KB -17.0B

History

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

@kertal kertal added v7.12.0 v8.0.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes labels Feb 23, 2021
@kertal kertal self-assigned this Feb 23, 2021
@kertal kertal marked this pull request as ready for review February 23, 2021 11:16
@kertal kertal requested a review from a team February 23, 2021 11:16
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

Tested this in Chrome on Mac OS and works as expected. Code changes LGTM

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Tested the scenarios I could think of and it works well.

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:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.12.0 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants