From 319125ec3b292a9e92666e059580b8ddd952c832 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Fri, 30 Apr 2021 12:20:02 +0300 Subject: [PATCH] fix(native-filters): fix filter scope error (#14426) --- .../FiltersConfigForm/FilterScope/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts index e6936e46b60b3..8c74aa7511c16 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts @@ -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); }