-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Maps] filter dashboard by map extent #99860
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
Changes from all commits
73c32df
8e3133a
52d6025
f6d1aa8
1ce2938
585a49a
a210fef
3002fa7
970d259
3bafeb5
409eb0b
fe8cbb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ApplyGlobalFilterActionContext](./kibana-plugin-plugins-data-public.applyglobalfilteractioncontext.md) > [controlledBy](./kibana-plugin-plugins-data-public.applyglobalfilteractioncontext.controlledby.md) | ||
|
|
||
| ## ApplyGlobalFilterActionContext.controlledBy property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| controlledBy?: string; | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,6 +286,11 @@ export function FilterItem(props: FilterItemProps) { | |
| message: '', | ||
| status: FILTER_ITEM_OK, | ||
| }; | ||
|
|
||
| if (filter.meta?.isMultiIndex) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| return label; | ||
| } | ||
|
|
||
| if (indexPatternExists === false) { | ||
| label.status = FILTER_ITEM_ERROR; | ||
| label.title = props.intl.formatMessage({ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,18 +349,49 @@ export function makeESBbox({ maxLat, maxLon, minLat, minLon }: MapExtent): ESBBo | |
| return esBbox; | ||
| } | ||
|
|
||
| export function createExtentFilter(mapExtent: MapExtent, geoFieldName: string): GeoFilter { | ||
| return { | ||
| geo_bounding_box: { | ||
| [geoFieldName]: makeESBbox(mapExtent), | ||
| }, | ||
| meta: { | ||
| alias: null, | ||
| disabled: false, | ||
| negate: false, | ||
| key: geoFieldName, | ||
| }, | ||
| }; | ||
| export function createExtentFilter(mapExtent: MapExtent, geoFieldNames: string[]): GeoFilter { | ||
| const esBbox = makeESBbox(mapExtent); | ||
| return geoFieldNames.length === 1 | ||
| ? { | ||
| geo_bounding_box: { | ||
| [geoFieldNames[0]]: esBbox, | ||
| }, | ||
| meta: { | ||
| alias: null, | ||
| disabled: false, | ||
| negate: false, | ||
| key: geoFieldNames[0], | ||
| }, | ||
| } | ||
| : { | ||
| query: { | ||
| bool: { | ||
| should: geoFieldNames.map((geoFieldName) => { | ||
| return { | ||
| bool: { | ||
| must: [ | ||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so good! |
||
| exists: { | ||
| field: geoFieldName, | ||
| }, | ||
| }, | ||
| { | ||
| geo_bounding_box: { | ||
| [geoFieldName]: esBbox, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
| }), | ||
| }, | ||
| }, | ||
| meta: { | ||
| alias: null, | ||
| disabled: false, | ||
| negate: false, | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| export function createSpatialFilterWithGeometry({ | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.