From 40f0cdd18d7415c7e6be57d3198b87e1bc1119d0 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sun, 28 Jun 2020 16:58:18 +0200 Subject: [PATCH] #1410 Update alert list: status column, quick filters --- .../controllers/alert/AlertListCtrl.js | 28 +++++++++---------- frontend/app/views/partials/alert/list.html | 17 ++++------- .../views/partials/alert/list/toolbar.html | 17 ++++++----- 3 files changed, 28 insertions(+), 34 deletions(-) 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 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c {{::event.sourceRef}} - + @@ -122,14 +122,13 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c {{::event.type}} - {{::event.status}} - {{event.case ? 'Imported' : 'New'}} + {{event.caseId ? 'Imported' : 'New'}}
- {{::event.title}} - + {{::event.title}} + {{::event.title}} @@ -139,10 +138,6 @@

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

- {{event.source}} @@ -189,10 +184,10 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c diff --git a/frontend/app/views/partials/alert/list/toolbar.html b/frontend/app/views/partials/alert/list/toolbar.html index 74041af749..056f21539d 100644 --- a/frontend/app/views/partials/alert/list/toolbar.html +++ b/frontend/app/views/partials/alert/list/toolbar.html @@ -47,23 +47,22 @@