diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts index 19d771b45d..0ace4bbb8e 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts @@ -171,9 +171,7 @@ export class ActivitiDemoComponent implements AfterViewInit { onStartTaskSuccess(event: any) { this.activitifilter.selectFilterWithTask(event.id); - this.taskFilter = this.activitifilter.getCurrentFilter(); - this.activititasklist.landingTaskId = event.id; - this.activititasklist.reload(); + this.currentTaskId = event.id; } onSuccessTaskList(event: FilterRepresentationModel) { diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts index f0cf9a2410..daf2fd67d2 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts @@ -158,6 +158,8 @@ export class ActivitiFilters implements OnInit, OnChanges { if (filteredFilterList.length > 0) { let myTaskFilter = filteredFilterList.find(filter => filter.name === 'My Tasks'); this.currentFilter = myTaskFilter ? myTaskFilter : filteredFilterList[0]; + this.currentFilter.landingTaskId = taskId; + this.filterClick.emit(this.currentFilter); } }); } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts index 2bdf0809e6..d5ba4f34f1 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts @@ -15,9 +15,24 @@ * limitations under the License. */ -import { Component, Input, Output, ContentChild, AfterContentInit, EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; +import { + Component, + Input, + Output, + ContentChild, + AfterContentInit, + EventEmitter, + OnChanges, + SimpleChanges +} from '@angular/core'; import { AlfrescoTranslationService, LogService, DataColumnListComponent } from 'ng2-alfresco-core'; -import { ObjectDataTableAdapter, DataTableAdapter, DataRowEvent, ObjectDataRow, DataColumn } from 'ng2-alfresco-datatable'; +import { + ObjectDataTableAdapter, + DataTableAdapter, + DataRowEvent, + ObjectDataRow, + DataColumn +} from 'ng2-alfresco-datatable'; import { ActivitiTaskListService } from './../services/activiti-tasklist.service'; import { TaskQueryRequestRepresentationModel } from '../models/filter.model'; @@ -124,7 +139,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit { let sort = changes['sort']; let name = changes['name']; let assignment = changes['assignment']; - + let landingTaskId = changes['landingTaskId']; if (appId && appId.currentValue) { changed = true; } else if (processDefinitionKey && processDefinitionKey.currentValue) { @@ -137,6 +152,8 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit { changed = true; } else if (assignment && assignment.currentValue) { changed = true; + } else if (landingTaskId && landingTaskId.currentValue) { + changed = true; } return changed; } @@ -196,7 +213,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit { if (!this.isListEmpty()) { let rows = this.data.getRows(); if (rows.length > 0) { - let dataRow = rows.find(row => row.getValue('id') === taskIdToSelect) || rows[0]; + let dataRow = rows.find(row => row.getValue('id') === taskIdToSelect) || rows[0]; this.data.selectedRow = dataRow; this.currentInstanceId = dataRow.getValue('id'); } diff --git a/ng2-components/ng2-activiti-tasklist/src/models/filter.model.ts b/ng2-components/ng2-activiti-tasklist/src/models/filter.model.ts index fb23c2f2f2..7d56ba2299 100644 --- a/ng2-components/ng2-activiti-tasklist/src/models/filter.model.ts +++ b/ng2-components/ng2-activiti-tasklist/src/models/filter.model.ts @@ -61,6 +61,7 @@ export class FilterRepresentationModel { icon: string; filter: FilterParamRepresentationModel; index: number; + landingTaskId: string; constructor(obj?: any) { this.appId = obj && obj.appId || null; @@ -69,6 +70,7 @@ export class FilterRepresentationModel { this.icon = obj && obj.icon || null; this.filter = new FilterParamRepresentationModel(obj.filter); this.index = obj && obj.index; + this.landingTaskId = obj && obj.landingTaskId; } hasFilter() {