[Discover] Modify columns and sort when switching index pattern#74336
Merged
kertal merged 13 commits intoelastic:masterfrom Oct 6, 2020
Merged
Conversation
Member
Author
|
@elasticmachine merge upstream |
…ns-on-index-pattern-switch
kertal
commented
Sep 22, 2020
…-05-discover-modify-columns-on-index-pattern-switch
…attern-switch' of github.com:kertal/kibana into kertal-pr-2020-08-05-discover-modify-columns-on-index-pattern-switch
…-05-discover-modify-columns-on-index-pattern-switch
kertal
commented
Oct 1, 2020
Contributor
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
Member
Author
|
@elasticmachine merge upstream |
…ns-on-index-pattern-switch
flash1293
approved these changes
Oct 5, 2020
Contributor
flash1293
left a comment
There was a problem hiding this comment.
Tested with and without advanced setting and works well, LGTM. Not sure about the unknown fields case but not a blocker
| } as IndexPattern; | ||
|
|
||
| describe('Discover getSwitchIndexPatternAppState', () => { | ||
| test('removing fields that are not part of the next index pattern, keeping unknown fields ', async () => { |
Contributor
There was a problem hiding this comment.
Can you explain the reasoning behind this? How would a user run into this case and why would they want to keep the unknown fields?
Member
Author
kertal
added a commit
to kertal/kibana
that referenced
this pull request
Oct 6, 2020
…tic#74336) * Modify columns and sort when switching index pattern * Add unit tests * Add uiSetting to allow switch to legacy behavior
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Oct 6, 2020
* master: (85 commits) Refactor attribute service (elastic#78414) [APM] Add default message to alerts. (elastic#78930) [Discover] Modify columns and sort when switching index pattern (elastic#74336) Document ts project references setup (elastic#78586) build all ts refs in single kbn:bootstrap (elastic#79438) [TSVB] Allow string fields on value count aggregation (elastic#79267) [SECURITY SOLUTION] Investigate EQL signal in timeline (elastic#79049) [Fleet] Add loading spinner to page headers (elastic#79568) [Security Solution][Resolver] Resolver query panel load more (elastic#79160) Add type row to monitor detail page. (elastic#79556) Remove license refresh from setup (elastic#79518) [docker] add reporting fonts (elastic#74806) [SECURITY_SOLUTION][ENDPOINT] Add info about trusted apps to the page subtitle + create flyout (elastic#79558) Trim Hash value before validating it (elastic#79545) Warn users when security is not configured (elastic#78545) update copy styling (elastic#79313) Update dependency @elastic/charts to v23.1.1 (elastic#78459) Introduce geo-threshold alerts (elastic#76285) elastic#76920 Show base breadcrumb when there is an error booting the app (elastic#79571) remove react-intl from kibana and keep it inside only i18n package (elastic#78956) ...
kertal
added a commit
that referenced
this pull request
Oct 6, 2020
…) (#79616) * Modify columns and sort when switching index pattern * Add unit tests * Add uiSetting to allow switch to legacy behavior
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
When switching index pattern in Discover, this PR removes the columns and sort that are not available in the new index pattern. Selected fields that are neither part of the current and next index pattern are not removed (E.g.
productsof ourkibana_sample_data_ecommerce). In the following example, when switching index patternDistanceKilometers&DistanceMilesare remove because they are not part of thekibana_sample_data_commerceindex pattern. And since no other column, that both index patterns share, was selected,_sourceas default column is displayed.You can opt out in Advanced Settings if you prefer the columns not to be modified

Fixes #57322
Fixes #45557
Fixes #45988
Fixes #54653
Checklist