-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: SSH Tunnel creation with dynamic form #24196
Changes from 8 commits
97b436b
1afb7cd
79af985
eb7683a
9b99dd2
eff48f9
b4bab39
c1ccff2
7b01352
97cddfe
f4fb07b
3fc9269
75f6ddf
66f6024
9e3760a
5e843f9
5fb76e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -763,15 +763,19 @@ 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 | ||
console.log(dbToUpdate); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leftover |
||
if (!dbToUpdate?.ssh_tunnel) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hughhhh why can't we run the validation for SSH tunnel connections, assuming the user has provided that info? I think the logic should be: if the user has enabled SSH, we don't perform any validation until SSH credentials are entered. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the initial implementation, we were okay with doing validation on just connect. Right now users are not able to connect at all via dynamic forms. I'm open to this fix but that's going to take longer to implement vs. fixing the issue at hand. Let me know what you think |
||
// 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 +1637,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> | ||
)} | ||
</> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the ternary operator here if the condition is always true?