|
|
|
@ -102,7 +102,11 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
|
|
|
|
|
name: Yup.string().required(
|
|
|
|
|
intl.formatMessage(messages.validationNameRequired)
|
|
|
|
|
),
|
|
|
|
|
hostname: Yup.string().required(
|
|
|
|
|
hostname: Yup.string()
|
|
|
|
|
.required(intl.formatMessage(messages.validationHostnameRequired))
|
|
|
|
|
.matches(
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
/^(([a-z]|\d|_|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*)?([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])$/i,
|
|
|
|
|
intl.formatMessage(messages.validationHostnameRequired)
|
|
|
|
|
),
|
|
|
|
|
port: Yup.number().required(
|
|
|
|
@ -341,7 +345,12 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
secondaryDisabled={
|
|
|
|
|
!values.apiKey || !values.hostname || !values.port || isTesting
|
|
|
|
|
!values.apiKey ||
|
|
|
|
|
!values.hostname ||
|
|
|
|
|
!values.port ||
|
|
|
|
|
isTesting ||
|
|
|
|
|
isSubmitting ||
|
|
|
|
|
!isValid
|
|
|
|
|
}
|
|
|
|
|
okDisabled={!isValidated || isSubmitting || isTesting || !isValid}
|
|
|
|
|
onOk={() => handleSubmit()}
|
|
|
|
|