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-15243. Message for Ambari admin user isn't displayed in User Settings popup (alexantonenko)
Date Tue, 01 Mar 2016 16:20:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8db1e302a -> 4c5e03b84


AMBARI-15243. Message for Ambari admin user isn't displayed in User Settings popup (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 4c5e03b849805a8d64d1fc2e925709d078d5c467
Parents: 8db1e30
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Tue Mar 1 13:25:21 2016 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Tue Mar 1 18:20:20 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                   |  1 +
 ambari-web/app/router.js                     |  2 +-
 ambari-web/app/templates/common/settings.hbs |  4 +-
 ambari-web/test/router_test.js               | 79 +++++++++++++++++++++++
 4 files changed, 83 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5e03b8/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index a74c5bc..d0c8840 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -53,6 +53,7 @@ Em.I18n.translations = {
   'app.settings.no.cluster.privileges': 'No cluster privileges',
   'app.settings.admin.all.privileges': 'This user is an Ambari Admin and has all privileges.',
   'app.settings.no.privileges': 'This user does not have any privileges.',
+  'app.settings.clusterRole': 'Cluster Role',
   'app.settings.viewPermissions': 'View Permissions',
 
   'app.aboutAmbari.getInvolved': 'Get involved!',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5e03b8/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index f121fe5..d2fb714 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -406,7 +406,7 @@ App.Router = Em.Router.extend({
       self = this,
       requestData = {
         loginName: params.loginName,
-        loginData: data
+        loginData: params.loginData
       };
     // no need to load cluster data if it's already loaded
     if (this.get('clusterData')) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5e03b8/ambari-web/app/templates/common/settings.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/settings.hbs b/ambari-web/app/templates/common/settings.hbs
index 1669a99..953d5ff 100644
--- a/ambari-web/app/templates/common/settings.hbs
+++ b/ambari-web/app/templates/common/settings.hbs
@@ -44,8 +44,8 @@
       <table class="table">
         <thead>
         <tr>
-          <th>Cluster</th>
-          <th>Cluster Role</th>
+          <th>{{t common.cluster}}</th>
+          <th>{{t app.settings.clusterRole}}</th>
         </tr>
         </thead>
         <tbody>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5e03b8/ambari-web/test/router_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/router_test.js b/ambari-web/test/router_test.js
index 7bd2c80..1b1ee51 100644
--- a/ambari-web/test/router_test.js
+++ b/ambari-web/test/router_test.js
@@ -497,4 +497,83 @@ describe('App.Router', function () {
 
   });
 
+  describe('#setClusterData', function () {
+
+    var data = {
+        loginName: 'user',
+        loginData: {
+          PrivilegeInfo: {}
+        }
+      },
+      clusterData = {
+        items: []
+      },
+      cases = [
+        {
+          clusterData: clusterData,
+          callbackCallCount: 1,
+          isAjaxCalled: false,
+          title: 'cluster data available'
+        },
+        {
+          clusterData: null,
+          callbackCallCount: 0,
+          isAjaxCalled: true,
+          title: 'no cluster data'
+        }
+      ];
+
+    beforeEach(function () {
+      sinon.stub(router, 'loginGetClustersSuccessCallback', Em.K);
+    });
+
+    afterEach(function () {
+      router.loginGetClustersSuccessCallback.restore();
+    });
+
+    cases.forEach(function (item) {
+
+      describe(item.title, function () {
+
+        var ajaxCallArgs;
+
+        beforeEach(function () {
+          router.set('clusterData', item.clusterData);
+          router.setClusterData({}, {}, data);
+          ajaxCallArgs = testHelpers.findAjaxRequest('name', 'router.login.clusters');
+        });
+
+        it('loginGetClustersSuccessCallback', function () {
+          expect(router.loginGetClustersSuccessCallback.callCount).to.equal(item.callbackCallCount);
+        });
+
+        if (item.isAjaxCalled) {
+          it('App.ajax.send is called', function () {
+            expect(ajaxCallArgs).to.have.length(1);
+          });
+          it('data for AJAX request', function () {
+            expect(ajaxCallArgs).to.eql([
+              {
+                name: 'router.login.clusters',
+                sender: router,
+                data: data,
+                success: 'loginGetClustersSuccessCallback'
+              }
+            ]);
+          });
+        } else {
+          it('App.ajax.send is not called', function () {
+            expect(ajaxCallArgs).to.be.undefined;
+          });
+          it('arguments for callback', function () {
+            expect(router.loginGetClustersSuccessCallback.firstCall.args).to.eql([clusterData,
{}, data]);
+          });
+        }
+
+      });
+
+    });
+
+  });
+
 });


Mime
View raw message