fix: validation errors appearing after ssh tunnel switch (#24849)
This commit is contained in:
parent
bf1b1a4c46
commit
b71541fb7f
|
|
@ -49,6 +49,7 @@ export const hostField = ({
|
|||
onChange={changeMethods.onParametersChange}
|
||||
/>
|
||||
);
|
||||
|
||||
export const portField = ({
|
||||
required,
|
||||
changeMethods,
|
||||
|
|
@ -255,6 +256,7 @@ export const forceSSLField = ({
|
|||
export const SSHTunnelSwitch = ({
|
||||
isEditMode,
|
||||
changeMethods,
|
||||
clearValidationErrors,
|
||||
db,
|
||||
}: FieldPropTypes) => (
|
||||
<div css={(theme: SupersetTheme) => infoTooltip(theme)}>
|
||||
|
|
@ -270,6 +272,7 @@ export const SSHTunnelSwitch = ({
|
|||
value: changed,
|
||||
},
|
||||
});
|
||||
clearValidationErrors();
|
||||
}}
|
||||
data-test="ssh-tunnel-switch"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ export interface FieldPropTypes {
|
|||
};
|
||||
validationErrors: JsonObject | null;
|
||||
getValidation: () => void;
|
||||
clearValidationErrors: () => void;
|
||||
db?: DatabaseObject;
|
||||
field: string;
|
||||
isEditMode?: boolean;
|
||||
|
|
@ -132,6 +133,7 @@ interface DatabaseConnectionFormProps {
|
|||
onRemoveTableCatalog: (idx: number) => void;
|
||||
validationErrors: JsonObject | null;
|
||||
getValidation: () => void;
|
||||
clearValidationErrors: () => void;
|
||||
getPlaceholder?: (field: string) => string | undefined;
|
||||
}
|
||||
|
||||
|
|
@ -151,6 +153,7 @@ const DatabaseConnectionForm = ({
|
|||
onRemoveTableCatalog,
|
||||
sslForced,
|
||||
validationErrors,
|
||||
clearValidationErrors,
|
||||
}: DatabaseConnectionFormProps) => (
|
||||
<Form>
|
||||
<div
|
||||
|
|
@ -179,6 +182,7 @@ const DatabaseConnectionForm = ({
|
|||
},
|
||||
validationErrors,
|
||||
getValidation,
|
||||
clearValidationErrors,
|
||||
db,
|
||||
key: field,
|
||||
field,
|
||||
|
|
|
|||
|
|
@ -267,7 +267,6 @@ export function dbReducer(
|
|||
};
|
||||
case ActionType.extraInputChange:
|
||||
// "extra" payload in state is a string
|
||||
|
||||
if (
|
||||
action.payload.name === 'schema_cache_timeout' ||
|
||||
action.payload.name === 'table_cache_timeout'
|
||||
|
|
@ -1635,6 +1634,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
getValidation={() => getValidation(db)}
|
||||
validationErrors={validationErrors}
|
||||
getPlaceholder={getPlaceholder}
|
||||
clearValidationErrors={() => setValidationErrors(null)}
|
||||
/>
|
||||
{db?.parameters?.ssh && (
|
||||
<SSHTunnelContainer>{renderSSHTunnelForm()}</SSHTunnelContainer>
|
||||
|
|
|
|||
Loading…
Reference in New Issue