Skip to content

Commit

Permalink
Remove ?. operator from scope
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Mar 4, 2022
1 parent 4482b01 commit 493ea96
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -68,11 +73,13 @@ const DashboardContainer: FC<DashboardContainerProps> = ({ 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) ||
Expand All @@ -91,9 +98,8 @@ const DashboardContainer: FC<DashboardContainerProps> = ({ 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(
Expand Down

0 comments on commit 493ea96

Please sign in to comment.