ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-12185. User is able to go back from deploy step of installer (onechiporenko)
Date Sat, 27 Jun 2015 18:03:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5930dc772 -> 0254474a0


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/0254474a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0254474a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0254474a

Branch: refs/heads/trunk
Commit: 0254474a047875f87b2310f65388aafdda861671
Parents: 5930dc7
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Sat Jun 27 19:42:16 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Sat Jun 27 19:42:16 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/0254474a/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/0254474a/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index 4a3b26d..1bbf7fc 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -371,9 +371,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);
           }
@@ -427,9 +427,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/0254474a/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);


Mime
View raw message