TSK-739 - Fix task list filtering
This commit is contained in:
parent
6d455e29cc
commit
12b5fb1f0a
|
@ -63,7 +63,9 @@ public class TaskController extends AbstractPagingController {
|
|||
private static final String STATE_VALUE_READY = "READY";
|
||||
private static final String PRIORITY = "priority";
|
||||
private static final String NAME = "name";
|
||||
private static final String NAME_LIKE = "name-like";
|
||||
private static final String OWNER = "owner";
|
||||
private static final String OWNER_LIKE = "owner-like";
|
||||
private static final String DOMAIN = "domain";
|
||||
private static final String WORKBASKET_ID = "workbasket-id";
|
||||
private static final String WORKBASKET_KEY = "workbasket-key";
|
||||
|
@ -219,6 +221,10 @@ public class TaskController extends AbstractPagingController {
|
|||
taskQuery.nameIn(names);
|
||||
params.remove(NAME);
|
||||
}
|
||||
if (params.containsKey(NAME_LIKE)) {
|
||||
taskQuery.nameLike(LIKE + params.get(NAME_LIKE).get(0) + LIKE);
|
||||
params.remove(NAME_LIKE);
|
||||
}
|
||||
if (params.containsKey(PRIORITY)) {
|
||||
String[] prioritiesInString = extractCommaSeparatedFields(params.get(PRIORITY));
|
||||
int[] priorities = extractPriorities(prioritiesInString);
|
||||
|
@ -262,6 +268,10 @@ public class TaskController extends AbstractPagingController {
|
|||
taskQuery.ownerIn(owners);
|
||||
params.remove(OWNER);
|
||||
}
|
||||
if (params.containsKey(OWNER_LIKE)) {
|
||||
taskQuery.ownerLike(LIKE + params.get(OWNER_LIKE).get(0) + LIKE);
|
||||
params.remove(OWNER_LIKE);
|
||||
}
|
||||
if (params.containsKey(POR_COMPANY)) {
|
||||
String[] companies = extractCommaSeparatedFields(params.get(POR_COMPANY));
|
||||
taskQuery.primaryObjectReferenceCompanyIn(companies);
|
||||
|
|
|
@ -65,13 +65,23 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-xs-offset-2">
|
||||
<input type="text" [(ngModel)]="filter.filterParams.state" (keyup.enter)="search()" class="form-control" id="display-owner-state"
|
||||
placeholder="Filter status">
|
||||
<div class="dropdown col-xs-2 col-xs-offset-2">
|
||||
<button class="btn btn-default" data-toggle="dropdown" type="button" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="true" title="State: {{filter.filterParams.state ? filter.filterParams?.state : 'All'}}">
|
||||
<span>{{filter.filterParams.state ? filter.filterParams?.state : 'All'}}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-users" role="menu">
|
||||
<li>
|
||||
<a *ngFor="let state of allStates | mapValues" type="button" (click)="selectState(state.key); search()"
|
||||
data-toggle="tooltip" [title]="state.value">
|
||||
<label class="blue">{{state.value}}</label>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<button (click)="search()" type="button" class="btn btn-default pull-right margin-right" data-toggle="tooltip"
|
||||
title="Search">
|
||||
<span class="material-icons md-20 blue ">search</span>
|
||||
<span class="material-icons md-20 blue">search</span>
|
||||
</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -23,3 +23,11 @@ row.padding {
|
|||
.filter-list > li {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #2e9eca;
|
||||
}
|
||||
|
||||
button.btn.btn-default.pull-right.margin-right {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@ export class FilterComponent implements OnInit {
|
|||
@Input() allTypes: Map<string, string> = new Map([['ALL', 'All'], ['PERSONAL', 'Personal'], ['GROUP', 'Group'],
|
||||
['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]);
|
||||
|
||||
@Input() allStates: Map<string, string> = new Map([['ALL', 'All'], ['READY', 'Ready'], ['CLAIMED', 'Claimed'],
|
||||
['COMPLETED', 'Completed']]);
|
||||
|
||||
@Input() filterParams = { name: '', key: '', type: '', description: '', owner: '' };
|
||||
|
||||
@Input() filterType = TaskanaType.WORKBASKETS;
|
||||
|
@ -24,9 +27,6 @@ export class FilterComponent implements OnInit {
|
|||
lastFilterKey: string;
|
||||
toggleDropDown = false;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initializeFilterModel();
|
||||
if (this.filterParams) {
|
||||
|
@ -39,6 +39,10 @@ export class FilterComponent implements OnInit {
|
|||
this.filter.filterParams.type = (type === ICONTYPES.ALL) ? '' : type;
|
||||
}
|
||||
|
||||
selectState(state: ICONTYPES) {
|
||||
this.filter.filterParams.state = (state === 'ALL') ? '' : state;
|
||||
}
|
||||
|
||||
clear() {
|
||||
for (const key of Object.keys(this.filterParams)) {
|
||||
this.filterParams[key] = '';
|
||||
|
|
|
@ -14,7 +14,7 @@ export class TaskanaQueryParameters {
|
|||
static WORKBASKET_KEY = 'workbasket-key';
|
||||
static KEYLIKE = 'key-like';
|
||||
static PRIORITY = 'priority';
|
||||
static STATELIKE = 'state-like';
|
||||
static STATE = 'state';
|
||||
static WORKBASKET_ID = 'workbasket-id';
|
||||
static TASK_PRIMARY_OBJ_REF_TYPE_LIKE = 'por.type';
|
||||
static TASK_PRIMARY_OBJ_REF_VALUE_LIKE = 'por.value';
|
||||
|
@ -54,9 +54,9 @@ export class TaskanaQueryParameters {
|
|||
workbasketKeyLike: string = undefined,
|
||||
basketId: string = undefined,
|
||||
priority: string = undefined,
|
||||
stateLike: string = undefined,
|
||||
state: string = undefined,
|
||||
objRefTypeLike: string = undefined,
|
||||
objRefValueLike: string = undefined,
|
||||
objRefValueLike: string = undefined
|
||||
): string {
|
||||
let query = '?';
|
||||
query += sortBy ? `${this.SORTBY}=${sortBy}&` : '';
|
||||
|
@ -68,7 +68,7 @@ export class TaskanaQueryParameters {
|
|||
query += ownerLike ? `${this.OWNERLIKE}=${ownerLike}&` : '';
|
||||
query += basketId ? `${this.WORKBASKET_ID}=${basketId}&` : '';
|
||||
query += priority ? `${this.PRIORITY}=${priority}&` : '';
|
||||
query += stateLike ? `${this.STATELIKE}=${stateLike}&` : '';
|
||||
query += state ? `${this.STATE}=${state}&` : '';
|
||||
query += type ? `${this.TYPE}=${type}&` : '';
|
||||
query += key ? `${this.KEY}=${key}&` : '';
|
||||
query += keyLike ? `${this.KEYLIKE}=${keyLike}&` : '';
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
<input [(ngModel)]="resultName" *ngIf="searchSelected === search.byWorkbasket" [typeahead]="workbasketNames"
|
||||
class="form-control" (typeaheadOnSelect)="searchBasket()" (typeaheadNoResults)="workbasketSelected = false"
|
||||
placeholder="Search for Workbasket ..." />
|
||||
<div class="input-group" style="margin-bottom: 1px;" *ngIf="searchSelected === search.byTypeAndValue">
|
||||
<div class="input-group" *ngIf="searchSelected === search.byTypeAndValue">
|
||||
<input [(ngModel)]="resultType" class="form-control" (keyup.enter)="searchBasket()" placeholder="Search by type ..." />
|
||||
<span _ngcontent-c10="" class="input-group-btn">
|
||||
<button _ngcontent-c10="" class="btn btn-primary" style="height: 34px;" type="button" (click)="searchBasket()">
|
||||
<button _ngcontent-c10="" class="btn btn-primary" type="button" (click)="searchBasket()">
|
||||
<span class="material-icons md-20 white">search</span>
|
||||
</button>
|
||||
</span>
|
||||
|
@ -37,13 +37,13 @@
|
|||
<h5 class="bold-blue align-center">Search by</h5>
|
||||
</div>
|
||||
<div role="separator" class="divider"></div>
|
||||
<ul style="padding: 15px;">
|
||||
<ul>
|
||||
<li data-toggle="tooltip" title="Workbasket">
|
||||
<a class="dropdown-item" (click)="selectSearch(search.byWorkbasket)">
|
||||
<label>
|
||||
<span class="material-icons md-20 blue margin-right" aria-hidden="true">{{ searchSelected === search.byWorkbasket ? 'check_box': 'check_box_outline_blank' }}</span>
|
||||
<svg-icon class="margin-right" src="./assets/icons/wb-empty.svg"></svg-icon>
|
||||
<small class="margin-right blue-font" style="margin-left: 4px;">Workbasket</small>
|
||||
<small class="margin-right blue-font">Workbasket</small>
|
||||
</label>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -44,3 +44,19 @@ svg-icon.blue {
|
|||
padding-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
small.margin-right.blue-font {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
div.dropdown-menu ul {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
div.input-group {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
button.btn.btn-primary {
|
||||
height: 34px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue