Skip to content

Commit

Permalink
[dashboard] fix, add config to optionally enable react replacement fo… (
Browse files Browse the repository at this point in the history
#9025)

* [dashboard] fix, add config to optionally enable react replacement for CRUD views

* move app.config to function scope
  • Loading branch information
nytai authored and craig-rueda committed Jan 27, 2020
1 parent a0cda32 commit d0aab05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion superset/views/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit d0aab05

Please sign in to comment.