From 575e7af859c90b6682d105ab40b038fd58676d15 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 24 Aug 2021 09:13:39 -0300 Subject: [PATCH] fix: Show cross filter option only when cross filter is enabled (#16391) --- .../src/dashboard/components/SliceHeaderControls/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index ffa9b589e3..1b01980c7d 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -88,6 +88,7 @@ export interface SliceHeaderControlsProps { slice_name: string; slice_id: number; slice_description: string; + form_data?: { emit_filter?: boolean }; }; componentId: string; @@ -229,6 +230,7 @@ class SliceHeaderControls extends React.PureComponent< value.behaviors?.includes(Behavior.INTERACTIVE_CHART), ) .find(([key]) => key === slice.viz_type); + const canEmitCrossFilter = slice.form_data?.emit_filter; const cachedWhen = (cachedDttm || []).map(itemCachedDttm => moment.utc(itemCachedDttm).fromNow(), @@ -335,7 +337,8 @@ class SliceHeaderControls extends React.PureComponent< )} {isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) && - isCrossFilter && ( + isCrossFilter && + canEmitCrossFilter && ( {t('Cross-filter scoping')}