From 789f99341b9840fe2ef1797d28c99ec4ed5fa9b8 Mon Sep 17 00:00:00 2001 From: smileydev <47900232+prosdev0107@users.noreply.github.com> Date: Tue, 28 Jun 2022 08:53:02 -0400 Subject: [PATCH] fix(db): Show the only db install guide when the db is already installed and error is existed while importing file. (#20442) * fix(db): make to show the db error msg when db installed and error is exist * fix(db): make to replace dbinstall str into showDbInstallInstructions (cherry picked from commit 23e62d3782e75f1ed6c7baf0d511b4464249dbf3) --- .../src/components/ImportModal/ErrorAlert.tsx | 40 +++++++++++-------- .../src/components/ImportModal/index.tsx | 7 +++- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx index 91ee6467f4f9a..52bd54a796188 100644 --- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx @@ -31,9 +31,13 @@ export const DOCUMENTATION_LINK = supersetTextDocs export interface IProps { errorMessage: string; + showDbInstallInstructions: boolean; } -const ErrorAlert: FunctionComponent = ({ errorMessage }) => ( +const ErrorAlert: FunctionComponent = ({ + errorMessage, + showDbInstallInstructions, +}) => ( antdWarningAlertStyles(theme)} @@ -41,21 +45,25 @@ const ErrorAlert: FunctionComponent = ({ errorMessage }) => ( showIcon message={errorMessage} description={ - <> -
- {t( - 'Database driver for importing maybe not installed. Visit the Superset documentation page for installation instructions:', - )} - - {t('here')} - - . - + showDbInstallInstructions ? ( + <> +
+ {t( + 'Database driver for importing maybe not installed. Visit the Superset documentation page for installation instructions:', + )} + + {t('here')} + + . + + ) : ( + '' + ) } /> ); diff --git a/superset-frontend/src/components/ImportModal/index.tsx b/superset-frontend/src/components/ImportModal/index.tsx index c13546f7d3bff..6a980f7d2013b 100644 --- a/superset-frontend/src/components/ImportModal/index.tsx +++ b/superset-frontend/src/components/ImportModal/index.tsx @@ -300,7 +300,12 @@ const ImportModelsModal: FunctionComponent = ({ - {errorMessage && } + {errorMessage && ( + 0} + /> + )} {renderPasswordFields()} {renderOverwriteConfirmation()}