-
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
[Lens] Query based annotations #138753
[Lens] Query based annotations #138753
Conversation
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.
Tested and reviewed (and of course, I put some lines here so hopefully we'll get some other pairs of eyes on it )
showTimeSelect | ||
selected={value} | ||
onChange={onChange} | ||
dateFormat="MMM D, YYYY @ HH:mm:ss.SSS" |
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.
It would be nice to use the dateFormat
advanced setting here instead of hardcoding a format
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.
Opened a follow-up issue for that
This works really well! The only two things we should still fix on this PR before merging is the migration issue (Marco already working on it) and the "missing data view" issue. @dej611 could you ping me once that works? |
Both issues have been resolves with the same fix, which fallbacks to the first dataView id found in references if none is available for the annotation layer. |
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.
LGTM - no further bugs found
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: |
* ⚗️ Initial code for query based annotations * 🐛 Solved more conflicts * ⚗️ More scaffolding layout * ⚗️ Initial indexpatetrn move into frame * ⚗️ Make field selection work * 🚧 Fixed almost all dataViews occurrencies, but changeIndexPattern * 🚧 More work on change index pattern * Move lens dataViews state into main state * 🔥 Remove some old cruft from the code * 🐛 Fix dataViews layer change * 🐛 Fix datasourceLayers refs * 🔥 Remove more old cruft * 🐛 Fix bug when loading SO * 🐛 Fix initial existence flag * 🏷️ Fix type issues * 🏷️ Fix types and tests * 🏷️ Fix types issues * ✅ Fix more tests * ✅ Fix with new dataViews structure * ✅ Fix more test mocks * ✅ More tests fixed * 🔥 Removed unused prop * ✅ Down to single broken test suite * 🏷️ Fix type issue * 👌 Integrate selector feedback * ✅ Fix remaining unit tests * 🏷️ fix type issues * 🐛 Fix bug when creating dataview in place * ✨ Update with latest dataview state + fix dataviews picker for annotations * 🐛 Fix edit + remove field flow * Update x-pack/plugins/lens/public/visualizations/xy/types.ts * 📸 Fix snapshot * 🐛 Fix the dataViews switch bug * 🔥 remove old cruft * ♻️ Revert removal from dataviews state branch * ♻️ Load all at once * 🔧 working on persistent state + fix new layer bug * 🔥 remove unused stuff * 🏷️ Fix some typings * 🔧 Fix expression issue * ✅ Add service unit tests * 👌 Integrated feedback * ✨ Add migration code for manual annotations * 🏷️ Fix type issue * ✅ Add some other unit test * 🏷️ Fix more type issues * 🐛 Fix importing issue * ♻️ Make range default color dependant on opint one * 🐛 Fix duplicate fields selection in tooltip section * ✅ Add more unit tests * ✅ Fix broken test * 🏷️ Mute ts error for now * ✅ Fix tests * 🔥 Reduce plugin weight * 🐛 prevent layout shift on panel open * 🐛 Fix extract + inject visualization references * 🏷️ fix type issues * ✨ Add dataview reference migration for annotations * 🔧 Add migration to embedadble * 🏷️ Fix type export * 🐛 Fix more conflicts with main * ✅ Fix tests * 🏷️ Make textField optional * ♻️ Refactor query input to be a shared component * 🐛 Fix missing import * 🐛 fix more import issues * 🔥 remove duplicate code * 🐛 Fix dataView switch bug * 🏷️ Fix type issue * annotations with fetching_event_annotations * portal for kql input fix * timeField goes for default if not filled * limit changes * handle ad-hoc data view references correctly * fix types * adjust tests to datatable format (remove isHidden tests as it's filtered before) * small refactors * fix loading on dashboard * empty is invalid (?) tbd * new tooltip * emptyDatatable * ♻️ Flip field + query inputs * 🏷️ Fix type issue * ✨ Add field validation for text and tooltip fields * tooltip for single annotation * fix tests * fix for non--timefilter dataview * fix annotations test - the cause was that we now don't display label for aggregated annotations ever * use eui elements * newline problem solved * ✅ Add more error tests * 👌 Rename migration state version type * fix types for expression chart * 🐛 Fix i18n id * 🏷️ Fix type issue * fix hidden all annotations * ✅ Fix tests after ishidden removal * 🐛 Revert references migration to an in app solution Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
Summary
This PR contains:
Query based annotations in the chart
Config panel
The Layer UI has changed to contain the dataView picker:
Opening an annotation event will present a button group to switch to the Query based type:
Once selected some additional features will be enabled in the panel to query/enrich the annotation/visualization:
On dataview switch all fields selected are validated against the new dataview and errors are shown to the user in the main workspace:
The query annotations are not fetched yet as it requires some more work to collect all the annotations expressions in a single go rather than per layer.
Tasks
Text decoration
sectionTooltip
sectionquery_annotation
expressionextraction
handleinjection
handleAdd functional tests(will do as follow up with final feature)Open in Lensfrom TSVB (will do as follow up)Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers