diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index fb9944500..703a7fe5e 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -56,6 +56,7 @@ export enum FeatureFlag { GENERIC_CHART_AXES = 'GENERIC_CHART_AXES', USE_ANALAGOUS_COLORS = 'USE_ANALAGOUS_COLORS', DASHBOARD_EDIT_CHART_IN_NEW_TAB = 'DASHBOARD_EDIT_CHART_IN_NEW_TAB', + EMBEDDABLE_CHARTS = 'EMBEDDABLE_CHARTS', } export type ScheduleQueriesProps = { JSONSCHEMA: { diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx index 1664afbb0..2f55db612 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx @@ -25,12 +25,17 @@ import fetchMock from 'fetch-mock'; import * as chartAction from 'src/components/Chart/chartAction'; import * as downloadAsImage from 'src/utils/downloadAsImage'; import * as exploreUtils from 'src/explore/exploreUtils'; +import { FeatureFlag } from '@superset-ui/core'; import ExploreHeader from '.'; const chartEndpoint = 'glob:*api/v1/chart/*'; fetchMock.get(chartEndpoint, { json: 'foo' }); +window.featureFlags = { + [FeatureFlag.EMBEDDABLE_CHARTS]: true, +}; + const createProps = () => ({ chart: { id: 1, diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx index e75e91bba..66878b6a8 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx @@ -29,6 +29,7 @@ import downloadAsImage from 'src/utils/downloadAsImage'; import { getChartPermalink } from 'src/utils/urlUtils'; import copyTextToClipboard from 'src/utils/copy'; import HeaderReportDropDown from 'src/components/ReportModal/HeaderReportDropdown'; +import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import ViewQueryModal from '../controls/ViewQueryModal'; import EmbedCodeContent from '../EmbedCodeContent'; @@ -297,23 +298,25 @@ export const useExploreAdditionalActionsMenu = (