From bb6c981167e477057cb5fc2fb239ec86f0e3bd18 Mon Sep 17 00:00:00 2001 From: Arash Date: Wed, 9 Jun 2021 17:39:41 -0400 Subject: [PATCH] revisions --- .../DatabaseModal/DatabaseConnectionForm.tsx | 9 ++----- .../database/DatabaseModal/ModalHeader.tsx | 26 +++++++++++++++++++ .../src/views/CRUD/data/database/types.ts | 1 + 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx index 1750c7ad90ff9..b7b217db4482c 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx @@ -23,7 +23,6 @@ import { Switch, Select, Button } from 'src/common/components'; import InfoTooltip from 'src/components/InfoTooltip'; import ValidatedInput from 'src/components/Form/LabeledErrorBoundInput'; import { DeleteFilled } from '@ant-design/icons'; -import { SelectValue } from 'src/filters/components/Select/types'; import { formScrollableStyles, validatedFormStyles, @@ -63,14 +62,10 @@ interface FieldPropTypes { db?: DatabaseObject; isEditMode?: boolean; sslForced?: boolean; - uploadOption?: string | null; - setUploadOption: (obj: any) => void; - fileToUpload?: string; - setFileToUpload: (obj: any) => void; } const CredentialsInfo = ({ changeMethods }: FieldPropTypes) => { - const [uploadOption, setUploadOption] = useState(0); + const [uploadOption, setUploadOption] = useState(0); const [fileToUpload, setFileToUpload] = useState( null, ); @@ -105,7 +100,7 @@ const CredentialsInfo = ({ changeMethods }: FieldPropTypes) => { {!fileToUpload && ( 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 a052a9248f551..ac8e2ad04d98a 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx @@ -30,6 +30,18 @@ import { DatabaseForm, DatabaseObject } from '../types'; export const DOCUMENTATION_LINK = 'https://superset.apache.org/docs/databases/installing-database-drivers'; +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 (!irregularDocumentationLinks[engine]) { + return `https://superset.apache.org/docs/databases/${engine}`; + } + return irregularDocumentationLinks[engine]; +}; const ModalHeader = ({ isLoading, isEditMode, @@ -69,6 +81,20 @@ const ModalHeader = ({ const hasConnectedDbHeader = (

Step 3 of 3

+

+ Your database was successfully connected! Here are some optional + settings for your database +

+

+ Need help? Learn more about{' '} + + connecting to {dbModel.name} + +

); const hasDbHeader = ( diff --git a/superset-frontend/src/views/CRUD/data/database/types.ts b/superset-frontend/src/views/CRUD/data/database/types.ts index f611dd76cea97..8c0264116da17 100644 --- a/superset-frontend/src/views/CRUD/data/database/types.ts +++ b/superset-frontend/src/views/CRUD/data/database/types.ts @@ -38,6 +38,7 @@ export type DatabaseObject = { username?: string; password?: string; encryption?: boolean; + query?: string; }; configuration_method: CONFIGURATION_METHOD; engine?: string;