Skip to content

Commit 4ba0ea0

Browse files
Refactor crossFilters logic for chartsInScope
1 parent 24d3bf4 commit 4ba0ea0

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

superset-frontend/src/dashboard/util/crossFilters.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,17 @@ export const getCrossFiltersConfiguration = (
9898
},
9999
};
100100
}
101-
const scope = chartConfiguration[chartId].crossFilters.scope;
102-
103-
const effectiveScope: NativeFilterScope = isCrossFilterScopeGlobal(scope)
104-
? globalChartConfiguration.scope
105-
: scope;
106-
107-
chartConfiguration[chartId].crossFilters.chartsInScope =
108-
getChartIdsInFilterScope(
109-
effectiveScope,
110-
Object.values(charts).map(chart => chart.id),
111-
chartLayoutItems,
112-
).filter(id => id !== Number(chartId));
101+
chartConfiguration[chartId].crossFilters.chartsInScope =
102+
isCrossFilterScopeGlobal(chartConfiguration[chartId].crossFilters.scope)
103+
? globalChartConfiguration.chartsInScope.filter(
104+
id => id !== Number(chartId),
105+
)
106+
: getChartIdsInFilterScope(
107+
chartConfiguration[chartId].crossFilters
108+
.scope as NativeFilterScope,
109+
Object.values(charts).map(chart => chart.id),
110+
chartLayoutItems,
111+
).filter(id => id !== Number(chartId));
113112
}
114113
});
115114

0 commit comments

Comments
 (0)