From 8f0724132f9fb9dbbbd516461ef52302f9515e64 Mon Sep 17 00:00:00 2001 From: Zachary Priddy Date: Thu, 14 Mar 2019 21:27:25 -0700 Subject: [PATCH 01/18] Add new quickfilters --- ui/app/scripts/controllers/alert/AlertListCtrl.js | 8 ++++++++ ui/app/scripts/controllers/case/CaseListCtrl.js | 15 +++++++++++++++ ui/app/views/partials/alert/list/toolbar.html | 4 ++++ ui/app/views/partials/case/list/toolbar.html | 3 +++ 4 files changed, 30 insertions(+) diff --git a/ui/app/scripts/controllers/alert/AlertListCtrl.js b/ui/app/scripts/controllers/alert/AlertListCtrl.js index ba6c919b31..409d94d470 100755 --- a/ui/app/scripts/controllers/alert/AlertListCtrl.js +++ b/ui/app/scripts/controllers/alert/AlertListCtrl.js @@ -501,6 +501,14 @@ }); }; + this.filterByNewAndUpdated = function() { + self.filtering.clearFilters() + .then(function(){ + self.addFilterValue('status', 'New'); + self.addFilterValue('status', 'Updated'); + }); + }; + this.filterBySeverity = function(numericSev) { self.addFilterValue('severity', Severity.values[numericSev]); }; diff --git a/ui/app/scripts/controllers/case/CaseListCtrl.js b/ui/app/scripts/controllers/case/CaseListCtrl.js index e058e0e345..0997c18634 100644 --- a/ui/app/scripts/controllers/case/CaseListCtrl.js +++ b/ui/app/scripts/controllers/case/CaseListCtrl.js @@ -199,6 +199,21 @@ }); }; + this.filterMyOpenCases = function() { + this.uiSrv.clearFilters() + .then(function(){ + var currentUser = AuthenticationSrv.currentUser; + self.uiSrv.activeFilters.owner = { + value: [{ + text: currentUser.id, + label: currentUser.name + }] + }; + self.filter(); + self.addFilterValue('status', 'Open'); + }); + }; + this.filterByStatus = function(status) { this.uiSrv.clearFilters() .then(function(){ diff --git a/ui/app/views/partials/alert/list/toolbar.html b/ui/app/views/partials/alert/list/toolbar.html index 9f8d5cd70b..e887d13cf0 100644 --- a/ui/app/views/partials/alert/list/toolbar.html +++ b/ui/app/views/partials/alert/list/toolbar.html @@ -42,12 +42,16 @@ diff --git a/ui/app/views/partials/case/list/toolbar.html b/ui/app/views/partials/case/list/toolbar.html index a516b16b0f..b837230665 100644 --- a/ui/app/views/partials/case/list/toolbar.html +++ b/ui/app/views/partials/case/list/toolbar.html @@ -9,6 +9,9 @@