Repository: ambari Updated Branches: refs/heads/trunk 7131068df -> 9da97be3d
AMBARI-19644 Make the config changes for Add / Delete Service flow more prominent. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9da97be3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9da97be3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9da97be3 Branch: refs/heads/trunk Commit: 9da97be3d9099c8b31e2ee5e4f942f4dd801e3c2 Parents: 7131068 Author: ababiichuk <[email protected]> Authored: Fri Jan 20 13:31:56 2017 +0200 Committer: ababiichuk <[email protected]> Committed: Fri Jan 20 15:01:52 2017 +0200 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service/item.js | 2 ++ .../app/controllers/wizard/step7_controller.js | 22 ++++++++++++++------ .../info/delete_service_warning_popup.hbs | 4 +--- .../test/controllers/wizard/step7_test.js | 18 ++++++++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9da97be3/ambari-web/app/controllers/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js index 96dd700..3a60137 100644 --- a/ambari-web/app/controllers/main/service/item.js +++ b/ambari-web/app/controllers/main/service/item.js @@ -1358,6 +1358,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow primary: popupPrimary, primaryClass: 'btn-danger', disablePrimary: Em.computed.alias('controller.isRecommendationInProgress'), + classNameBindings: ['controller.changedProperties.length:common-modal-wrapper', 'controller.changedProperties.length:modal-full-width'], + modalDialogClasses: Em.computed.ifThenElse('controller.changedProperties.length', ['modal-lg'], []), bodyClass: Em.View.extend({ templateName: require('templates/main/service/info/delete_service_warning_popup'), warningMessage: new Em.Handlebars.SafeString(warningMessage) http://git-wip-us.apache.org/repos/asf/ambari/blob/9da97be3/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 61fd910..7dcc2ad 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -1486,8 +1486,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E }, onSecondary: function () { this._super(); - self.set('submitButtonClicked', false); - App.set('router.nextBtnClickInProgress', false); + self.setButtonClickFinish(); deferred.reject(); } }); @@ -1510,8 +1509,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E } }, onSecondary: function() { - App.set('router.nextBtnClickInProgress', false); - self.set('submitButtonClicked', false); + self.setButtonClickFinish(); this.hide(); }, onClose: function() { @@ -1545,6 +1543,14 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E return false; } App.set('router.nextBtnClickInProgress', true); + if (this.get('wizardController.name') === 'addServiceController' && this.get('hasChangedDependencies')) { + return this.showChangedDependentConfigs({}, this.proceedWithChecks.bind(this), this.setButtonClickFinish.bind(this)); + } else { + return this.proceedWithChecks(); + } + }, + + proceedWithChecks: function () { if (this.get('supportsPreInstallChecks')) { var preInstallChecksController = App.router.get('preInstallChecksController'); if (preInstallChecksController.get('preInstallChecksWhereRun')) { @@ -1555,6 +1561,11 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E return this.postSubmit(); }, + setButtonClickFinish: function () { + this.set('submitButtonClicked', false); + App.set('router.nextBtnClickInProgress', false); + }, + postSubmit: function () { var self = this; this.set('submitButtonClicked', true); @@ -1563,8 +1574,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E }) .fail(function (value) { if ("invalid_configs" === value) { - self.set('submitButtonClicked', false); - App.set('router.nextBtnClickInProgress', false); + self.setButtonClickFinish(); } else { // Failed due to validation mechanism failure. // Should proceed with other checks http://git-wip-us.apache.org/repos/asf/ambari/blob/9da97be3/ambari-web/app/templates/main/service/info/delete_service_warning_popup.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/info/delete_service_warning_popup.hbs b/ambari-web/app/templates/main/service/info/delete_service_warning_popup.hbs index 4155947..92f2097 100644 --- a/ambari-web/app/templates/main/service/info/delete_service_warning_popup.hbs +++ b/ambari-web/app/templates/main/service/info/delete_service_warning_popup.hbs @@ -21,8 +21,6 @@ {{view App.SpinnerView}} {{else}} {{#if controller.changedProperties.length}} - <div class="alert alert-warning"> - <span>{{dependenciesMessage}}</span> <a href="#" {{action "showChangedDependentConfigs" target="controller"}}>{{t common.showDetails}}</a> - </div> + {{view App.DependentConfigsListView recommendationsBinding="controller.changedProperties"}} {{/if}} {{/if}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/9da97be3/ambari-web/test/controllers/wizard/step7_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index d6f2b00..d5d157d 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -2059,4 +2059,22 @@ describe('App.InstallerStep7Controller', function () { }); + describe('#setButtonClickFinish', function () { + + beforeEach(function () { + installerStep7Controller.set('submitButtonClicked', true); + App.set('router.nextBtnClickInProgress', true); + installerStep7Controller.setButtonClickFinish(); + }); + + it('submitButtonClicked should be false', function () { + expect(installerStep7Controller.get('submitButtonClicked')).to.be.false; + }); + + it('nextBtnClickInProgress should be false', function () { + expect(App.get('router.nextBtnClickInProgress')).to.be.false; + }); + + }); + });
