From 33a73906144a224bce9950659016efa0e3e3a42c Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Tue, 10 Jan 2023 18:04:16 +0200 Subject: [PATCH] minor refactor --- superset-frontend/src/addSlice/AddSliceContainer.tsx | 2 +- superset-frontend/src/constants.ts | 4 +--- .../src/explore/components/controls/VizTypeControl/index.tsx | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/addSlice/AddSliceContainer.tsx b/superset-frontend/src/addSlice/AddSliceContainer.tsx index 795acd7ac33e8..c50bcad9a2a53 100644 --- a/superset-frontend/src/addSlice/AddSliceContainer.tsx +++ b/superset-frontend/src/addSlice/AddSliceContainer.tsx @@ -64,7 +64,7 @@ const ESTIMATED_NAV_HEIGHT = 56; const ELEMENTS_EXCEPT_VIZ_GALLERY = ESTIMATED_NAV_HEIGHT + 250; const bootstrapData = getBootstrapData(); -const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST; +const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || []; const StyledContainer = styled.div` ${({ theme }) => ` diff --git a/superset-frontend/src/constants.ts b/superset-frontend/src/constants.ts index d46d681bf406b..dcef70da7e8a5 100644 --- a/superset-frontend/src/constants.ts +++ b/superset-frontend/src/constants.ts @@ -146,9 +146,7 @@ export const NULL_DISPLAY = 'N/A'; export const DEFAULT_COMMON_BOOTSTRAP_DATA: CommonBootstrapData = { flash_messages: [], - conf: { - VIZ_TYPE_DENYLIST: [], - }, + conf: {}, locale: 'en', feature_flags: {}, language_pack: { diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx index 6f827bee7f095..802c04f8a995d 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx @@ -43,7 +43,7 @@ interface VizTypeControlProps { } const bootstrapData = getBootstrapData(); -const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST; +const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || []; const metadataRegistry = getChartMetadataRegistry(); export const VIZ_TYPE_CONTROL_TEST_ID = 'viz-type-control';