fix(native-filters): fix filter scope error (#14426)

This commit is contained in:
Ville Brofeldt 2021-04-30 12:20:02 +03:00 committed by GitHub
parent 982a91ee62
commit 319125ec3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,11 +129,10 @@ export const findFilterScope = (
// looking for charts to be excluded: iterate over all charts
// and looking for charts that have one of their parents in `rootPath` and not in selected items
Object.entries(layout).forEach(([key, value]) => {
const parents = value.parents || [];
if (
value.type === CHART_TYPE &&
[DASHBOARD_ROOT_ID, ...value.parents]?.find(parent =>
isExcluded(parent, key),
)
[DASHBOARD_ROOT_ID, ...parents]?.find(parent => isExcluded(parent, key))
) {
excluded.push(value.meta.chartId);
}