Skip to content

Commit

Permalink
#1848 Add case quick filters related to case owners
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Mar 17, 2021
1 parent 45c3528 commit 3fea699
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
38 changes: 38 additions & 0 deletions frontend/app/scripts/controllers/case/CaseListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 7 additions & 0 deletions frontend/app/views/partials/case/case.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ <h3 class="box-title">List of cases ({{$vm.list.total || 0}} of {{$vm.caseCount}
</a>
</div>

<div class="clearfix mt-xxs">
<a ui-sref="app.case.procedures({caseId: currentCase._id})">
<span>TTPs</span>
<strong class="pull-right">{{currentCase.extraData.procedureCount || 0}}</strong>
</a>
</div>

</td>
<td class="nowrap">
<user user-id="currentCase.assignee" icon-only="true" icon-size="m"></user>
Expand Down
7 changes: 7 additions & 0 deletions frontend/app/views/partials/case/list/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
<li>
<a ng-click="$vm.filterMyCases()"><i class="fa fa-user"></i> My cases</a>
</li>
<li class="divider"></li>
<li>
<a ng-click="$vm.filterMyOrgCases()"><i class="fa fa-building-o"></i> Owned by my org</a>
</li>
<li>
<a ng-click="$vm.filterSharedWithMyOrg()"><i class="fa fa-share-square"></i> Shared with my org</a>
</li>
</ul>
</div>

Expand Down

0 comments on commit 3fea699

Please sign in to comment.