mirror of https://github.com/grafana/grafana.git
Geomap: Only filter if there is a match (#110996)
This commit is contained in:
parent
98779838ab
commit
d0d55b3c68
|
@ -101,7 +101,9 @@ export function getLayerEditor(opts: LayerEditorOptions): NestedPanelOptions<Map
|
|||
// If `filterData` exists filter data feeding into location editor
|
||||
if (options.filterData) {
|
||||
const matcherFunc = getFrameMatchers(options.filterData);
|
||||
data = data.filter(matcherFunc);
|
||||
if (data.some(matcherFunc)) {
|
||||
data = data.filter(matcherFunc);
|
||||
}
|
||||
}
|
||||
|
||||
addLocationFields('Location', 'location.', builder, options.location, data);
|
||||
|
|
|
@ -26,10 +26,12 @@ export const applyLayerFilter = (
|
|||
let panelData = panelDataProps;
|
||||
if (options.filterData) {
|
||||
const matcherFunc = getFrameMatchers(options.filterData);
|
||||
panelData = {
|
||||
...panelData,
|
||||
series: panelData.series.filter(matcherFunc),
|
||||
};
|
||||
if (panelData.series.some(matcherFunc)) {
|
||||
panelData = {
|
||||
...panelData,
|
||||
series: panelData.series.filter(matcherFunc),
|
||||
};
|
||||
}
|
||||
}
|
||||
handler.update(panelData);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue