mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Provide an url to filter by appId
This commit is contained in:
@@ -19,6 +19,8 @@ import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core';
|
||||
import { ALFRESCO_TASKLIST_DIRECTIVES } from 'ng2-activiti-tasklist';
|
||||
import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist';
|
||||
import { ActivitiForm } from 'ng2-activiti-form';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
declare let __moduleName: string;
|
||||
declare var componentHandler;
|
||||
@@ -55,6 +57,8 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
||||
taskFilter: any;
|
||||
processFilter: any;
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
@Input()
|
||||
appId: string;
|
||||
|
||||
@@ -70,7 +74,7 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
||||
return this.currentChoice === 'task-list';
|
||||
}
|
||||
|
||||
constructor() {
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.taskSchemaColumns = [
|
||||
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true}
|
||||
// {type: 'text', key: 'created', title: 'Created', sortable: true}
|
||||
@@ -80,6 +84,16 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
||||
];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
this.appId = params['appId'];
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
onTaskFilterClick(event: any) {
|
||||
this.taskFilter = event;
|
||||
this.activititasklist.load(this.taskFilter.filter);
|
||||
|
Reference in New Issue
Block a user