From 493ea96815e11fdc4537798ce320525fc8e263fa Mon Sep 17 00:00:00 2001 From: Kamil Gabryjelski Date: Fri, 4 Mar 2022 11:52:39 +0100 Subject: [PATCH] Remove ?. operator from scope --- .../DashboardBuilder/DashboardContainer.tsx | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx index 718839d76a04c..50e53b9c7fc79 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx @@ -20,7 +20,12 @@ // when its container size changes, due to e.g., builder side panel opening import React, { FC, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { FeatureFlag, Filters, isFeatureEnabled } from '@superset-ui/core'; +import { + FeatureFlag, + Filter, + Filters, + isFeatureEnabled, +} from '@superset-ui/core'; import { ParentSize } from '@vx/responsive'; import Tabs from 'src/components/Tabs'; import DashboardGrid from 'src/dashboard/containers/DashboardGrid'; @@ -68,11 +73,13 @@ const DashboardContainer: FC = ({ topLevelTabs }) => { }, [getLeafComponentIdFromPath(directPathToChild)]); // recalculate charts and tabs in scopes of native filters only when a scope or dashboard layout changes - const filterScopes = Object.values(nativeFilters ?? {}).map(filter => ({ - id: filter.id, - scope: filter.scope, - type: filter.type, - })); + const filterScopes = Object.values(nativeFilters ?? {}).map( + (filter: Filter) => ({ + id: filter.id, + scope: filter.scope, + type: filter.type, + }), + ); useEffect(() => { if ( !isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) || @@ -91,9 +98,8 @@ const DashboardContainer: FC = ({ topLevelTabs }) => { const { scope } = filterScope; const chartsInScope: number[] = getChartIdsInFilterScope({ filterScope: { - scope: scope?.rootPath, - // @ts-ignore - immune: scope?.excluded, + scope: scope.rootPath, + immune: scope.excluded, }, }); const tabsInScope = findTabsWithChartsInScope(