Add key filtering

This commit is contained in:
Martin Rojas Miguel Angel 2018-02-21 11:21:10 +01:00 committed by Holger Hagen
parent 274fa67a53
commit da53c87a68
5 changed files with 15 additions and 9 deletions

View File

@ -49,12 +49,13 @@ describe('FilterComponent', () => {
}); });
it('should be able to clear all fields after pressing clear button', () => { it('should be able to clear all fields after pressing clear button', () => {
component.filter = new FilterModel('a','a','a','a'); component.filter = new FilterModel('a','a','a','a','a');
debugElement.querySelector('[title="Clear"]').click(); debugElement.querySelector('[title="Clear"]').click();
expect(component.filter.name).toBe(''); expect(component.filter.name).toBe('');
expect(component.filter.description).toBe(''); expect(component.filter.description).toBe('');
expect(component.filter.owner).toBe(''); expect(component.filter.owner).toBe('');
expect(component.filter.type).toBe(''); expect(component.filter.type).toBe('');
expect(component.filter.key).toBe('');
}); });
it('should be able to select a type and return it based on a number', () => { it('should be able to select a type and return it based on a number', () => {

View File

@ -5,11 +5,13 @@ export class FilterModel {
name:string; name:string;
description:string; description:string;
owner:string; owner:string;
constructor(type:string = '', name:string = '', description:string = '', owner:string = ''){ key: string;
constructor(type:string = '', name:string = '', description:string = '', owner:string = '', key:string = ''){
this.type = type; this.type = type;
this.name = name; this.name = name;
this.description= description; this.description= description;
this.owner = owner; this.owner = owner;
this.key = key;
} }
} }

View File

@ -116,10 +116,10 @@ describe('WorkbasketListComponent', () => {
}); });
it('should have performRequest after performFilter is triggered', fakeAsync( () => { it('should have performRequest after performFilter is triggered', fakeAsync( () => {
let type='PERSONAL', name = 'someName', description = 'someDescription', owner = 'someOwner' let type='PERSONAL', name = 'someName', description = 'someDescription', owner = 'someOwner', key = 'someKey';
let filter = new FilterModel(type, name, description, owner); let filter = new FilterModel(type, name, description, owner, key );
component.performFilter(filter); component.performFilter(filter);
expect(workbasketService.getWorkBasketsSummary).toHaveBeenCalledWith('key', 'asc', undefined, name, description, undefined, owner, type ); expect(workbasketService.getWorkBasketsSummary).toHaveBeenCalledWith('key', 'asc', undefined, name, description, undefined, owner, type, undefined, key );
})); }));

View File

@ -92,7 +92,7 @@ export class WorkbasketListComponent implements OnInit {
this.workbaskets = undefined; this.workbaskets = undefined;
this.workbasketServiceSubscription.add(this.workbasketService.getWorkBasketsSummary(this.sortBy, this.sortDirection, undefined, this.workbasketServiceSubscription.add(this.workbasketService.getWorkBasketsSummary(this.sortBy, this.sortDirection, undefined,
this.filterBy.name, this.filterBy.description, undefined, this.filterBy.owner, this.filterBy.name, this.filterBy.description, undefined, this.filterBy.owner,
this.filterBy.type).subscribe(resultList => { this.filterBy.type, undefined, this.filterBy.key).subscribe(resultList => {
this.workbaskets = resultList; this.workbaskets = resultList;
this.requestInProgress = false; this.requestInProgress = false;
})); }));

View File

@ -115,9 +115,8 @@
overflow-x: hidden; overflow-x: hidden;
} }
.margin-right .margin-right {
{ margin-right: 2px;
margin-right: 5px;
} }
.no-border-bottom { .no-border-bottom {
@ -191,6 +190,10 @@ li > div.row > dl {
color: crimson; color: crimson;
} }
.dropdown-menu-users >li {
margin-bottom: 5px;
}
.btn-users-list { .btn-users-list {
border: 0px solid transparent; border: 0px solid transparent;
/* this was 1px earlier */ /* this was 1px earlier */