You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/02/15 20:04:42 UTC
[superset] 01/01: this
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch hugh/sqlalchemy-docs
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 42b33cefe0eb20dac1eecc57ee337a1fb25681f6
Author: hughhhh <hu...@gmail.com>
AuthorDate: Mon Feb 15 15:03:33 2021 -0500
this
---
superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx | 7 ++++++-
superset/config.py | 3 +++
superset/views/base.py | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
index 081fb35..ead3cb7 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
@@ -333,6 +333,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
setTabKey(key);
};
+ const appContainer = document.getElementById('app');
+ const bootstrapData = JSON.parse(
+ appContainer?.getAttribute('data-bootstrap') || '',
+ );
+
return (
<Modal
name="database"
@@ -402,7 +407,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
<div className="helper">
{t('Refer to the ')}
<a
- href="https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#"
+ href={bootstrapData.common.conf.SQLALCHEMY_DOCS_URL}
target="_blank"
rel="noopener noreferrer"
>
diff --git a/superset/config.py b/superset/config.py
index 2686f45..7717a79 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -1092,6 +1092,9 @@ GLOBAL_ASYNC_QUERIES_POLLING_DELAY = 500
# It will get executed each time when user open a chart's explore view.
DATASET_HEALTH_CHECK = None
+# SQLAlchema link doc reference
+SQLALCHEMY_DOCS_URL = "https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#"
+
# -------------------------------------------------------------------
# * WARNING: STOP EDITING HERE *
# -------------------------------------------------------------------
diff --git a/superset/views/base.py b/superset/views/base.py
index 69c9383..e71bb20 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -80,6 +80,7 @@ FRONTEND_CONF_KEYS = (
"DISPLAY_MAX_ROW",
"GLOBAL_ASYNC_QUERIES_TRANSPORT",
"GLOBAL_ASYNC_QUERIES_POLLING_DELAY",
+ "SQLALCHEMY_DOCS_URL",
)
logger = logging.getLogger(__name__)