mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
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
This commit is contained in:
@@ -31,9 +31,13 @@ export const DOCUMENTATION_LINK = supersetTextDocs
|
||||
|
||||
export interface IProps {
|
||||
errorMessage: string;
|
||||
showDbInstallInstructions: boolean;
|
||||
}
|
||||
|
||||
const ErrorAlert: FunctionComponent<IProps> = ({ errorMessage }) => (
|
||||
const ErrorAlert: FunctionComponent<IProps> = ({
|
||||
errorMessage,
|
||||
showDbInstallInstructions,
|
||||
}) => (
|
||||
<Alert
|
||||
closable={false}
|
||||
css={(theme: SupersetTheme) => antdWarningAlertStyles(theme)}
|
||||
@@ -41,21 +45,25 @@ const ErrorAlert: FunctionComponent<IProps> = ({ errorMessage }) => (
|
||||
showIcon
|
||||
message={errorMessage}
|
||||
description={
|
||||
<>
|
||||
<br />
|
||||
{t(
|
||||
'Database driver for importing maybe not installed. Visit the Superset documentation page for installation instructions:',
|
||||
)}
|
||||
<a
|
||||
href={DOCUMENTATION_LINK}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="additional-fields-alert-description"
|
||||
>
|
||||
{t('here')}
|
||||
</a>
|
||||
.
|
||||
</>
|
||||
showDbInstallInstructions ? (
|
||||
<>
|
||||
<br />
|
||||
{t(
|
||||
'Database driver for importing maybe not installed. Visit the Superset documentation page for installation instructions:',
|
||||
)}
|
||||
<a
|
||||
href={DOCUMENTATION_LINK}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="additional-fields-alert-description"
|
||||
>
|
||||
{t('here')}
|
||||
</a>
|
||||
.
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -300,7 +300,12 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
|
||||
<Button loading={importingModel}>Select file</Button>
|
||||
</Upload>
|
||||
</StyledInputContainer>
|
||||
{errorMessage && <ErrorAlert errorMessage={errorMessage} />}
|
||||
{errorMessage && (
|
||||
<ErrorAlert
|
||||
errorMessage={errorMessage}
|
||||
showDbInstallInstructions={passwordFields.length > 0}
|
||||
/>
|
||||
)}
|
||||
{renderPasswordFields()}
|
||||
{renderOverwriteConfirmation()}
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user