Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 785DA10626 for ; Wed, 19 Nov 2014 23:39:44 +0000 (UTC) Received: (qmail 98478 invoked by uid 500); 19 Nov 2014 23:39:44 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 98450 invoked by uid 500); 19 Nov 2014 23:39:44 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 98441 invoked by uid 99); 19 Nov 2014 23:39:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2014 23:39:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 167CF945C14; Wed, 19 Nov 2014 23:39:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: srimanth@apache.org To: commits@ambari.apache.org Message-Id: <98d3f604539a46d5b2684e6c2db866cf@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 Authored: Wed Nov 19 14:40:25 2014 -0800 Committer: Srimanth Gunturi 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}} {{instance.state}} - {{instance.host.hostName}} + {{instance.host.hostName}} {{instance.lastTriggered}} 10 Admins 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; + }); + }); });