ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-10119 Rolling Upgrade "Upgrade" Action Actually Starts "Install Versions". (ababiichuk)
Date Wed, 18 Mar 2015 13:25:40 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 365dc3b54 -> b21d8176f


AMBARI-10119 Rolling Upgrade "Upgrade" Action Actually Starts "Install Versions".  (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b21d8176
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b21d8176
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b21d8176

Branch: refs/heads/trunk
Commit: b21d8176fbdb6f8cd535220af1fdc9e51b414955
Parents: 365dc3b
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Wed Mar 18 14:40:08 2015 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Wed Mar 18 15:25:23 2015 +0200

----------------------------------------------------------------------
 .../main/admin/stack_upgrade/upgrade_version_box.hbs        | 4 ++--
 .../main/admin/stack_upgrade/upgrade_version_box_view.js    | 9 ++++-----
 .../admin/stack_upgrade/upgrade_version_box_view_test.js    | 7 +++++--
 3 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b21d8176/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
index f3f64f2..621e959 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
@@ -30,7 +30,7 @@
 <div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state"}}>
   {{#if view.stateElement.isButton}}
     <button class="btn btn-primary"
-      {{action runAction view.stateElement target="view"}}
+      {{action runAction target="view"}}
       {{bindAttr disabled="view.stateElement.isDisabled"}}>
       {{view.stateElement.text}}
     </button>
@@ -42,7 +42,7 @@
     {{#if view.stateElement.iconClass}}
       <i {{bindAttr class="view.stateElement.iconClass"}}></i>
     {{/if}}
-    <a href="#" {{action runAction view.stateElement target="view"}}>{{view.stateElement.text}}</a>
+    <a href="#" {{action runAction target="view"}}>{{view.stateElement.text}}</a>
     {{#if view.stateElement.isInstalling}}
       {{view App.ProgressBarView
         progressBinding="view.installProgress"

http://git-wip-us.apache.org/repos/asf/ambari/blob/b21d8176/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 4fb89f2..f3d1c6d 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -165,12 +165,11 @@ App.UpgradeVersionBoxView = Em.View.extend({
 
   /**
    * run custom action of controller
-   * @param {object} event
    */
-  runAction: function (event) {
-    var stateElement = event.context;
-    if (stateElement.get('action')) {
-      this.get('controller')[stateElement.get('action')](this.get('content'));
+  runAction: function () {
+    var action = this.get('stateElement.action');
+    if (action) {
+      this.get('controller')[action](this.get('content'));
     }
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b21d8176/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index a4b914e..f933cef 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -119,18 +119,21 @@ describe('App.UpgradeVersionBoxView', function () {
 
   describe("#runAction()", function () {
     beforeEach(function () {
+      view.set('stateElement', Em.Object.create({}));
       sinon.stub(view.get('controller'), 'upgrade').returns(1);
     });
     afterEach(function () {
       view.get('controller').upgrade.restore();
     });
     it("action = null", function () {
-      view.runAction({context: Em.Object.create({action: null})});
+      view.set('stateElement.action', null);
+      view.runAction();
       expect(view.get('controller').upgrade.called).to.be.false;
     });
     it("action = 'upgrade'", function () {
       view.set('content', 'content');
-      view.runAction({context: Em.Object.create({action: 'upgrade'})});
+      view.set('stateElement.action', 'upgrade');
+      view.runAction();
       expect(view.get('controller').upgrade.calledWith('content')).to.be.true;
     });
   });


Mime
View raw message