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

hugh pushed a commit to branch hugh/so-1114
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit aee36d9e3dead587224ac821bdd345be5907e0dd
Author: hughhhh <hughmi...@gmail.com>
AuthorDate: Wed Oct 21 13:21:52 2020 -0700

    hide datasource legacy based on featureflag
---
 superset-frontend/src/datasource/DatasourceModal.tsx | 3 +++
 superset-frontend/src/featureFlags.ts                | 1 +
 superset/config.py                                   | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/datasource/DatasourceModal.tsx 
b/superset-frontend/src/datasource/DatasourceModal.tsx
index 678ef8a..023e6cd 100644
--- a/superset-frontend/src/datasource/DatasourceModal.tsx
+++ b/superset-frontend/src/datasource/DatasourceModal.tsx
@@ -22,6 +22,7 @@ import Button from 'src/components/Button';
 import Dialog from 'react-bootstrap-dialog';
 import { styled, t, SupersetClient } from '@superset-ui/core';
 import AsyncEsmComponent from 'src/components/AsyncEsmComponent';
+import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
 
 import getClientErrorObject from 'src/utils/getClientErrorObject';
 import withToasts from 'src/messageToasts/enhancers/withToasts';
@@ -184,6 +185,7 @@ const DatasourceModal: 
FunctionComponent<DatasourceModalProps> = ({
       </Modal.Body>
       <Modal.Footer>
         <span className="float-left">
+        { isFeatureEnabled(FeatureFlag.ENABLE_REACT_CRUD_VIEWS) &&
           <Button
             buttonSize="sm"
             buttonStyle="default"
@@ -192,6 +194,7 @@ const DatasourceModal: 
FunctionComponent<DatasourceModalProps> = ({
           >
             {t('Use Legacy Datasource Editor')}
           </Button>
+        }
         </span>
 
         <span className="float-right">
diff --git a/superset-frontend/src/featureFlags.ts 
b/superset-frontend/src/featureFlags.ts
index 46a3455..50c5bb6 100644
--- a/superset-frontend/src/featureFlags.ts
+++ b/superset-frontend/src/featureFlags.ts
@@ -28,6 +28,7 @@ export enum FeatureFlag {
   SQLLAB_BACKEND_PERSISTENCE = 'SQLLAB_BACKEND_PERSISTENCE',
   THUMBNAILS = 'THUMBNAILS',
   LISTVIEWS_DEFAULT_CARD_VIEW = 'LISTVIEWS_DEFAULT_CARD_VIEW',
+  ENABLE_REACT_CRUD_VIEWS = 'ENABLE_REACT_CRUD_VIEWS',
 }
 
 export type FeatureFlagMap = {
diff --git a/superset/config.py b/superset/config.py
index 30bd13f..41cbc30 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -313,6 +313,7 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
     "TAGGING_SYSTEM": False,
     "SQLLAB_BACKEND_PERSISTENCE": False,
     "LISTVIEWS_DEFAULT_CARD_VIEW": False,
+    "ENABLE_REACT_CRUD_VIEWS": True,
 }
 
 # Set the default view to card/grid view if thumbnail support is enabled.
@@ -846,7 +847,7 @@ DOCUMENTATION_ICON = None  # Recommended size: 16x16
 # Enables the replacement react views for all the FAB views (list, edit, show) 
with
 # designs introduced in SIP-34: 
https://github.com/apache/incubator-superset/issues/8976
 # This is a work in progress so not all features available in FAB have been 
implemented
-ENABLE_REACT_CRUD_VIEWS = True
+ENABLE_REACT_CRUD_VIEWS = DEFAULT_FEATURE_FLAGS["ENABLE_REACT_CRUD_VIEWS"]
 
 # What is the Last N days relative in the time selector to:
 # 'today' means it is midnight (00:00:00) in the local timezone

Reply via email to