You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/05/29 21:30:12 UTC
[2/3] ambari git commit: AMBARI-11534. Hosts Page: remove the
(Current) label (alexantonenko)
AMBARI-11534. Hosts Page: remove the (Current) label (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/337f45e1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/337f45e1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/337f45e1
Branch: refs/heads/trunk
Commit: 337f45e1df7724aef0bdecb95b0a331a76f64513
Parents: f4db014
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri May 29 18:13:15 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Fri May 29 22:30:04 2015 +0300
----------------------------------------------------------------------
ambari-web/app/views/main/host.js | 2 +-
ambari-web/test/views/main/host_test.js | 54 ++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/337f45e1/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 4145608..8c76699 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -625,7 +625,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
*/
currentVersion: function() {
var currentRepoVersion = this.get('content.stackVersions').findProperty('isCurrent') || this.get('content.stackVersions').objectAt(0);
- return currentRepoVersion ? currentRepoVersion.get('displayName') + " (" + currentRepoVersion.get('displayStatus') + ")" : "";
+ return currentRepoVersion ? currentRepoVersion.get('displayName') : "";
}.property('content.stackVersions'),
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/337f45e1/ambari-web/test/views/main/host_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host_test.js b/ambari-web/test/views/main/host_test.js
index 8a0624b..b438b60 100644
--- a/ambari-web/test/views/main/host_test.js
+++ b/ambari-web/test/views/main/host_test.js
@@ -194,6 +194,60 @@ describe('App.MainHostView', function () {
});
+ describe('#currentVersion', function () {
+
+ var cases = [
+ {
+ stackVersions: [
+ Em.Object.create({
+ displayName: 'HDP-2.2.0.0-2000'
+ }),
+ Em.Object.create({
+ displayName: 'HDP-2.2.0.0-1000',
+ isCurrent: true
+ })
+ ],
+ currentVersion: 'HDP-2.2.0.0-1000',
+ title: 'current version specified explicitly'
+ },
+ {
+ stackVersions: [
+ Em.Object.create({
+ displayName: 'HDP-2.2.0.0-2000'
+ }),
+ Em.Object.create({
+ displayName: 'HDP-2.3.0.0-1000'
+ })
+ ],
+ currentVersion: 'HDP-2.2.0.0-2000',
+ title: 'current version not specified explicitly'
+ },
+ {
+ stackVersions: [Em.Object.create()],
+ currentVersion: undefined,
+ title: 'version display name isn\'t defined'
+ },
+ {
+ stackVersions: [null],
+ currentVersion: '',
+ title: 'no version data available'
+ },
+ {
+ stackVersions: [],
+ currentVersion: '',
+ title: 'no versions available'
+ }
+ ];
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ hostView.set('content.stackVersions', item.stackVersions);
+ expect(hostView.get('currentVersion')).to.equal(item.currentVersion);
+ });
+ });
+
+ });
+
});
});