ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-8389. Alerts UI: Clicking on host of alert-instance in alert-details pages should go to host's alerts page (srimanth)
Date Wed, 19 Nov 2014 23:39:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b0d0552e7 -> 7414a35fa


AMBARI-8389. Alerts UI: Clicking on host of alert-instance in alert-details pages should go
to host's alerts page (srimanth)


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

Branch: refs/heads/trunk
Commit: 7414a35faa8982b38b4df165b6abfac26bcc2800
Parents: b0d0552
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Wed Nov 19 14:40:25 2014 -0800
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Wed Nov 19 15:36:40 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/config.js                        |  2 +-
 .../alerts/definition_details_controller.js     |  6 ++++--
 .../main/alerts/definition_details.hbs          |  2 +-
 .../global/update_controller_test.js            |  2 +-
 .../definitions_details_controller_test.js      | 21 ++++++++++++++++++++
 5 files changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7414a35f/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index aa692d0..13901a1 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -59,7 +59,7 @@ App.enableExperimental = false;
 App.supports = {
   stackUpgrade: false,
   autoRollbackHA: false,
-  alerts: false,
+  alerts: true,
   alwaysEnableManagedMySQLForHive: false
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7414a35f/ambari-web/app/controllers/main/alerts/definition_details_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/definition_details_controller.js b/ambari-web/app/controllers/main/alerts/definition_details_controller.js
index 29fbe9b..247c5d8 100644
--- a/ambari-web/app/controllers/main/alerts/definition_details_controller.js
+++ b/ambari-web/app/controllers/main/alerts/definition_details_controller.js
@@ -137,7 +137,9 @@ App.MainAlertDefinitionDetailsController = Em.Controller.extend({
    * Router transition to host level alerts page
    * @param event
    */
-  goToHostDetails: function (event) {
-    // todo: provide transition to host level alert details
+  goToHostAlerts: function (event) {
+    if (event && event.context) {
+      App.router.transitionTo('main.hosts.hostDetails.alerts', event.context);
+    }
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/7414a35f/ambari-web/app/templates/main/alerts/definition_details.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/definition_details.hbs b/ambari-web/app/templates/main/alerts/definition_details.hbs
index 96b103f..5027309 100644
--- a/ambari-web/app/templates/main/alerts/definition_details.hbs
+++ b/ambari-web/app/templates/main/alerts/definition_details.hbs
@@ -140,7 +140,7 @@
           {{#each instance in view.pageContent}}
             <tr>
               <td class="first">{{instance.state}}</td>
-              <td><a {{action goToHostDetails instance.hostName target="view"}}>{{instance.host.hostName}}</a></td>
+              <td><a {{action goToHostAlerts instance.host target="controller"}}
href="#">{{instance.host.hostName}}</a></td>
               <td>{{instance.lastTriggered}}</td>
               <td>10</td>
               <td class="last">Admins</td>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7414a35f/ambari-web/test/controllers/global/update_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/global/update_controller_test.js b/ambari-web/test/controllers/global/update_controller_test.js
index 960a83f..4f76a2a 100644
--- a/ambari-web/test/controllers/global/update_controller_test.js
+++ b/ambari-web/test/controllers/global/update_controller_test.js
@@ -62,7 +62,7 @@ describe('App.UpdateController', function () {
 
     it('isWorking = true', function () {
       controller.set('isWorking', true);
-      expect(App.updater.run.callCount).to.equal(7);
+      expect(App.updater.run.callCount).to.equal(9);
     });
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7414a35f/ambari-web/test/controllers/main/alerts/definitions_details_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/alerts/definitions_details_controller_test.js
b/ambari-web/test/controllers/main/alerts/definitions_details_controller_test.js
index 5e19bad..5e53b89 100644
--- a/ambari-web/test/controllers/main/alerts/definitions_details_controller_test.js
+++ b/ambari-web/test/controllers/main/alerts/definitions_details_controller_test.js
@@ -93,5 +93,26 @@ describe('App.MainAlertDefinitionDetailsController', function () {
     });
 
   });
+  
+  describe("#goToHostAlerts()", function() {
+    beforeEach(function() {
+      sinon.stub(App.get('router'), 'transitionTo', Em.K);
+    });
+    afterEach(function() {
+     App.get('router').transitionTo.restore();
+    });
+    it("not route to host - no event", function() {
+      controller.goToHostAlerts(null);
+      expect(App.get('router').transitionTo.notCalled).to.be.true;
+    });
+    it("not route to host - no event context", function() {
+      controller.goToHostAlerts({});
+      expect(App.get('router').transitionTo.notCalled).to.be.true;
+    });
+    it("routes to host", function() {
+      controller.goToHostAlerts({"context": "hostname"});
+      expect(App.get('router').transitionTo.calledOnce).to.be.true;
+    });
+  });
 
 });


Mime
View raw message