ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-13532. RU: Upgrade window does not show 'Upgrade Finished' status on completion.(xiwang)
Date Fri, 23 Oct 2015 00:43:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3864bc161 -> 6cd152c4d


AMBARI-13532. RU: Upgrade window does not show 'Upgrade Finished' status on completion.(xiwang)


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

Branch: refs/heads/trunk
Commit: 6cd152c4d834ee9d7782e85e9fe7ad2c4060135d
Parents: 3864bc1
Author: Xi Wang <xiwang@apache.org>
Authored: Thu Oct 22 16:57:52 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Thu Oct 22 17:40:29 2015 -0700

----------------------------------------------------------------------
 .../controllers/main/admin/stack_and_upgrade_controller.js   | 6 ++++--
 .../views/main/admin/stack_upgrade/upgrade_wizard_view.js    | 4 ++--
 .../main/admin/stack_and_upgrade_controller_test.js          | 4 ++--
 .../main/admin/stack_upgrade/upgrade_wizard_view_test.js     | 8 +-------
 4 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd152c4/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 9c779ce..f751277 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -196,10 +196,12 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   requestStatus: function () {
     if (this.get('isSuspended')) {
       return 'SUSPENDED';
+    } else if (this.get('upgradeData.Upgrade')){
+      return this.get('upgradeData.Upgrade.request_status');
     } else {
-      return App.get('upgradeState');
+      return '';
     }
-  }.property('isSuspended', 'App.upgradeState'),
+  }.property('isSuspended', 'upgradeData.Upgrade.request_status'),
 
   init: function () {
     this.initDBProperties();

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd152c4/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
index 6d79514..d1bfe18 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
@@ -183,7 +183,7 @@ App.upgradeWizardView = Em.View.extend({
    */
   upgradeStatusLabel: function() {
     var labelKey = null;
-    switch (App.get('upgradeState')) {
+    switch (this.get('controller.upgradeData.Upgrade.request_status')) {
       case 'QUEUED':
       case 'PENDING':
       case 'IN_PROGRESS':
@@ -213,7 +213,7 @@ App.upgradeWizardView = Em.View.extend({
     } else {
       return "";
     }
-  }.property('App.upgradeState', 'controller.isDowngrade', 'controller.isSuspended'),
+  }.property('controller.upgradeData.Upgrade.request_status', 'controller.isDowngrade', 'controller.isSuspended'),
 
   /**
    * toggle details box

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd152c4/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index 0124608..e0cab41 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -75,14 +75,14 @@ describe('App.MainAdminStackAndUpgradeController', function() {
 
   describe("#requestStatus", function() {
     it("isSuspended false", function() {
-      App.set('upgradeState', 'ABORTED');
       controller.set('isSuspended', false);
+      controller.set('upgradeData', { Upgrade: {request_status: 'ABORTED'}});
       controller.propertyDidChange('requestStatus');
       expect(controller.get('requestStatus')).to.equal('ABORTED');
     });
     it("isSuspended true", function() {
-      App.set('upgradeState', 'ABORTED');
       controller.set('isSuspended', true);
+      controller.set('upgradeData', { Upgrade: {request_status: 'ABORTED'}});
       controller.propertyDidChange('requestStatus');
       expect(controller.get('requestStatus')).to.equal('SUSPENDED');
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd152c4/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
index 69e8665..5a35d59 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
@@ -448,12 +448,6 @@ describe('App.upgradeWizardView', function () {
   });
 
   describe("#upgradeStatusLabel", function () {
-    beforeEach(function () {
-      this.mock = sinon.stub(App, 'get');
-    });
-    afterEach(function () {
-      this.mock.restore();
-    });
     var testCases = [
       {
         data: {
@@ -614,7 +608,7 @@ describe('App.upgradeWizardView', function () {
         it('status = ' + test.data.status + ", isDowngrade = " + test.data.isDowngrade, function
() {
           view.set('controller.isDowngrade', test.data.isDowngrade);
           view.set('controller.isSuspended', test.data.isSuspended);
-          this.mock.returns(test.data.status);
+          view.set('controller.upgradeData.Upgrade.request_status', test.data.status);
           view.propertyDidChange('upgradeStatusLabel');
           expect(view.get('upgradeStatusLabel')).to.equal(test.result);
         });


Mime
View raw message