[ADF-2788] Filter task url involved (#3243)

* filter task url involved

* task filter observer removed

* tests fix

* clean code
This commit is contained in:
bbcodrin
2018-04-30 12:19:22 +03:00
committed by Maurizio Vitale
parent e8f1986d5d
commit b58a24c126
5 changed files with 74 additions and 46 deletions

View File

@@ -125,6 +125,11 @@ export const appRoutes: Routes = [
component: ProcessServiceComponent,
canActivate: [AuthGuardBpm]
},
{
path: 'activiti/apps/:appId/tasks/:filterId',
component: ProcessServiceComponent,
canActivate: [AuthGuardBpm]
},
{
path: 'activiti/apps/:appId/processes',
component: ProcessServiceComponent,

View File

@@ -17,7 +17,7 @@
<adf-accordion-group [heading]="'Tasks'" [isSelected]="true" [isOpen]="true"
[headingIcon]="'assignment'">
<adf-filters
[filterParam]="{name:'MY tasks'}"
[filterParam]="filterSelected"
[appId]="appId"
[hasIcon]="false"
(filterClick)="onTaskFilterClick($event)"

View File

@@ -109,6 +109,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
@Input()
appId: number = null;
@Input()
filterSelected: object = null;
@Output()
changePageSize: EventEmitter<Pagination> = new EventEmitter();
@@ -213,6 +216,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
}
this.sub = this.route.params.subscribe(params => {
const applicationId = params['appId'];
this.filterSelected = params['filterId'] ? { id: params['filterId'] } : { index: 0 };
if (applicationId && applicationId !== '0') {
this.appId = params['appId'];
}
@@ -234,6 +240,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
onTaskFilterClick(filter: FilterRepresentationModel): void {
this.applyTaskFilter(filter);
this.resetTaskPaginationPage();
this.router.navigate(['/activiti/apps', this.appId || 0, 'tasks', filter.id]);
}
resetTaskPaginationPage() {