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 946f21e693c2..93b4f3f0c305 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 194b60928d6d..57e5d021935d 100644 --- a/superset-frontend/src/views/CRUD/hooks.ts +++ b/superset-frontend/src/views/CRUD/hooks.ts @@ -604,6 +604,8 @@ 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,