From 1268fe91e2ff77051921d8720da57e5ed9cab262 Mon Sep 17 00:00:00 2001 From: Orlando Hohmeier Date: Mon, 21 Mar 2016 16:33:10 +0100 Subject: [PATCH] Fix application error invalidation Assume that the supplied filed values as well as the whole config is valid on app form change. Closes mesosphere/marathon#3494 --- src/js/components/AppConfigEditFormComponent.jsx | 6 ++++-- src/js/components/modals/AppModalComponent.jsx | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/components/AppConfigEditFormComponent.jsx b/src/js/components/AppConfigEditFormComponent.jsx index 9a1946317..7e75eefd6 100644 --- a/src/js/components/AppConfigEditFormComponent.jsx +++ b/src/js/components/AppConfigEditFormComponent.jsx @@ -114,8 +114,10 @@ var AppConfigEditFormComponent = React.createClass({ onFormChange: function (fieldId) { var responseErrorMessages = this.state.responseErrorMessages; - if (responseErrorMessages != null && - responseErrorMessages[fieldId] != null) { + // At present we assume that the supplied filed value as well as the general + // config is valid. + if (responseErrorMessages != null ) { + delete responseErrorMessages["general"]; delete responseErrorMessages[fieldId]; } diff --git a/src/js/components/modals/AppModalComponent.jsx b/src/js/components/modals/AppModalComponent.jsx index 4ec6b54e5..14bd77390 100644 --- a/src/js/components/modals/AppModalComponent.jsx +++ b/src/js/components/modals/AppModalComponent.jsx @@ -92,6 +92,7 @@ var AppModalComponent = React.createClass({ }); } else { this.setState({ + appIsValid: false, error: AppFormStore.responseErrors }); }