You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/08/24 16:21:29 UTC

[superset] 04/04: fix: Cross filters initial scope (#25074)

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

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

commit e4affbfc950997db8ff36ea8cf569db0c27eed1e
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Thu Aug 24 13:01:45 2023 -0300

    fix: Cross filters initial scope (#25074)
    
    (cherry picked from commit f584c8462b6d72f902a59e5f72a0f4603de4da1a)
---
 superset-frontend/src/dashboard/constants.ts         | 4 ++--
 superset-frontend/src/dashboard/util/crossFilters.ts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/src/dashboard/constants.ts b/superset-frontend/src/dashboard/constants.ts
index ecc893bcb7..d4e5fed4b6 100644
--- a/superset-frontend/src/dashboard/constants.ts
+++ b/superset-frontend/src/dashboard/constants.ts
@@ -1,4 +1,4 @@
-import { DatasourceType } from '@superset-ui/core';
+import { DatasourceType, NativeFilterScope } from '@superset-ui/core';
 import { Datasource } from 'src/dashboard/types';
 import { DASHBOARD_ROOT_ID } from './util/constants';
 /**
@@ -44,7 +44,7 @@ export const FILTER_BAR_TABS_HEIGHT = 46;
 export const BUILDER_SIDEPANEL_WIDTH = 374;
 export const OVERWRITE_INSPECT_FIELDS = ['css', 'json_metadata.filter_scopes'];
 
-export const DEFAULT_CROSS_FILTER_SCOPING = {
+export const DEFAULT_CROSS_FILTER_SCOPING: NativeFilterScope = {
   rootPath: [DASHBOARD_ROOT_ID],
   excluded: [],
 };
diff --git a/superset-frontend/src/dashboard/util/crossFilters.ts b/superset-frontend/src/dashboard/util/crossFilters.ts
index 425c725989..8e1a706286 100644
--- a/superset-frontend/src/dashboard/util/crossFilters.ts
+++ b/superset-frontend/src/dashboard/util/crossFilters.ts
@@ -52,7 +52,7 @@ export const getCrossFiltersConfiguration = (
     return undefined;
   }
 
-  const globalChartConfiguration = metadata.global_chart_configuration
+  const globalChartConfiguration = metadata.global_chart_configuration?.scope
     ? {
         scope: metadata.global_chart_configuration.scope,
         chartsInScope: getChartIdsInFilterScope(