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-21428 Host Versions Page Doesn't Show Stacks From Different Vendors. (atkach)
Date Wed, 26 Jul 2017 10:44:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a19cac753 -> 6d0708bed


AMBARI-21428 Host Versions Page Doesn't Show Stacks From Different Vendors. (atkach)


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

Branch: refs/heads/trunk
Commit: 6d0708bed6bf5233b556dd7955f4e49c2544c4e1
Parents: a19cac7
Author: Andrii Tkach <atkach@apache.org>
Authored: Wed Jul 26 13:15:06 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Wed Jul 26 13:15:06 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/global/cluster_controller.js |  1 +
 ambari-web/app/mappers/hosts_mapper.js                  | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d0708be/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index e68f281..586a457 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -335,6 +335,7 @@ App.ClusterController = Em.Controller.extend(App.ReloadPopupMixin, {
       }
 
       upgradeController.loadStackVersionsToModel(true).done(function () {
+        upgradeController.loadCompatibleVersions();
         App.set('stackVersionsAvailable', App.StackVersion.find().content.length > 0);
       });
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6d0708be/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js
index e536269..c2c69ca 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -171,9 +171,17 @@ App.hostsMapper = App.QuickDataMapper.create({
           ? Em.get(currentVersion.repository_versions[0], 'RepositoryVersions.repository_version')
: '';
         for (var j = 0; j < item.stack_versions.length; j++) {
           var stackVersion = item.stack_versions[j];
+          var versionNumber = Em.get(stackVersion.repository_versions[0], 'RepositoryVersions.repository_version');
+          var isDifferentStack = currentVersion && (stackVersion.HostStackVersions.stack
!== currentVersion.HostStackVersions.stack);
+          var isCompatible = App.RepositoryVersion.find(Em.get(stackVersion.repository_versions[0],
'RepositoryVersions.id')).get('isCompatible');
           stackVersion.host_name = item.Hosts.host_name;
-          stackVersion.is_visible = stringUtils.compareVersions(Em.get(stackVersion.repository_versions[0],
'RepositoryVersions.repository_version'), currentVersionNumber) >= 0
-            || App.get('supports.displayOlderVersions') || !currentVersionNumber;
+          if (isDifferentStack && !isCompatible) {
+            stackVersion.is_visible = false;
+          } else {
+            stackVersion.is_visible = isDifferentStack
+            || (App.get('supports.displayOlderVersions') || stringUtils.compareVersions(versionNumber,
currentVersionNumber) >= 0)
+            || !currentVersionNumber;
+          }
           stackVersions.push(this.parseIt(stackVersion, this.stackVersionConfig));
         }
 


Mime
View raw message