This is an automated email from the ASF dual-hosted git repository. ababiichuk pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new 3d95ddd AMBARI-23810 Alerts icon is absent in service page if no alerts present. (ababiichuk) 3d95ddd is described below commit 3d95ddd1a160715145434230ab5793999131aa0a Author: ababiichuk <ababiic...@hortonworks.com> AuthorDate: Thu May 10 18:13:16 2018 +0300 AMBARI-23810 Alerts icon is absent in service page if no alerts present. (ababiichuk) --- ambari-web/app/styles/alerts.less | 5 ++++- ambari-web/app/styles/application.less | 5 +++++ ambari-web/app/templates/main/service/info/summary.hbs | 10 ++++------ ambari-web/app/views/main/service/info/summary.js | 4 ++++ ambari-web/test/views/main/service/info/summary_test.js | 4 ++++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ambari-web/app/styles/alerts.less b/ambari-web/app/styles/alerts.less index a3fdf6d..c1b84b5 100644 --- a/ambari-web/app/styles/alerts.less +++ b/ambari-web/app/styles/alerts.less @@ -365,7 +365,7 @@ } .service-block .summary-box-header { - .alerts-crit-count, .alerts-warn-count, .no-alerts-label { + .alerts-crit-count, .alerts-warn-count, .no-alerts-label, .alerts-none-count { padding: 3px 5px; font-size: 10px; border-radius: 50%; @@ -411,6 +411,9 @@ .label.alerts-warn-count { background: @health-status-orange; } +.label.alerts-none-count { + background: @top-nav-ops-count-bg-color; +} .label.no-alerts-label { background: @health-status-green; } diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index 99ccc8a..0c6d524 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -448,6 +448,11 @@ table.diff { cursor: pointer; } +.alerts-none-count { + margin-left: 0; + cursor: pointer; +} + .health-status-HEALTHY, .health-status-LIVE, .health-status-STARTING, .health-status-started, .health-status-starting { color: @health-status-green; } diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs index 39c70f5..c100fca 100644 --- a/ambari-web/app/templates/main/service/info/summary.hbs +++ b/ambari-web/app/templates/main/service/info/summary.hbs @@ -57,12 +57,10 @@ <div class="col-md-4 col-lg-4 service-alerts"> {{#if view.hasAlertDefinitions}} <span {{action "showServiceAlertsPopup" controller.content target="controller"}} class="pull-right"> - {{#if view.alertsCount}} - <i class="glyphicon glyphicon-bell"></i> - <span {{bindAttr class=":label view.hasCriticalAlerts:alerts-crit-count:alerts-warn-count"}}> - {{view.alertsCount}} - </span> - {{/if}} + <i class="glyphicon glyphicon-bell"></i> + <span {{bindAttr class=":label view.hasCriticalAlerts:alerts-crit-count view.hasNonCriticalAlertsOnly:alerts-warn-count view.hasNoAlerts:alerts-none-count"}}> + {{view.alertsCount}} + </span> </span> {{/if}} </div> diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index df7dc91..8ebfb92 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -353,8 +353,12 @@ App.MainServiceInfoSummaryView = Em.View.extend({ alertsCount: Em.computed.alias('controller.content.alertsCount'), + hasNoAlerts: Em.computed.equal('alertsCount', 0), + hasCriticalAlerts: Em.computed.alias('controller.content.hasCriticalAlerts'), + hasNonCriticalAlertsOnly: Em.computed.and('!hasNoAlerts', '!hasCriticalAlerts'), + /** * Define if service has alert definitions defined * @type {Boolean} diff --git a/ambari-web/test/views/main/service/info/summary_test.js b/ambari-web/test/views/main/service/info/summary_test.js index 20ec3dd..03ec08b 100644 --- a/ambari-web/test/views/main/service/info/summary_test.js +++ b/ambari-web/test/views/main/service/info/summary_test.js @@ -44,6 +44,10 @@ describe('App.MainServiceInfoSummaryView', function() { App.TestAliases.testAsComputedAlias(view, 'hasCriticalAlerts', 'controller.content.hasCriticalAlerts', 'boolean'); + App.TestAliases.testAsComputedEqual(view, 'hasNoAlerts', 'alertsCount', 0); + + App.TestAliases.testAsComputedAnd(view, 'hasNonCriticalAlertsOnly', ['!hasNoAlerts', '!hasCriticalAlerts']); + describe('#servers', function () { it('services shouldn\'t have servers except FLUME and ZOOKEEPER', function () { expect(view.get('servers')).to.be.empty; -- To stop receiving notification emails like this one, please contact ababiic...@apache.org.