diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx index a48cea33e413..7226efdcb4b3 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx @@ -18,6 +18,7 @@ */ import React, { EventHandler, ChangeEvent, MouseEvent } from 'react'; import { t, SupersetTheme } from '@superset-ui/core'; +import SupersetText from 'src/utils/textUtils'; import Button from 'src/components/Button'; import { StyledInputContainer, wideButton } from './styles'; @@ -37,67 +38,76 @@ const SqlAlchemyTab = ({ conf: { SQLALCHEMY_DOCS_URL: string; SQLALCHEMY_DISPLAY_TEXT: string }; isEditMode?: boolean; testInProgress?: boolean; -}) => ( - <> - - - {t('Display Name')} - * - - - - - - {t('Pick a name to help you identify this database.')} - - - - - {t('SQLAlchemy URI')} - * - - - - - - {t('Refer to the')}{' '} - - {conf?.SQLALCHEMY_DISPLAY_TEXT ?? ''} - {' '} - {t('for more information on how to structure your URI.')} - - - wideButton(theme)} - > - {t('Test connection')} - - > -); - +}) => { + let fallbackDocsUrl; + let fallbackDisplayText; + if (SupersetText) { + fallbackDocsUrl = + SupersetText.DB_MODAL_SQLALCHEMY_FORM?.SQLALCHEMY_DOCS_URL; + fallbackDisplayText = + SupersetText.DB_MODAL_SQLALCHEMY_FORM?.SQLALCHEMY_DOCS_URL; + } + return ( + <> + + + {t('Display Name')} + * + + + + + + {t('Pick a name to help you identify this database.')} + + + + + {t('SQLAlchemy URI')} + * + + + + + + {t('Refer to the')}{' '} + + {fallbackDisplayText || conf?.SQLALCHEMY_DISPLAY_TEXT || ''} + {' '} + {t('for more information on how to structure your URI.')} + + + wideButton(theme)} + > + {t('Test connection')} + + > + ); +}; export default SqlAlchemyTab;