From 24f805ebc40c680d7c99e42c81d9b5b6fe475245 Mon Sep 17 00:00:00 2001 From: cccs-jc <56140112+cccs-jc@users.noreply.github.com> Date: Fri, 26 Mar 2021 18:27:36 -0400 Subject: [PATCH] feat: added support to configure the default explorer viz (#13610) * added support to configure the default explorer viz * code review fix * lint Co-authored-by: cccs-jc Co-authored-by: Ville Brofeldt --- superset-frontend/src/explore/store.js | 3 ++- superset/config.py | 3 +++ superset/views/base.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/store.js b/superset-frontend/src/explore/store.js index 9b33aaa49f6a..16ad2324c092 100644 --- a/superset-frontend/src/explore/store.js +++ b/superset-frontend/src/explore/store.js @@ -41,7 +41,8 @@ export function getControlsState(state, inputFormData) { * */ // Getting a list of active control names for the current viz const formData = { ...inputFormData }; - const vizType = formData.viz_type || 'table'; + const vizType = + formData.viz_type || state.common.conf.DEFAULT_VIZ_TYPE || 'table'; handleDeprecatedControls(formData); diff --git a/superset/config.py b/superset/config.py index 0faf811bfa65..0976e46c4efa 100644 --- a/superset/config.py +++ b/superset/config.py @@ -114,6 +114,9 @@ def _try_json_readsha( # pylint: disable=unused-argument VERSION_SHA_LENGTH = 8 VERSION_SHA = _try_json_readsha(VERSION_INFO_FILE, VERSION_SHA_LENGTH) +# default viz used in chart explorer +DEFAULT_VIZ_TYPE = "table" + ROW_LIMIT = 50000 VIZ_ROW_LIMIT = 10000 # max rows retreieved when requesting samples from datasource in explore view diff --git a/superset/views/base.py b/superset/views/base.py index ea80bb6098f7..b5d7138050ed 100644 --- a/superset/views/base.py +++ b/superset/views/base.py @@ -74,6 +74,7 @@ "DISABLE_DATASET_SOURCE_EDIT", "ENABLE_JAVASCRIPT_CONTROLS", "DEFAULT_SQLLAB_LIMIT", + "DEFAULT_VIZ_TYPE", "SQL_MAX_ROW", "SUPERSET_WEBSERVER_DOMAINS", "SQLLAB_SAVE_WARNING_MESSAGE",