diff --git a/src/kibana/components/notify/_notifier.js b/src/kibana/components/notify/_notifier.js index 815db944f18670..6543c3dd6209ae 100644 --- a/src/kibana/components/notify/_notifier.js +++ b/src/kibana/components/notify/_notifier.js @@ -55,7 +55,20 @@ define(function (require) { }); } - notifs.push(notif); + if (!notif.count) notif.count = 1; + + var dup = _.find(notifs, function (item) { + return item.content === notif.content + && item.stack === notif.stack + && item.lifetime === notif.lifetime; + }); + + if (dup) { + dup.count++; + } else { + notifs.push(notif); + } + } function formatMsg(msg, from) { diff --git a/src/kibana/components/notify/directives.js b/src/kibana/components/notify/directives.js index f403a41b0b43ee..4c9d9a59d0d65c 100644 --- a/src/kibana/components/notify/directives.js +++ b/src/kibana/components/notify/directives.js @@ -1,5 +1,6 @@ define(function (require) { var notify = require('modules').get('kibana/notify'); + var _ = require('lodash'); notify.directive('kbnNotifications', function () { return { @@ -11,4 +12,4 @@ define(function (require) { template: require('text!components/notify/partials/toaster.html') }; }); -}); \ No newline at end of file +}); diff --git a/src/kibana/components/notify/partials/toaster.html b/src/kibana/components/notify/partials/toaster.html index 70b95bd4927eae..fade7f38334dd9 100644 --- a/src/kibana/components/notify/partials/toaster.html +++ b/src/kibana/components/notify/partials/toaster.html @@ -27,7 +27,7 @@ >Fix it - +  ({{ notif.count }} errors)

@@ -36,4 +36,4 @@
       
- \ No newline at end of file +