-
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 context view for date_nanos format with custom timestamps #54089
[Discover] Fix context view for date_nanos format with custom timestamps #54089
Conversation
1937102
to
fc0f2f2
Compare
…-20-context-custom-timestamp-fix
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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 change looks good to me and I tested the functionality in Chrome. Had one question about the tests that were changed.
src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/get_sort.js
Outdated
Show resolved
Hide resolved
…-20-context-custom-timestamp-fix
…ithub.com:kertal/kibana into kertal-pr-2019-12-20-context-custom-timestamp-fix
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-app (Team:KibanaApp) |
…mps (elastic#54089) * Switch from _source to fields when fetching anchor records with date_nanos timestamps * Add testdata * Add functional test
…mps (elastic#54089) * Switch from _source to fields when fetching anchor records with date_nanos timestamps * Add testdata * Add functional test
…mps (elastic#54089) * Switch from _source to fields when fetching anchor records with date_nanos timestamps * Add testdata * Add functional test
* Discover: Add handling for source column (#91815) * enable by default * [Discover] Fix context view for date_nanos format with custom timestamps (#54089) * Switch from _source to fields when fetching anchor records with date_nanos timestamps * Add testdata * Add functional test * fix search_after Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Summary
Discover's context view currently doesn't work when you're using a custom formatted
date_nanos
timestamp like this:{ "type" : "date_nanos", "format" : "yyyy-MM-dd HH:mm:ss.SSSSSS" }
.We're currently using the timestamp stored in
_source
to provide the context functionality withdate_nanos
timestamps, which is due to the limited support of BigInt support of Browsers. If the _source value is formatted in a non standard way, the conversion to a Date Object may fail. This fix switches from the value stored in _source to the value provided byfields
of the search result.This contains a
strict_date_time
formatted string, so there are no more problems with custom timestamp formatsFixes #48064
Testing
You can use the following data to test the fix:
Before the fix:
After the fix:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately