diff --git a/frontend/app/scripts/controllers/alert/AlertEventCtrl.js b/frontend/app/scripts/controllers/alert/AlertEventCtrl.js index 8893e791c2..de9da65bd0 100644 --- a/frontend/app/scripts/controllers/alert/AlertEventCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertEventCtrl.js @@ -3,7 +3,7 @@ angular.module('theHiveControllers') .controller('AlertEventCtrl', function($scope, $rootScope, $state, $uibModal, $uibModalInstance, ModalUtilsSrv, AuthenticationSrv, CustomFieldsSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, UiSettingsSrv, clipboard, event, templates, readonly) { var self = this; - var eventId = event.id; + var eventId = event._id; self.readonly = readonly; self.templates = _.pluck(templates, 'name'); @@ -101,7 +101,7 @@ var field = {}; field[fieldName] = newValue; - return AlertingSrv.update(self.event.id, field) + return AlertingSrv.update(self.event._id, field) .then(function() { NotificationSrv.log('Alert updated successfully', 'success'); }) @@ -112,7 +112,7 @@ self.import = function() { self.loading = true; - AlertingSrv.create(self.event.id, { + AlertingSrv.create(self.event._id, { caseTemplate: self.event.caseTemplate }).then(function(response) { $uibModalInstance.dismiss(); @@ -130,7 +130,7 @@ self.mergeIntoCase = function(caseId) { self.loading = true; - AlertingSrv.mergeInto(self.event.id, caseId) + AlertingSrv.mergeInto(self.event._id, caseId) .then(function(response) { $uibModalInstance.dismiss(); @@ -182,7 +182,7 @@ fn = AlertingSrv.follow; } - fn(self.event.id).then(function() { + fn(self.event._id).then(function() { $uibModalInstance.close(); }).catch(function(response) { NotificationSrv.error('AlertEventCtrl', response.data, response.status); @@ -194,7 +194,7 @@ okText: 'Yes, remove it', flavor: 'danger' }).then(function() { - AlertingSrv.forceRemove(self.event.id) + AlertingSrv.forceRemove(self.event._id) .then(function() { $uibModalInstance.close(); NotificationSrv.log('Alert has been permanently deleted', 'success'); @@ -218,7 +218,7 @@ fn = AlertingSrv.markAsUnread; } - fn(this.event.id).then(function( /*data*/ ) { + fn(this.event._id).then(function( /*data*/ ) { $uibModalInstance.close(); }, function(response) { NotificationSrv.error('AlertEventCtrl', response.data, response.status); diff --git a/frontend/app/scripts/controllers/alert/AlertListCtrl.js b/frontend/app/scripts/controllers/alert/AlertListCtrl.js index e758d2b53f..a9c5eceeb5 100755 --- a/frontend/app/scripts/controllers/alert/AlertListCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertListCtrl.js @@ -86,7 +86,7 @@ fn = AlertingSrv.markAsUnread; } - fn(event.id).then(function( /*data*/ ) { + fn(event._id).then(function( /*data*/ ) { }, function(response) { NotificationSrv.error('AlertListCtrl', response.data, response.status); }); @@ -101,7 +101,7 @@ fn = AlertingSrv.follow; } - fn(event.id).then(function( /*data*/ ) { + fn(event._id).then(function( /*data*/ ) { }, function(response) { NotificationSrv.error('AlertListCtrl', response.data, response.status); }); @@ -251,7 +251,7 @@ self.selection.push(event); } else { self.selection = _.reject(self.selection, function(item) { - return item.id === event.id; + return item._id === event._id; }); } diff --git a/frontend/app/scripts/services/api/AlertingSrv.js b/frontend/app/scripts/services/api/AlertingSrv.js index 3f997fbca3..9a47a891ef 100644 --- a/frontend/app/scripts/services/api/AlertingSrv.js +++ b/frontend/app/scripts/services/api/AlertingSrv.js @@ -59,13 +59,13 @@ alertIds: alertIds }); }, - + canMarkAsRead: function(event) { - return event.status === 'New' || event.status === 'Updated'; + return !!!event.read; }, canMarkAsUnread: function(event) { - return event.status === 'Imported' || event.status === 'Ignored'; + return !!event.read; }, markAsRead: function(alertId) { diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index 0dae1ad8d7..40d326b12e 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -89,6 +89,14 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c + + + By + + + + + @@ -115,6 +123,7 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c {{::event.status}} + {{event.case ? 'Imported' : 'New'}}
@@ -141,10 +150,13 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c

- {{::event.artifacts.length || 0}} + {{::event.observableCount || 0}} {{event.date | shortDate}} + + +
@@ -156,13 +168,13 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c - - + +