-
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] account for hidden time column in default sort #129659
[Discover] account for hidden time column in default sort #129659
Conversation
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
src/plugins/discover/public/components/doc_table/lib/get_default_sort.ts
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/components/doc_table/lib/get_default_sort.ts
Outdated
Show resolved
Hide resolved
private getDefaultSort(dataView?: DataView) { | ||
const defaultSortOrder = this.services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc'); | ||
const hidingTimeColumn = this.services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false); | ||
return getDefaultSort(dataView, defaultSortOrder, hidingTimeColumn); | ||
} | ||
|
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.
nice cleanup ❤️
private getDefaultSort(dataView?: DataView) { | ||
const defaultSortOrder = this.services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc'); | ||
const hidingTimeColumn = this.services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false); | ||
return getDefaultSort(dataView, defaultSortOrder, hidingTimeColumn); | ||
} | ||
|
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.
nice cleanup ❤️
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.
well, seems I clicked to often, or GitHub has issues?
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.
Code LGTM, this fixes the linked issue, thx a lot 👍 Tested with Firefox, Chrome, Safari, works as expected.
One think worth a follow up. When you have an existing saved search with sorting by time field in the saved object, you can't unsort when not using the Document explorer.
…lt_sort.ts Co-authored-by: Matthias Wilhelm <[email protected]>
💛 Build succeeded, but was flakyTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
(cherry picked from commit ae68c1c)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…129788) (cherry picked from commit ae68c1c) Co-authored-by: Andrew Tate <[email protected]>
Summary
Fixes #121263
The time column is no longer assigned as the default sort when it is hidden via advanced settings.
Checklist