You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by am...@apache.org on 2021/05/02 06:26:02 UTC

[superset] branch 1.2 updated: fix(native-filters): fix filter scope error (#14426)

This is an automated email from the ASF dual-hosted git repository.

amitmiran pushed a commit to branch 1.2
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/1.2 by this push:
     new 1a41c58  fix(native-filters): fix filter scope error (#14426)
1a41c58 is described below

commit 1a41c5875f118423fb3aa42b0f394c4bdc12819c
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Fri Apr 30 12:20:02 2021 +0300

    fix(native-filters): fix filter scope error (#14426)
    
    (cherry picked from commit 319125ec3b292a9e92666e059580b8ddd952c832)
---
 .../FiltersConfigModal/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 e6936e4..8c74aa7 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);
     }