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/06/28 21:44:31 UTC

[superset] branch hugh/documentation-ref created (now 665eca2)

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

hugh pushed a change to branch hugh/documentation-ref
in repository https://gitbox.apache.org/repos/asf/superset.git.


      at 665eca2  allow users to override docs

This branch includes the following new commits:

     new 665eca2  allow users to override docs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[superset] 01/01: allow users to override docs

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 665eca207ab21cbbf16cc6d186af22be4d807479
Author: hughhhh <hu...@gmail.com>
AuthorDate: Mon Jun 28 14:38:43 2021 -0700

    allow users to override docs
---
 .../src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx   | 9 +++++++++
 superset-frontend/src/views/CRUD/hooks.ts                        | 1 +
 2 files changed, 10 insertions(+)

diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx
index 946f21e..93b4f3f 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx
@@ -18,6 +18,7 @@
  */
 
 import React from 'react';
+import { getDatabaseDocumentationLinks } from 'src/views/CRUD/hooks';
 import {
   EditHeaderTitle,
   EditHeaderSubtitle,
@@ -31,6 +32,8 @@ import { DatabaseForm, DatabaseObject } from '../types';
 export const DOCUMENTATION_LINK =
   'https://superset.apache.org/docs/databases/installing-database-drivers';
 
+const supersetTextDocs = getDatabaseDocumentationLinks();
+
 const irregularDocumentationLinks = {
   postgresql: 'https://superset.apache.org/docs/databases/postgres',
   mssql: 'https://superset.apache.org/docs/databases/sql-server',
@@ -38,6 +41,12 @@ const irregularDocumentationLinks = {
 
 const documentationLink = (engine: string | undefined) => {
   if (!engine) return null;
+
+  if (supersetTextDocs) {
+    // override doc link for superset_txt yml
+    return supersetTextDocs[engine] || supersetTextDocs.default;
+  }
+
   if (!irregularDocumentationLinks[engine]) {
     return `https://superset.apache.org/docs/databases/${engine}`;
   }
diff --git a/superset-frontend/src/views/CRUD/hooks.ts b/superset-frontend/src/views/CRUD/hooks.ts
index 194b609..32a1320 100644
--- a/superset-frontend/src/views/CRUD/hooks.ts
+++ b/superset-frontend/src/views/CRUD/hooks.ts
@@ -604,6 +604,7 @@ export const copyQueryLink = (
 export const getDatabaseImages = () => SupersetText.DB_IMAGES;
 
 export const getConnectionAlert = () => SupersetText.DB_CONNECTION_ALERTS;
+export const getDatabaseDocumentationLinks = () => SupersetText.DB_CONNECTION_DOC_LINKS
 
 export const testDatabaseConnection = (
   connection: DatabaseObject,