TSK-661 - Filtering of distribution target selection does not work

This commit is contained in:
Jose Ignacio Recuerda Cambil 2018-07-31 17:27:36 +02:00 committed by Martin Rojas Miguel Angel
parent 2d397369c5
commit 1e37fa3fe9
8 changed files with 14 additions and 26 deletions

View File

@ -93,7 +93,8 @@ describe('DistributionTargetsComponent', () => {
expect(repeteadElemens).toBeFalsy();
});
it('should filter left list and keep selected elements as selected', () => {
component.performFilter({ filterBy: new FilterModel(), side: Side.LEFT });
component.performFilter({ filterBy: new FilterModel({
name: 'someName', owner: 'someOwner', description: 'someDescription', key: 'someKey'}), side: Side.LEFT });
component.distributionTargetsLeft = new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', new Links({ 'href': 'someurl' }))
)

View File

@ -148,8 +148,9 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
dualListFilter.side === Side.RIGHT ? this.distributionTargetsRight = undefined : this.distributionTargetsLeft = undefined;
this.onRequest(dualListFilter.side, false);
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, undefined, undefined, undefined,
dualListFilter.filterBy.name, dualListFilter.filterBy.description, undefined, dualListFilter.filterBy.owner,
dualListFilter.filterBy.type, undefined, dualListFilter.filterBy.key, undefined, true).subscribe(resultList => {
dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, undefined,
dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, undefined,
dualListFilter.filterBy.filterParams.key, undefined, true).subscribe(resultList => {
(dualListFilter.side === Side.RIGHT) ?
this.distributionTargetsRight = (resultList._embedded ? resultList._embedded.workbaskets : []) :
this.distributionTargetsLeft = (resultList._embedded ? resultList._embedded.workbaskets : []);

View File

@ -15,7 +15,7 @@
</button>
</div>
</div>
<div [@toggleDownWithoutNgIf]="toolbarState" class="row">
<div [@toggleDown]="toolbarState" class="row">
<taskana-filter class="col-xs-12" (performFilter)="performAvailableFilter($event)"></taskana-filter>
</div>
<taskana-spinner [isRunning]="requestInProgress" positionClass="centered-spinner" class="floating"></taskana-spinner>

View File

@ -2,13 +2,13 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { WorkbasketSummary } from 'app/models/workbasket-summary';
import { FilterModel } from 'app/models/filter';
import { Side } from '../distribution-targets.component';
import { expandDownWithoutNgIf } from 'app/shared/animations/expand.animation';
import { expandDown } from 'app/shared/animations/expand.animation';
@Component({
selector: 'taskana-dual-list',
templateUrl: './dual-list.component.html',
styleUrls: ['./dual-list.component.scss'],
animations: [expandDownWithoutNgIf]
animations: [expandDown]
})
export class DualListComponent implements OnInit {

View File

@ -18,7 +18,7 @@
</div>
</div>
<div [@toggleDown]="toolbarState" *ngIf="toolbarState" class="row no-overflow">
<div [@toggleDown]="toolbarState" class="row no-overflow">
<taskana-filter (performFilter)="filtering($event)"></taskana-filter>
</div>
</li>

View File

@ -10,7 +10,7 @@
<span>Roles</span>
</button>
</div>
<div class="white pull-right roles col-xs-12" [@toggleDown]="showRoles" *ngIf="showRoles">
<div class="white pull-right roles col-xs-12" [@toggleDown]="showRoles">
<span><i>{{roles}}</i></span>
</div>
</div>
</div>

View File

@ -2,21 +2,7 @@ import { trigger, style, transition, animate, keyframes, state } from '@angular/
export const expandDown =
trigger('toggleDown', [
state('*', style({ opacity: '1' })),
state('void', style({ opacity: '0' })),
transition('void => *', animate('300ms ease-in', keyframes([
style({ opacity: 0, height: '0px' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 1, height: '*' })]))),
transition('* => void', animate('300ms ease-out', keyframes([
style({ opacity: 1, height: '*' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 0, height: '0px' })])))
]);
export const expandDownWithoutNgIf =
trigger('toggleDownWithoutNgIf', [
state('true', style({ opacity: '1', display: 'block' })),
state('true', style({ opacity: '1', display: 'initial' })),
state('false', style({ opacity: '0', display: 'none' })),
transition('false => true', animate('300ms ease-in', keyframes([
style({ opacity: 0, height: '0px' }),
@ -26,7 +12,7 @@ export const expandDownWithoutNgIf =
style({ opacity: 1, height: '*' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 0, height: '0px' })])))
]);
]);
export const expandRight = trigger('toggleRight', [
transition('void => *', animate('300ms ease-in', keyframes([

View File

@ -25,7 +25,7 @@
</div>
</div>
<div [@toggleDown]="toolbarState" *ngIf="toolbarState" class="row no-overflow">
<div [@toggleDown]="toolbarState" class="row no-overflow">
<taskana-filter
[filterParams]="filterParams"
[filterType]="filterType"