diff --git a/client/src/components/Settings/Encryption/Form.js b/client/src/components/Settings/Encryption/Form.js index 9df440aa..de7a7158 100644 --- a/client/src/components/Settings/Encryption/Form.js +++ b/client/src/components/Settings/Encryption/Form.js @@ -34,7 +34,7 @@ const validate = (values) => { return errors; }; -const clearFields = (change, setTlsConfig, t) => { +const clearFields = (change, setTlsConfig, validateTlsConfig, t) => { const fields = { private_key: '', certificate_chain: '', @@ -53,6 +53,7 @@ const clearFields = (change, setTlsConfig, t) => { Object.keys(fields) .forEach((field) => change(field, fields[field])); setTlsConfig(fields); + validateTlsConfig(fields); } }; @@ -102,6 +103,7 @@ let Form = (props) => { subject, warning_validation, setTlsConfig, + validateTlsConfig, certificateSource, privateKeySource, privateKeySaved, @@ -419,7 +421,7 @@ let Form = (props) => { type="button" className="btn btn-secondary btn-standart" disabled={submitting || processingConfig} - onClick={() => clearFields(change, setTlsConfig, t)} + onClick={() => clearFields(change, setTlsConfig, validateTlsConfig, t)} > reset_settings @@ -455,6 +457,7 @@ Form.propTypes = { subject: PropTypes.string, t: PropTypes.func.isRequired, setTlsConfig: PropTypes.func.isRequired, + validateTlsConfig: PropTypes.func.isRequired, certificateSource: PropTypes.string, privateKeySource: PropTypes.string, privateKeySaved: PropTypes.bool, diff --git a/client/src/components/Settings/Encryption/index.js b/client/src/components/Settings/Encryption/index.js index bcd2d323..4e4cef67 100644 --- a/client/src/components/Settings/Encryption/index.js +++ b/client/src/components/Settings/Encryption/index.js @@ -116,6 +116,7 @@ class Encryption extends Component { onSubmit={this.handleFormSubmit} onChange={this.handleFormChange} setTlsConfig={this.props.setTlsConfig} + validateTlsConfig={this.props.validateTlsConfig} {...this.props.encryption} />