diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 25053476..33eb0fa1 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -233,5 +233,6 @@ "topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings0>.", "form_error_port_range": "Enter port value in the range of 80-65535", "form_error_equal": "Shouldn't be equal", - "form_error_password": "Password mismatched" + "form_error_password": "Password mismatched", + "reset_settings": "Reset settings", } \ No newline at end of file diff --git a/client/src/components/Settings/Encryption/Form.js b/client/src/components/Settings/Encryption/Form.js index 4e85ea5a..db0f1b41 100644 --- a/client/src/components/Settings/Encryption/Form.js +++ b/client/src/components/Settings/Encryption/Form.js @@ -4,15 +4,17 @@ import { Field, reduxForm } from 'redux-form'; import { Trans, withNamespaces } from 'react-i18next'; import flow from 'lodash/flow'; -import { renderField, renderSelectField, required, toNumber, port } from '../../../helpers/form'; +import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form'; import i18n from '../../../i18n'; const validate = (values) => { const errors = {}; - if (values.port_dns_over_tls === values.port_https) { - errors.port_dns_over_tls = i18n.t('form_error_equal'); - errors.port_https = i18n.t('form_error_equal'); + if (values.port_dns_over_tls && values.port_https) { + if (values.port_dns_over_tls === values.port_https) { + errors.port_dns_over_tls = i18n.t('form_error_equal'); + errors.port_https = i18n.t('form_error_equal'); + } } return errors; @@ -22,6 +24,7 @@ const Form = (props) => { const { t, handleSubmit, + reset, invalid, submitting, processing, @@ -46,7 +49,6 @@ const Form = (props) => { type="text" className="form-control" placeholder={t('encryption_server_enter')} - validate={[required]} />