diff --git a/frontend/app/scripts/controllers/alert/AlertListCtrl.js b/frontend/app/scripts/controllers/alert/AlertListCtrl.js index b72d5bf2ea..e112f22ff0 100755 --- a/frontend/app/scripts/controllers/alert/AlertListCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertListCtrl.js @@ -31,17 +31,9 @@ sort: ['-date'] }, defaultFilter: [{ - field: 'status', - type: 'enumeration', - value: { - list: [{ - text: 'New', - label: 'New' - }, { - text: 'Updated', - label: 'Updated' - }] - } + field: 'imported', + type: 'boolean', + value: false }] }); self.filtering.initContext('list') @@ -408,17 +400,18 @@ this.search(); }; - this.filterByStatus = function(status) { + this.filterByStatus = function(flag) { self.filtering.clearFilters() .then(function(){ - self.addFilterValue('status', status); + self.addFilterValue('imported', flag); }); }; this.filterByNewAndUpdated = function() { self.filtering.clearFilters() .then(function(){ - self.addFilterValue('status', ['New', 'Updated']); + // TODO nadouani: how to support updated alerts + self.addFilterValue('imported', true); }); }; @@ -426,6 +419,13 @@ self.addFilterValue('severity', Severity.values[numericSev]); }; + this.filterBy = function(field, value) { + self.filtering.clearFilters() + .then(function(){ + self.addFilterValue(field, value); + }); + }; + this.sortBy = function(sort) { self.list.sort = sort; self.list.update(); diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index 40d326b12e..06d996f7d5 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -111,7 +111,7 @@