|
|
|
@ -102,9 +102,13 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
|
|
|
|
|
name: Yup.string().required(
|
|
|
|
|
intl.formatMessage(messages.validationNameRequired)
|
|
|
|
|
),
|
|
|
|
|
hostname: Yup.string().required(
|
|
|
|
|
intl.formatMessage(messages.validationHostnameRequired)
|
|
|
|
|
),
|
|
|
|
|
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(
|
|
|
|
|
intl.formatMessage(messages.validationPortRequired)
|
|
|
|
|
),
|
|
|
|
@ -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()}
|
|
|
|
|