mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
fix: SSH Tunnel creation with dynamic form (#24196)
This commit is contained in:
@@ -763,15 +763,18 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
});
|
||||
}
|
||||
|
||||
// make sure that button spinner animates
|
||||
setLoading(true);
|
||||
const errors = await getValidation(dbToUpdate, true);
|
||||
if ((validationErrors && !isEmpty(validationErrors)) || errors) {
|
||||
// only do validation for non ssh tunnel connections
|
||||
if (!dbToUpdate?.ssh_tunnel) {
|
||||
// make sure that button spinner animates
|
||||
setLoading(true);
|
||||
const errors = await getValidation(dbToUpdate, true);
|
||||
if ((validationErrors && !isEmpty(validationErrors)) || errors) {
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
// end spinner animation
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
setLoading(false);
|
||||
// end spinner animation
|
||||
|
||||
const parameters_schema = isEditMode
|
||||
? dbToUpdate.parameters_schema?.properties
|
||||
@@ -1633,18 +1636,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
validationErrors={validationErrors}
|
||||
getPlaceholder={getPlaceholder}
|
||||
/>
|
||||
<SSHTunnelContainer>
|
||||
<SSHTunnelSwitchComponent
|
||||
isEditMode={isEditMode}
|
||||
dbFetched={dbFetched}
|
||||
disableSSHTunnelingForEngine={disableSSHTunnelingForEngine}
|
||||
useSSHTunneling={useSSHTunneling}
|
||||
setUseSSHTunneling={setUseSSHTunneling}
|
||||
setDB={setDB}
|
||||
isSSHTunneling={isSSHTunneling}
|
||||
/>
|
||||
</SSHTunnelContainer>
|
||||
{useSSHTunneling && (
|
||||
{db?.parameters?.ssh && (
|
||||
<SSHTunnelContainer>{renderSSHTunnelForm()}</SSHTunnelContainer>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user