Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import React from 'react';
import { getDatabaseDocumentationLinks } from 'src/views/CRUD/hooks';
import {
EditHeaderTitle,
EditHeaderSubtitle,
Expand All @@ -31,13 +32,21 @@ 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',
};

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}`;
}
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/views/CRUD/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down