Skip to content

Commit 1f64548

Browse files
committed
4858 - disable the ConnectionDialog Next/Save buttons when input requirements not met
1 parent 1a31312 commit 1f64548

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

client/src/shared/components/connection/ConnectionDialog.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ const ConnectionDialog = ({
125125
label: tag.name,
126126
})) || [],
127127
},
128+
mode: 'onTouched',
128129
});
129130

130131
const {control, formState, getValues, handleSubmit, reset: formReset, setValue, watch} = form;
@@ -795,6 +796,7 @@ const ConnectionDialog = ({
795796
<>
796797
{wizardStep === 'configuration_step' && (
797798
<Button
799+
disabled={!formState.isValid}
798800
label="Next"
799801
onClick={handleSubmit(() => {
800802
setWizardStep('oauth_step');
@@ -829,7 +831,12 @@ const ConnectionDialog = ({
829831
)}
830832

831833
{!showOAuth2Step && (
832-
<Button label="Save" onClick={handleSubmit(() => saveConnection())} type="submit" />
834+
<Button
835+
disabled={!formState.isValid}
836+
label="Save"
837+
onClick={handleSubmit(() => saveConnection())}
838+
type="submit"
839+
/>
833840
)}
834841
</div>
835842
</DialogFooter>

0 commit comments

Comments
 (0)