-
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] Add control for global filters to the annotation layer menu #141615
Conversation
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
model.annotations, | ||
(a) => typeof a.index_pattern === 'object' && 'id' in a.index_pattern && a.index_pattern.id | ||
); | ||
const annotationsByIndexPatternAndIgnoreFlag = groupBy(model.annotations, (a) => { |
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.
😍👌🏼
Yes! I'm planning to create a filter-specific ignore icon tomorrow and get it added to EUI (along with a handful of other Lens icons). Stay tuned. I'll CC you on the EUI PR.
For now, my suggestion is that we keep it as you currently have it (with two distinct context menu actions) for the sake of aesthetics and simplicity, rather than using an |
@MichaelMarcialis if that's ok for you I would like to merge this PR and then update the icon as follow up task when ready. would that be ok? |
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.
I checked it before and it works fine. However, I think the big problem is what you mentioned in the description (user not knowing if the annotation group keeps or ignores global filters). If we decide to solve it later, let me know.
Please solve the conflicts and I'll recheck and approve :)
Testing log:
- Lens to TSVB:
- an annotation with ignoreGlobalFilters: true
- an annotation with ignoreGlobalFilters: false
- multi annotations with different settings that influence how the essags are grouped and ran:
- indexPattern, timeField, ignoreGlobalFilters
- Lens annotations creation:
- an annotation group with ignoreGlobalFilters: true
- an annotation group with ignoreGlobalFilters: false
- two annotations groups with the same dataView and same timeField but different ignoreGlobalFilters setting
- moving an annotation from the group with
ignoreGlobalFilters: true
toignoreGlobalFilters: false
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
Sounds good. I'll CC you when the icon is ready. |
…lastic#141615) * ✨ Add ignore global filters feature * ✅ Fix tests * 🔧 Remove unused translations * ♻️ Make it simpler * ✅ Fix test * 🔧 slighlty increase bundle limit size * 🔧 Forward layer flag to event config * ♻️ refactor actions code to include viz custom actions * 🐛 Flip the logic * 🔥 Remove unused file * ✨ Migrate ignore flag to annotation layers * ✅ Add unit test for default dataView
## Summary Adds the 8.6 for the following: - #140878, #143946 and #142187 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/tsvb.html#edit-visualizations-in-lens) - #142936, #142561, #143820, and #142838 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/add-aggregation-based-visualization-panels.html#edit-agg-based-visualizations-in-lens) - #138732 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#change-the-fields) - #141626 and #141615 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
## Summary Adds the 8.6 for the following: - elastic#140878, elastic#143946 and elastic#142187 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/tsvb.html#edit-visualizations-in-lens) - elastic#142936, elastic#142561, elastic#143820, and elastic#142838 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/add-aggregation-based-visualization-panels.html#edit-agg-based-visualizations-in-lens) - elastic#138732 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#change-the-fields) - elastic#141626 and elastic#141615 [Doc preview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> (cherry picked from commit f918a37)
# Backport This will backport the following commits from `main` to `8.6`: - [Adds the VisEditor docs for 8.6 (#146471)](#146471) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kaarina Tungseth","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-08T20:18:03Z","message":"Adds the VisEditor docs for 8.6 (#146471)\n\n## Summary\r\n\r\nAdds the 8.6 for the following:\r\n\r\n- #140878, #143946 and #142187\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/tsvb.html#edit-visualizations-in-lens)\r\n\r\n- #142936, #142561, #143820, and #142838\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/add-aggregation-based-visualization-panels.html#edit-agg-based-visualizations-in-lens)\r\n\r\n- #138732\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#change-the-fields)\r\n\r\n- #141626 and #141615\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations)\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"f918a3745be3badff9cf05950db61d7f47877961","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v8.6.0","v8.7.0"],"number":146471,"url":"https://github.com/elastic/kibana/pull/146471","mergeCommit":{"message":"Adds the VisEditor docs for 8.6 (#146471)\n\n## Summary\r\n\r\nAdds the 8.6 for the following:\r\n\r\n- #140878, #143946 and #142187\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/tsvb.html#edit-visualizations-in-lens)\r\n\r\n- #142936, #142561, #143820, and #142838\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/add-aggregation-based-visualization-panels.html#edit-agg-based-visualizations-in-lens)\r\n\r\n- #138732\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#change-the-fields)\r\n\r\n- #141626 and #141615\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations)\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"f918a3745be3badff9cf05950db61d7f47877961"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146471","number":146471,"mergeCommit":{"message":"Adds the VisEditor docs for 8.6 (#146471)\n\n## Summary\r\n\r\nAdds the 8.6 for the following:\r\n\r\n- #140878, #143946 and #142187\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/tsvb.html#edit-visualizations-in-lens)\r\n\r\n- #142936, #142561, #143820, and #142838\r\n\r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/add-aggregation-based-visualization-panels.html#edit-agg-based-visualizations-in-lens)\r\n\r\n- #138732\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#change-the-fields)\r\n\r\n- #141626 and #141615\r\n \r\n[Doc\r\npreview](https://kibana_146471.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations)\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"f918a3745be3badff9cf05950db61d7f47877961"}}]}] BACKPORT--> Co-authored-by: Kaarina Tungseth <[email protected]>
Summary
Closes #140204
This PR refactors the layer actions menu code and provide a way to each visualization to list custom actions when needed.
The first custom action to ship is the
Ignore global filters
in the annotation layer.I've used the same visibility icon for the action, and modelled the UI as two distinct actions (
Ignore
vsKeep
).TSVB to Lens
The TSVB to Lens has been updated to create layers based on
dataView
used AND theignoreGlobalFilters
flag.Bug fixes
A fix has been introduced for the scenario where the user didn't specify a dataView, as in TSVB this has a fallback to the default one. The fallback wasn't picked up by the conversion code originally, but now it is (added test for this).
Discussion points
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