ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-21992. Update Already Installed Icon Appears On Old Repo (alexantonenko)
Date Tue, 19 Sep 2017 13:15:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d0e44a154 -> 271fbc7ca


AMBARI-21992. Update Already Installed Icon Appears On Old Repo (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 271fbc7ca83cfb67f7b4d2adec61000c571e8aff
Parents: d0e44a1
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Tue Sep 19 16:15:16 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Tue Sep 19 16:15:16 2017 +0300

----------------------------------------------------------------------
 .../upgrade_version_column_view.js              |  6 ++-
 .../upgrade_version_column_view_test.js         | 45 +++++++++++++++++++-
 2 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/271fbc7c/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
index 0ae8252..b0074a9 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
@@ -57,12 +57,16 @@ App.UpgradeVersionColumnView = App.UpgradeVersionBoxView.extend({
         name: service.get('serviceName'),
         latestVersion: stackService ? stackService.get('latestVersion') : '',
         isVersionInvisible: !stackService,
-        notUpgradable: !this.get('content.isStandard')  && isAvailable &&
!stackService.get('isUpgradable'),
+        notUpgradable: this.getNotUpgradable(isAvailable, stackService.get('isUpgradable')),
         isAvailable: isAvailable
       });
     }, this);
   }.property(),
 
+  getNotUpgradable: function(isAvailable, isUpgradable) {
+    return this.get('content.isMaint') && this.get('content.status') !== 'CURRENT'
&& isAvailable && !isUpgradable;
+  },
+
 
   /**
    * @param {Em.Object} stackService

http://git-wip-us.apache.org/repos/asf/ambari/blob/271fbc7c/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_column_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_column_view_test.js
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_column_view_test.js
index 1c68fa3..e1e477d 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_column_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_column_view_test.js
@@ -88,6 +88,30 @@ describe('App.UpgradeVersionColumnView', function () {
       stackVersionType: 'HCP',
       isCompatible: true,
       hidden: false,
+      isMaint: false,
+      stackServices: [
+        Em.Object.create({
+          name: 'zk',
+          isAvailable: true
+        }),
+        Em.Object.create({
+          name: 'storm',
+          isAvailable: false
+        }),
+        Em.Object.create({
+          name: 'hdfs',
+          isAvailable: true
+        })
+      ]
+    }),
+    Em.Object.create({
+      id: 4,
+      status: "INSTALLED",
+      repositoryVersion: "2.0.2.1",
+      stackVersionType: 'HCP',
+      isCompatible: true,
+      hidden: false,
+      isMaint: true,
       stackServices: [
         Em.Object.create({
           name: 'zk',
@@ -105,8 +129,6 @@ describe('App.UpgradeVersionColumnView', function () {
     })
   ];
 
-
-  
   describe("#isStackServiceAvailable", function () {
     beforeEach(function() {
       sinon.stub(App.Service, 'find', function (id) {
@@ -143,4 +165,23 @@ describe('App.UpgradeVersionColumnView', function () {
       expect(view.isStackServiceAvailable(versions[1].get('stackServices')[1])).to.be.true;
     });
   });
+
+  describe("#getNotUpgradable", function () {
+    it ('Should return false for not maint', function () {
+      view.set('content', versions[2]);
+      expect(view.getNotUpgradable(true, false)).to.be.false;
+    });
+    it ('Should return true for maint, when service is available and not upgradable', function
() {
+      view.set('content', versions[3]);
+      expect(view.getNotUpgradable(true, false)).to.be.true;
+    });
+    it ('Should return false for maint, when service is available and upgradable', function
() {
+      view.set('content', versions[3]);
+      expect(view.getNotUpgradable(true, true)).to.be.false;
+    });
+    it ('Should return false for maint, when service is not available and upgradable', function
() {
+      view.set('content', versions[3]);
+      expect(view.getNotUpgradable(false, true)).to.be.false;
+    })
+  })
 });


Mime
View raw message