-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Maps] filter dashboard by map extent #99860
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
@@ -286,6 +286,11 @@ export function FilterItem(props: FilterItemProps) { | |||
message: '', | |||
status: FILTER_ITEM_OK, | |||
}; | |||
|
|||
if (filter.meta?.isMultiIndex) { |
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.
@Dosant @lizozom isMultiIndex flag was added to remove "Warning" label from the filter pill
The screen shot below was taken before these changes. Notice the "Warning" label. In this case, its not warranted since the filter is written to target any index pattern in the dashboard
This is a screen shot after the changes. Notice that the warning label is gone
@nreese I'm testing this (Chromium and Firefox browsers on Linux) and I don't get the filter updated when I move the map. I don't see any errors on the console either. Anything I can check or test to be sure I'm doing it right? |
It looks like you are doing everything correctly but there is something weird. Each time you got to the panel menu, the text says "filter by map extent". When filterByMapExtent is enabled, it should read "disable filter by map extent". So it looks like some state is not getting preserved in your instance. |
@jsanz You have to put the dashboard in edit mode to enable filter by map bounds. Not being in edit mode unsets the value after it was set. I will merge a fix to remove the option when not in edit mode |
@jsanz I have pushed a fix so you can not toggle filtering by extent while outside of dashboard edit mode. Mind pulling the latest and re-testing? |
Thanks, @nreese now it works as expected. It's a pity that this only works in dashboard edit mode, but nevertheless a very powerful feature. |
@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.
Thanks a lot, this is a great PR.
x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent_action.ts
Show resolved
Hide resolved
return { | ||
bool: { | ||
must: [ | ||
{ |
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.
so good!
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
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.
app services changes LGTM
reposting comment from above for visibility: nit: would it make sense to rename this to id to make it more general ? it seems it kind of needs to be unique anyway and controlledBy might not be the best name as possibly multiple filters are controlled by a single consumer (and they would all need different controlledBy id even if they are controlled by the same thing) |
* [Maps] filter dashboard by map extent * clean up * remove warning from filter pill * tslint * API doc updates, i18n fixes, tslint * only show context menu option in edit mode * add functional test * review feedback * do not use search session when filtering by map bounds Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* master: (60 commits) [Docs] Index patterns REST API docs (elastic#100549) [Ingest pipelines] add support for fingerprint processor (elastic#100541) ping Core team when renovate bot bumps es client version (elastic#100662) [Maps] Add draw wizard (elastic#100278) Use documentation link service for index pattern field editor (elastic#100609) [Maps] filter dashboard by map extent (elastic#99860) [ftr] migrate screenshots and snapshots services to FtrService class (elastic#100514) fix anomaly functional test (elastic#100504) update breaking changes template to incorporate ES deprecations (elastic#100621) improve default time ranges (elastic#100536) [Gauge] Fixes wrong translations on ranges less than symbol (elastic#100535) [ftr] migrate "globalNav" service to FtrService class (elastic#100604) [ftr] migrate "testSubjects" to FtrService class (elastic#100512) Fix spaces test flakyness (elastic#100605) [Ingest pipelines] add support for ip type in convert processor (elastic#100531) [ftr] migrate "browser" to FtrService class (elastic#100507) [ftr] migrate "find" service to FtrService class (elastic#100509) [telemetry] report config deprecations (elastic#99887) [ftr] migrate "docTable" service to FtrService class (elastic#100595) [ftr] migrate "listingTable" service to FtrService class (elastic#100606) ...
* [Maps] filter dashboard by map extent * clean up * remove warning from filter pill * tslint * API doc updates, i18n fixes, tslint * only show context menu option in edit mode * add functional test * review feedback * do not use search session when filtering by map bounds Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Fixes #59751
This PR adds a new context menu option for map embeddables.
When selected, a filter will be added to the dashboard that filters all panels by the map view area. When the map moves, this filter will be updated for the new map extent
cc @mbarretta