Repository: ambari Updated Branches: refs/heads/branch-2.1 9aae9b70b -> 3afaf6614
AMBARI-12185. User is able to go back from deploy step of installer (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3afaf661 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3afaf661 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3afaf661 Branch: refs/heads/branch-2.1 Commit: 3afaf661407d93d186be634f94a89ea866e7f7f2 Parents: 9aae9b7 Author: Oleg Nechiporenko <[email protected]> Authored: Sat Jun 27 19:42:16 2015 +0300 Committer: Oleg Nechiporenko <[email protected]> Committed: Sat Jun 27 21:05:28 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/installer.js | 9 ++------- ambari-web/app/routes/installer.js | 4 ++-- ambari-web/test/controllers/installer_test.js | 11 +++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3afaf661/ambari-web/app/controllers/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js index f33e7b2..afa6605 100644 --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@ -86,7 +86,7 @@ App.InstallerController = App.WizardController.extend({ this.get('isStepDisabled').setEach('value', true); this.get('isStepDisabled').pushObject(Ember.Object.create({ step: 0, - value: false + value: true })); }, /** @@ -705,12 +705,7 @@ App.InstallerController = App.WizardController.extend({ setStepsEnable: function () { for (var i = 0; i <= this.totalSteps; i++) { - var step = this.get('isStepDisabled').findProperty('step', i); - if (i <= this.get('currentStep')) { - step.set('value', false); - } else { - step.set('value', true); - } + this.get('isStepDisabled').findProperty('step', i).set('value', i > this.get('currentStep')); } }.observes('currentStep'), http://git-wip-us.apache.org/repos/asf/ambari/blob/3afaf661/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 3cd0d68..05f3775 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -372,9 +372,9 @@ module.exports = Em.Route.extend(App.RouterRedirections, { console.log('in installer.step9:connectOutlets'); var controller = router.get('installerController'), wizardStep9Controller = router.get('wizardStep9Controller'); - controller.setCurrentStep('9'); controller.loadAllPriorSteps().done(function () { wizardStep9Controller.loadDoServiceChecksFlag().done(function () { + controller.setCurrentStep('9'); if (!App.get('testMode')) { controller.setLowerStepsDisable(9); } @@ -429,9 +429,9 @@ module.exports = Em.Route.extend(App.RouterRedirections, { connectOutlets: function (router, context) { console.log('in installer.step10:connectOutlets'); var controller = router.get('installerController'); - controller.setCurrentStep('10'); controller.loadAllPriorSteps().done(function () { if (!App.get('testMode')) { + controller.setCurrentStep('10'); controller.setLowerStepsDisable(10); } controller.connectOutlet('wizardStep10', controller.get('content')); http://git-wip-us.apache.org/repos/asf/ambari/blob/3afaf661/ambari-web/test/controllers/installer_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/installer_test.js b/ambari-web/test/controllers/installer_test.js index 93c2dd2..0b7829a 100644 --- a/ambari-web/test/controllers/installer_test.js +++ b/ambari-web/test/controllers/installer_test.js @@ -26,6 +26,17 @@ describe('App.InstallerController', function () { var installerController = App.InstallerController.create(); + describe('#init', function () { + var c; + beforeEach(function () { + c = App.InstallerController.create({}); + }); + it('all steps are disabled by default', function () { + expect(c.get('isStepDisabled.length') > 0 ).to.be.ok; + expect(c.get('isStepDisabled').everyProperty('value', true)).to.be.ok; + }); + }); + describe('#loadStacksVersionsSuccessCallback', function() { beforeEach(function () { sinon.stub(App.store, 'commit', Em.K);
