diff --git a/frontend/app/scripts/controllers/alert/AlertEventCtrl.js b/frontend/app/scripts/controllers/alert/AlertEventCtrl.js index 0f89cddab1..ff541d6bd3 100644 --- a/frontend/app/scripts/controllers/alert/AlertEventCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertEventCtrl.js @@ -1,7 +1,7 @@ (function () { 'use strict'; angular.module('theHiveControllers') - .controller('AlertEventCtrl', function ($scope, $rootScope, $state, $uibModal, $uibModalInstance, ModalUtilsSrv, AuthenticationSrv, CustomFieldsSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, UiSettingsSrv, clipboard, event, templates, readonly) { + .controller('AlertEventCtrl', function ($scope, $rootScope, $state, $uibModal, $uibModalInstance, ModalUtilsSrv, TagSrv, AuthenticationSrv, CustomFieldsSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, UiSettingsSrv, clipboard, event, templates, readonly) { var self = this; var eventId = event._id; @@ -35,6 +35,20 @@ return 'customFields.' + fieldDef.reference + '.' + fieldDef.type; }; + self.getTags = function (selection) { + var tags = []; + + angular.forEach(selection, function (tag) { + tags.push(tag.text); + }); + + return tags; + }; + + self.getAlertTags = function (query) { + return TagSrv.autoComplete(query); + }; + self.load = function () { AlertingSrv.get(eventId).then(function (data) { self.event = data; diff --git a/frontend/app/views/directives/flow/alert.html b/frontend/app/views/directives/flow/alert.html index c6cb860356..ea566076fd 100644 --- a/frontend/app/views/directives/flow/alert.html +++ b/frontend/app/views/directives/flow/alert.html @@ -1,4 +1,4 @@ -