forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Allow sorting only for visible columns (elastic#172077)
- Closes elastic#172023 ## Summary As [eui](https://github.com/elastic/eui/blob/8eb7277ffd6d13082d6a45030efcf9a2ca0528e8/src/components/datagrid/controls/column_sorting.tsx#L44-L57) triggers `onSort` for `EuiDataGrid` when `sort` array includes fields which are not present in `columns` array, it changes the app state. This results in "unsaved changes" badge although user can't know why. This PR makes sure that state is not modified when unknown sorting fields are persisted inside a saved search and user opens such search. To reproduce the mentioned issue: - Add columns to the table and define their sorting - Save the search - Reopen the search and remove one of the columns which had custom sorting - Save the search - Now open Discover again and reopen the search. With this PR, "unsaved changes" badge would not appear. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
2 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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