This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/embedded_chart_flag
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 7099371520c104eb64eb1deeea2a460e848e6831
Author: geido <[email protected]>
AuthorDate: Thu Jul 21 15:56:32 2022 +0300

    Add EMBEDDABLE_CHARTS feature flag
---
 .../packages/superset-ui-core/src/utils/featureFlags.ts              | 1 +
 .../src/explore/components/useExploreAdditionalActionsMenu/index.jsx | 5 +++--
 superset/config.py                                                   | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)

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 fb99445004..703a7fe5e3 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/useExploreAdditionalActionsMenu/index.jsx
 
b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
index e75e91bba7..ba23d9ef39 100644
--- 
a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
+++ 
b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
@@ -31,6 +31,7 @@ import copyTextToClipboard from 'src/utils/copy';
 import HeaderReportDropDown from 
'src/components/ReportModal/HeaderReportDropdown';
 import ViewQueryModal from '../controls/ViewQueryModal';
 import EmbedCodeContent from '../EmbedCodeContent';
+import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
 
 const MENU_KEYS = {
   EDIT_PROPERTIES: 'edit_properties',
@@ -297,7 +298,7 @@ export const useExploreAdditionalActionsMenu = (
           <Menu.Item key={MENU_KEYS.SHARE_BY_EMAIL}>
             {t('Share chart by email')}
           </Menu.Item>
-          <Menu.Item key={MENU_KEYS.EMBED_CODE}>
+          {isFeatureEnabled(FeatureFlag.EMBEDDABLE_CHARTS) ? <Menu.Item 
key={MENU_KEYS.EMBED_CODE}>
             <ModalTrigger
               triggerNode={
                 <span data-test="embed-code-button">{t('Embed code')}</span>
@@ -313,7 +314,7 @@ export const useExploreAdditionalActionsMenu = (
               destroyOnClose
               responsive
             />
-          </Menu.Item>
+          </Menu.Item> : null}
         </Menu.SubMenu>
         <Menu.Divider />
         {showReportSubMenu ? (
diff --git a/superset/config.py b/superset/config.py
index f30ce37f57..f61dda6a55 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -436,6 +436,8 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
     # Enable caching per impersonation key (e.g username) in a datasource 
where user
     # impersonation is enabled
     "CACHE_IMPERSONATION": False,
+    # Enable sharing charts with embedding
+    "EMBEDDABLE_CHARTS": True,
 }
 
 # Feature flags may also be set via 'SUPERSET_FEATURE_' prefixed environment 
vars.

Reply via email to