-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 legacy sort saved search stored in dashboard saved objects #137488
Merged
kertal
merged 23 commits into
elastic:main
from
kertal:discover-refactor-sort-functions
Aug 23, 2022
Merged
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
65517f6
Refactor sort functionality
kertal 10ed706
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine 326009f
Improve code and add tests
kertal cc0c094
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine de3c271
Merge branch 'main' into discover-refactor-sort-functions
kertal 32c584d
Merge branch 'main' into discover-refactor-sort-functions
kibanamachine 135b9d5
Improve sorting types
kertal 2dd7bef
Improve types
kertal c2ffbe6
Prevent duplicate of fetching
kertal 2a51392
migrate functions to utils/sorting
kertal 95d1c49
Rename SortOrder to SortPair
kertal ffe9fd9
Refactor to use just a single SortPair
kertal 036074f
Merge remote-tracking branch 'upstream/main' into discover-refactor-s…
kertal 615447c
add debug log
kertal c5f674e
Fix functional test
kertal 289062c
Merge branch 'main' into discover-refactor-sort-functions
kibanamachine 54a7a91
Merge main, fix conflicts
kertal f60ba59
Merge branch 'main' into discover-refactor-sort-functions
kibanamachine 86746a0
Merge main, fix conflicts
kertal 6d14142
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 130e99b
Merge branch 'main' into discover-refactor-sort-functions
kibanamachine 4e8cfb6
Migrate type SortPairArr to SortOrder of the saved_search plugin
kertal 3604da6
Merge remote-tracking branch 'upstream/main' into discover-refactor-s…
kertal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ export interface DataTableRecord { | |
*/ | ||
isAnchor?: boolean; | ||
} | ||
|
||
export type SortPairArr = [string, string]; |
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
File renamed without changes.
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this case!
I noticed one weird thing when a saved search configuration on Dashboard has legacy format for a column
"sort":["extension","desc"]
. It replaces the current sorting setting when trying to add another sort criteria on Dashboard (on Discover pages it works as expected)Is it something we can improve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely! another good catch 🎣 ! thx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting, because it worked for me locally ... maybe you could export the dashboard saved object and send it to me so I could reproduce? many thx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx for the saved object! So the problem here is that
extension
is a field that's not sortable,extension.keyword
is sortable. when changing the sort, this field is removed from sorting (sorted out 😃). Since the sorting state of the UI can only be changed with manually tweaking the saved search, I think we're safe here. However there might be a potential follow up taking care of the behavior in Discover, which seems to work differently in this case.