You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/01/27 13:17:13 UTC

ambari git commit: AMBARI-9350 Ui not able to load host page, should be robust when host_version not yet created. (atkach)

Repository: ambari
Updated Branches:
  refs/heads/trunk d2f332603 -> 02190c4f3


AMBARI-9350 Ui not able to load host page, should be robust when host_version not yet created. (atkach)


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

Branch: refs/heads/trunk
Commit: 02190c4f38ba95353730b7cc210d08979d4cb40e
Parents: d2f3326
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Tue Jan 27 13:57:11 2015 +0200
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Tue Jan 27 14:17:05 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/views/main/host.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/02190c4f/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 217ca45..b68e745 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -580,21 +580,21 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
 
     /**
      * true if host has only one repoversion
-     * in this case expander in version columnn is hidden
+     * in this case expander in version column is hidden
      * @returns {Boolean}
      */
     hasSingleVersion: function() {
-      return this.get('content.stackVersions.length') == 1;
+      return this.get('content.stackVersions.length') < 2;
     }.property('content.stackVersions.length'),
 
     /**
      * this version is always shown others hidden unless expander is open
+     * host may have no stack versions
      * @returns {String}
      */
     currentVersion: function() {
-      var currentRepoVersion = this.get('content.stackVersions').findProperty('isCurrent');
-      var version = currentRepoVersion ? currentRepoVersion : this.get('content.stackVersions').filterProperty('isCurrent', false)[0];
-      return version.get('repoVersion') + " (" + version.get('displayStatus') + ")";
+      var currentRepoVersion = this.get('content.stackVersions').findProperty('isCurrent') || this.get('content.stackVersions').objectAt(0);
+      return currentRepoVersion ? currentRepoVersion.get('repoVersion') + " (" + currentRepoVersion.get('displayStatus') + ")" : "";
     }.property('content.stackVersions'),
 
     /**