Repository: ambari Updated Branches: refs/heads/branch-2.2 289fc18bf -> 9adcea949
AMBARI-14701: assign_master_components.js breaks next step in certain case (mithmatt via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9adcea94 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9adcea94 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9adcea94 Branch: refs/heads/branch-2.2 Commit: 9adcea9495ea5eaee2665c64a61e815a095bb5bf Parents: 289fc18 Author: Jun Aoki <ja...@apache.org> Authored: Fri Feb 12 18:16:21 2016 -0800 Committer: Jun Aoki <ja...@apache.org> Committed: Fri Feb 12 18:16:21 2016 -0800 ---------------------------------------------------------------------- .../mixins/wizard/assign_master_components.js | 37 +++++++++++++------- 1 file changed, 25 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9adcea94/ambari-web/app/mixins/wizard/assign_master_components.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js index 7dc267e..f6d1b1a 100644 --- a/ambari-web/app/mixins/wizard/assign_master_components.js +++ b/ambari-web/app/mixins/wizard/assign_master_components.js @@ -1078,7 +1078,6 @@ App.AssignMasterComponents = Em.Mixin.create({ if (!self.get('submitDisabled')) { App.router.send('next'); } - self.set('submitButtonClicked', false); }; if (this.get('useServerValidation')) { @@ -1088,6 +1087,7 @@ App.AssignMasterComponents = Em.Mixin.create({ } else { self.updateIsSubmitDisabled(); goNextStepIfValid(); + self.set('submitButtonClicked', false); } } }, @@ -1098,18 +1098,31 @@ App.AssignMasterComponents = Em.Mixin.create({ */ showValidationIssuesAcceptBox: function(callback) { var self = this; - if (self.get('anyWarning') || self.get('anyError')) { - App.ModalPopup.show({ - primary: Em.I18n.t('common.continueAnyway'), - header: Em.I18n.t('installer.step5.validationIssuesAttention.header'), - body: Em.I18n.t('installer.step5.validationIssuesAttention'), - onPrimary: function () { - this.hide(); - callback(); - } - }); - } else { + + // If there are no warnings and no errors, return + if (!self.get('anyWarning') && !self.get('anyError')) { callback(); + self.set('submitButtonClicked', false); + return; } + + App.ModalPopup.show({ + primary: Em.I18n.t('common.continueAnyway'), + header: Em.I18n.t('installer.step5.validationIssuesAttention.header'), + body: Em.I18n.t('installer.step5.validationIssuesAttention'), + onPrimary: function () { + this._super(); + callback(); + self.set('submitButtonClicked', false); + }, + onSecondary: function () { + this._super(); + self.set('submitButtonClicked', false); + }, + onClose: function () { + this._super(); + self.set('submitButtonClicked', false); + } + }); } });