You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2022/02/02 00:28:20 UTC

[superset] 02/02: save this

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

hugh pushed a commit to branch fiximport-chart
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 79676633ae0e99fc79ea3eb8bec9ad6258c92ace
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Feb 1 16:26:05 2022 -0800

    save this
---
 .../FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts
index f9b94a3..9a5dcfe 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts
@@ -30,7 +30,7 @@ import { buildTree } from './utils';
 
 // eslint-disable-next-line import/prefer-default-export
 export function useFilterScopeTree(
-  currentChartId?: number,
+  currentChartId?: number | string,
   initiallyExcludedCharts: number[] = [],
   buildTreeLeafTitle: BuildTreeLeafTitle = label => label,
 ): {
@@ -50,11 +50,15 @@ export function useFilterScopeTree(
   };
 
   // We need to get only nodes that have charts as children or grandchildren
+  console.log(currentChartId);
+  console.log('inside use filter scope tree');
   const validNodes = useMemo(
     () =>
       Object.values(layout).reduce<string[]>((acc, cur) => {
         const { id, parents = [], type, meta } = cur;
-        if (type === CHART_TYPE && currentChartId !== meta?.chartId) {
+        console.log(id);
+        if (type === CHART_TYPE && currentChartId !== id) {
+          // change this to just id
           return [...new Set([...acc, ...parents, id])];
         }
         return acc;