From 3fea6996ca14b8c393968f9702a37f501f80ffaa Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Wed, 17 Mar 2021 17:53:08 +0100 Subject: [PATCH] #1848 Add case quick filters related to case owners --- .../scripts/controllers/case/CaseListCtrl.js | 38 +++++++++++++++++++ .../app/views/partials/case/case.list.html | 7 ++++ .../app/views/partials/case/list/toolbar.html | 7 ++++ 3 files changed, 52 insertions(+) diff --git a/frontend/app/scripts/controllers/case/CaseListCtrl.js b/frontend/app/scripts/controllers/case/CaseListCtrl.js index f55b8aa2b0..2d1202f50f 100644 --- a/frontend/app/scripts/controllers/case/CaseListCtrl.js +++ b/frontend/app/scripts/controllers/case/CaseListCtrl.js @@ -227,6 +227,44 @@ }); }; + this.filterMyOrgCases = function() { + this.filtering.clearFilters() + .then(function() { + var currentUser = AuthenticationSrv.currentUser; + self.filtering.addFilter({ + field: 'owningOrganisation', + type: 'string', + value: { + operator: 'all', + list: [{ + text: currentUser.organisation, + label: currentUser.organisation + }] + } + }); + self.search(); + }); + }; + + this.filterSharedWithMyOrg = function() { + this.filtering.clearFilters() + .then(function() { + var currentUser = AuthenticationSrv.currentUser; + self.filtering.addFilter({ + field: 'owningOrganisation', + type: 'string', + value: { + operator: 'none', + list: [{ + text: currentUser.organisation, + label: currentUser.organisation + }] + } + }); + self.search(); + }); + }; + this.filterMyOpenCases = function() { this.filtering.clearFilters() .then(function() { diff --git a/frontend/app/views/partials/case/case.list.html b/frontend/app/views/partials/case/case.list.html index 87082cb127..04dc3a3e6e 100644 --- a/frontend/app/views/partials/case/case.list.html +++ b/frontend/app/views/partials/case/case.list.html @@ -199,6 +199,13 @@

List of cases ({{$vm.list.total || 0}} of {{$vm.caseCount} + + diff --git a/frontend/app/views/partials/case/list/toolbar.html b/frontend/app/views/partials/case/list/toolbar.html index f503e1f0cb..d4a04f62e1 100644 --- a/frontend/app/views/partials/case/list/toolbar.html +++ b/frontend/app/views/partials/case/list/toolbar.html @@ -51,6 +51,13 @@
  • My cases
  • +
  • +
  • + Owned by my org +
  • +
  • + Shared with my org +