From 4f45f2c3e3f80a04d6bde0510452bd51337ac0f4 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Wed, 20 Feb 2019 14:26:56 +0300 Subject: [PATCH] Fix empty values on validate --- .../components/Settings/Encryption/Form.js | 16 +++++++-------- client/src/reducers/encryption.js | 20 ++++++++++++++++++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/client/src/components/Settings/Encryption/Form.js b/client/src/components/Settings/Encryption/Form.js index 65867986..b85bcfeb 100644 --- a/client/src/components/Settings/Encryption/Form.js +++ b/client/src/components/Settings/Encryption/Form.js @@ -278,15 +278,13 @@ let Form = (props) => { -
-

- { - (certificateChain || privateKey) - && warning_validation - && warning_validation - } -

-
+ {warning_validation && +
+

+ {warning_validation} +

+
+ }
diff --git a/client/src/reducers/encryption.js b/client/src/reducers/encryption.js index f3f2dd67..3f51b217 100644 --- a/client/src/reducers/encryption.js +++ b/client/src/reducers/encryption.js @@ -28,9 +28,27 @@ const encryption = handleActions({ [actions.validateTlsConfigRequest]: state => ({ ...state, processingValidate: true }), [actions.validateTlsConfigFailure]: state => ({ ...state, processingValidate: false }), [actions.validateTlsConfigSuccess]: (state, { payload }) => { + const { + issuer = '', + key_type = '', + not_after = '', + not_before = '', + subject = '', + warning_validation = '', + dns_names = '', + ...values + } = payload; + const newState = { ...state, - ...payload, + ...values, + issuer, + key_type, + not_after, + not_before, + subject, + warning_validation, + dns_names, processingValidate: false, }; return newState;