From d0aab05e79cd52812b5ae8dea8b26ce2f5a476ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=88=E1=B5=83=E1=B5=A2?= Date: Mon, 27 Jan 2020 11:28:24 -0800 Subject: [PATCH] =?UTF-8?q?[dashboard]=20fix,=20add=20config=20to=20option?= =?UTF-8?q?ally=20enable=20react=20replacement=20fo=E2=80=A6=20(#9025)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [dashboard] fix, add config to optionally enable react replacement for CRUD views * move app.config to function scope --- superset/config.py | 4 ++++ superset/views/dashboard/views.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index 6dd70987d5205..7bd9b92604238 100644 --- a/superset/config.py +++ b/superset/config.py @@ -699,6 +699,10 @@ class CeleryConfig: # pylint: disable=too-few-public-methods DOCUMENTATION_TEXT = "Documentation" DOCUMENTATION_ICON = None # Recommended size: 16x16 +# Enables the replacement react views for all the FAB views: list, edit, show. +# This is a work in progress so not all features available in FAB have been implemented +ENABLE_REACT_CRUD_VIEWS = False + # What is the Last N days relative in the time selector to: # 'today' means it is midnight (00:00:00) in the local timezone # 'now' means it is relative to the query issue time diff --git a/superset/views/dashboard/views.py b/superset/views/dashboard/views.py index 69c37e5e87979..78f6a75c94cba 100644 --- a/superset/views/dashboard/views.py +++ b/superset/views/dashboard/views.py @@ -25,7 +25,7 @@ from flask_babel import gettext as __, lazy_gettext as _ import superset.models.core as models -from superset import db, event_logger +from superset import app, db, event_logger from superset.constants import RouteMethod from superset.utils import core as utils @@ -57,6 +57,8 @@ class DashboardModelView( @has_access @expose("/list/") def list(self): + if not app.config["ENABLE_REACT_CRUD_VIEWS"]: + return super().list() payload = { "user": bootstrap_user_data(g.user), "common": common_bootstrap_payload(),