ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-10363 RU:Status bar shows installing when no install is in progress. (atkach)
Date Mon, 06 Apr 2015 14:18:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6fd80a232 -> 8cce657f9


AMBARI-10363 RU:Status bar shows installing when no install is in progress. (atkach)


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

Branch: refs/heads/trunk
Commit: 8cce657f956e467898e2fc890dd6ad290e79b306
Parents: 6fd80a2
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Mon Apr 6 16:04:12 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Mon Apr 6 17:17:06 2015 +0300

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js           |  6 +++++-
 .../main/admin/stack_upgrade/upgrade_version_box_view.js |  7 ++++---
 .../main/admin/stack_and_upgrade_controller_test.js      | 11 ++++++++---
 .../admin/stack_upgrade/upgrade_version_box_view_test.js |  5 ++++-
 4 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cce657f/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 b8c5768..8b09d68 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
@@ -628,12 +628,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @method installStackVersionSuccess
    */
   installRepoVersionSuccess: function (data, opt, params) {
+    var version = App.RepositoryVersion.find(params.id);
     App.db.set('repoVersionInstall', 'id', [data.Requests.id]);
     App.clusterStatus.setClusterStatus({
       wizardControllerName: this.get('name'),
       localdb: App.db.data
     });
-    App.RepositoryVersion.find(params.id).set('defaultStatus', 'INSTALLING');
+    version.set('defaultStatus', 'INSTALLING');
+    if (version.get('stackVersion')) {
+      version.set('stackVersion.state', 'INSTALLING');
+    }
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cce657f/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 f3d1c6d..51d85a1 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
@@ -108,6 +108,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
       }.property('status'),
       isDisabled: false
     });
+    var isInstalling = this.get('parentView.repoVersions').someProperty('status', 'INSTALLING');
 
     if (status === 'CURRENT') {
       element.set('isLabel', true);
@@ -117,7 +118,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
       element.set('isButton', true);
       element.set('text', Em.I18n.t('admin.stackVersions.version.installNow'));
       element.set('action', 'installRepoVersionConfirmation');
-      element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress'));
+      element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress')
|| isInstalling);
     } else if (status === 'INSTALLING') {
       element.set('iconClass', 'icon-cog');
       element.set('isLink', true);
@@ -128,7 +129,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
         element.set('isButton', true);
         element.set('text', Em.I18n.t('admin.stackVersions.version.performUpgrade'));
         element.set('action', 'confirmUpgrade');
-        element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress'));
+        element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress')
|| isInstalling);
       } else {
         element.set('iconClass', 'icon-ok');
         element.set('isLink', true);
@@ -155,7 +156,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
       }
     }
     return element;
-  }.property('content.status', 'controller.isDowngrade', 'isUpgrading', 'controller.requestInProgress'),
+  }.property('content.status', 'controller.isDowngrade', 'isUpgrading', 'controller.requestInProgress',
'parentView.repoVersions.@each.status'),
 
   didInsertElement: function () {
     App.tooltip($('.link-tooltip'), {title: Em.I18n.t('admin.stackVersions.version.linkTooltip')});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cce657f/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 e377b9c..5d674ce 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
@@ -609,7 +609,11 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   });
 
   describe("#installRepoVersionSuccess()", function() {
-    var mock = {set: Em.K};
+    var mock = Em.Object.create({
+      id: 1,
+      defaultStatus: 'INIT',
+      stackVersion: {}
+    });
     before(function () {
       sinon.spy(mock, 'set');
       sinon.stub(App.db, 'set', Em.K);
@@ -617,7 +621,6 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       sinon.stub(App.RepositoryVersion, 'find').returns(mock);
     });
     after(function () {
-      mock.set.restore();
       App.db.set.restore();
       App.clusterStatus.setClusterStatus.restore();
       App.RepositoryVersion.find.restore();
@@ -627,7 +630,9 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       expect(App.db.set.calledWith('repoVersionInstall', 'id', [1])).to.be.true;
       expect(App.clusterStatus.setClusterStatus.calledOnce).to.be.true;
       expect(App.RepositoryVersion.find.calledWith(1)).to.be.true;
-      expect(mock.set.calledWith('defaultStatus', 'INSTALLING')).to.be.true;    });
+      expect(App.RepositoryVersion.find(1).get('defaultStatus')).to.equal('INSTALLING');
+      expect(App.RepositoryVersion.find(1).get('stackVersion.state')).to.equal('INSTALLING');
+    });
   });
 
   describe("#setUpgradeItemStatus()", function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cce657f/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 f933cef..62d6635 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
@@ -25,7 +25,10 @@ describe('App.UpgradeVersionBoxView', function () {
     controller: Em.Object.create({
       upgrade: Em.K
     }),
-    content: Em.Object.create()
+    content: Em.Object.create(),
+    parentView: Em.Object.create({
+      repoVersions: []
+    })
   });
 
   describe("#isUpgrading", function () {


Mime
View raw message