From 63eebfd5dc855a9975b75b1bfbbea91db7599e42 Mon Sep 17 00:00:00 2001 From: Taylor Date: Mon, 20 Jun 2022 15:41:26 -0400 Subject: [PATCH 1/2] fix(db): make to show the db error msg when db installed and error is exist --- .../src/components/ImportModal/ErrorAlert.tsx | 37 +++++++++++-------- .../src/components/ImportModal/index.tsx | 7 +++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx index 91ee6467f4f9a..5ff674e2710b7 100644 --- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx @@ -31,9 +31,10 @@ export const DOCUMENTATION_LINK = supersetTextDocs export interface IProps { errorMessage: string; + dbInstall: boolean; } -const ErrorAlert: FunctionComponent = ({ errorMessage }) => ( +const ErrorAlert: FunctionComponent = ({ errorMessage, dbInstall }) => ( antdWarningAlertStyles(theme)} @@ -41,21 +42,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')} - - . - + dbInstall ? ( + <> +
+ {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..e7bb929ebcc40 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()} From fd812715511c00fd0d73deb714704dff9a8ae444 Mon Sep 17 00:00:00 2001 From: Taylor Date: Wed, 22 Jun 2022 12:09:34 -0400 Subject: [PATCH 2/2] fix(db): make to replace dbinstall str into showDbInstallInstructions --- .../src/components/ImportModal/ErrorAlert.tsx | 9 ++++++--- superset-frontend/src/components/ImportModal/index.tsx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx index 5ff674e2710b7..52bd54a796188 100644 --- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx @@ -31,10 +31,13 @@ export const DOCUMENTATION_LINK = supersetTextDocs export interface IProps { errorMessage: string; - dbInstall: boolean; + showDbInstallInstructions: boolean; } -const ErrorAlert: FunctionComponent = ({ errorMessage, dbInstall }) => ( +const ErrorAlert: FunctionComponent = ({ + errorMessage, + showDbInstallInstructions, +}) => ( antdWarningAlertStyles(theme)} @@ -42,7 +45,7 @@ const ErrorAlert: FunctionComponent = ({ errorMessage, dbInstall }) => ( showIcon message={errorMessage} description={ - dbInstall ? ( + showDbInstallInstructions ? ( <>
{t( diff --git a/superset-frontend/src/components/ImportModal/index.tsx b/superset-frontend/src/components/ImportModal/index.tsx index e7bb929ebcc40..6a980f7d2013b 100644 --- a/superset-frontend/src/components/ImportModal/index.tsx +++ b/superset-frontend/src/components/ImportModal/index.tsx @@ -303,7 +303,7 @@ const ImportModelsModal: FunctionComponent = ({ {errorMessage && ( 0} + showDbInstallInstructions={passwordFields.length > 0} /> )} {renderPasswordFields()}