Skip to content

Commit

Permalink
fix: Show cross filter option only when cross filter is enabled (apac…
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent d17b1cd commit 972d9cd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface SliceHeaderControlsProps {
slice_name: string;
slice_id: number;
slice_description: string;
form_data?: { emit_filter?: boolean };
};

componentId: string;
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -335,7 +337,8 @@ class SliceHeaderControls extends React.PureComponent<
</Menu.Item>
)}
{isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) &&
isCrossFilter && (
isCrossFilter &&
canEmitCrossFilter && (
<Menu.Item key={MENU_KEYS.CROSS_FILTER_SCOPING}>
{t('Cross-filter scoping')}
</Menu.Item>
Expand Down

0 comments on commit 972d9cd

Please sign in to comment.