diff --git a/demo-shell/src/app/components/process-service/process-service.component.ts b/demo-shell/src/app/components/process-service/process-service.component.ts index 946c98d0f0..916f393df1 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.ts +++ b/demo-shell/src/app/components/process-service/process-service.component.ts @@ -50,8 +50,7 @@ import { TaskDetailsComponent, TaskDetailsEvent, TaskFiltersComponent, - TaskListComponent, - TaskListService + TaskListComponent } from '@alfresco/adf-process-services'; import { LogService } from '@alfresco/adf-core'; import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core'; @@ -157,7 +156,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit constructor(private elementRef: ElementRef, private route: ActivatedRoute, private router: Router, - private taskListService: TaskListService, private apiService: AlfrescoApiService, private logService: LogService, private appConfig: AppConfigService, @@ -234,7 +232,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit ngOnDestroy() { this.sub.unsubscribe(); - this.taskListService.tasksList$.subscribe(); } onTaskFilterClick(filter: FilterRepresentationModel): void { diff --git a/docs/process-services/task-list.component.md b/docs/process-services/task-list.component.md index 2a6ffe9eac..1e67993e82 100644 --- a/docs/process-services/task-list.component.md +++ b/docs/process-services/task-list.component.md @@ -26,7 +26,7 @@ Renders a list containing all the tasks matched by the parameters specified. | ---- | ---- | ------------- | ----------- | | appId | `number` | | The id of the app. | | processInstanceId | `string` | | The Instance Id of the process. | -| processDefinitionKey | `string` | | The Definition Key of the process. | +| processDefinitionKey | `string` | | The Definition Key of the process. **Deprecated:** in 2.4.0 | | state | `string` | | Current state of the process. Possible values are: `completed`, `active`. | | assignment | `string` | | The assignment of the process. Possible values are: "assignee" (the current user is the assignee), candidate (the current user is a task candidate", "group_x" (the task is assigned to a group where the current user is a member, no value(the current user is involved). | | sort | `string` | | Define the sort order of the processes. Possible values are : `created-desc`, `created-asc`, `due-desc`, `due-asc` | diff --git a/lib/process-services/task-list/components/task-list.component.ts b/lib/process-services/task-list/components/task-list.component.ts index 8521b97c95..64ab4d5e7b 100644 --- a/lib/process-services/task-list/components/task-list.component.ts +++ b/lib/process-services/task-list/components/task-list.component.ts @@ -50,7 +50,9 @@ export class TaskListComponent implements OnChanges, AfterContentInit, Paginated @Input() processInstanceId: string; - /** The Definition Key of the process. */ + /** The Definition Key of the process. + * @deprecated 2.4.0 + */ @Input() processDefinitionKey: string; diff --git a/lib/process-services/task-list/services/task-filter.service.ts b/lib/process-services/task-list/services/task-filter.service.ts index 7dcfa57ab8..cae31a5f22 100644 --- a/lib/process-services/task-list/services/task-filter.service.ts +++ b/lib/process-services/task-list/services/task-filter.service.ts @@ -18,20 +18,14 @@ import { AlfrescoApiService, LogService } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; -import { Subject } from 'rxjs/Subject'; import { FilterRepresentationModel } from '../models/filter.model'; -import { TaskListModel } from '../models/task-list.model'; import 'rxjs/add/observable/throw'; @Injectable() export class TaskFilterService { - private tasksListSubject = new Subject(); - - public tasksList$: Observable; constructor(private apiService: AlfrescoApiService, private logService: LogService) { - this.tasksList$ = this.tasksListSubject.asObservable(); } /** @@ -216,7 +210,6 @@ export class TaskFilterService { private handleError(error: any) { this.logService.error(error); - this.tasksListSubject.error(error); return Observable.throw(error || 'Server error'); } diff --git a/lib/process-services/task-list/services/tasklist.service.spec.ts b/lib/process-services/task-list/services/tasklist.service.spec.ts index 19fe4bc784..5b3ce7755c 100644 --- a/lib/process-services/task-list/services/tasklist.service.spec.ts +++ b/lib/process-services/task-list/services/tasklist.service.spec.ts @@ -76,27 +76,6 @@ describe('Activiti TaskList Service', () => { }); }); - it('should return the task list filtered by processDefinitionKey', (done) => { - service.getTasks( fakeFilter).subscribe(res => { - expect(res).toBeDefined(); - expect(res.size).toEqual(2); - expect(res.start).toEqual(0); - expect(res.data).toBeDefined(); - expect(res.data.length).toEqual(2); - expect(res.data[0].name).toEqual('FakeNameTask'); - expect(res.data[0].assignee.email).toEqual('fake-email@dom.com'); - expect(res.data[0].assignee.firstName).toEqual('firstName'); - expect(res.data[0].assignee.lastName).toEqual('lastName'); - done(); - }); - - jasmine.Ajax.requests.mostRecent().respondWith({ - 'status': 200, - contentType: 'application/json', - responseText: JSON.stringify(fakeTaskListDifferentProcessDefinitionKey) - }); - }); - it('should return the task list with all tasks filtered by state', (done) => { spyOn(service, 'getTasks').and.returnValue(Observable.of(fakeTaskList)); spyOn(service, 'getTotalTasks').and.returnValue(Observable.of(fakeTaskList)); diff --git a/lib/process-services/task-list/services/tasklist.service.ts b/lib/process-services/task-list/services/tasklist.service.ts index c78313c59a..742772b582 100644 --- a/lib/process-services/task-list/services/tasklist.service.ts +++ b/lib/process-services/task-list/services/tasklist.service.ts @@ -18,7 +18,6 @@ import { AlfrescoApiService, LogService } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; -import { Subject } from 'rxjs/Subject'; import { FilterRepresentationModel, TaskQueryRequestRepresentationModel } from '../models/filter.model'; import { Form } from '../models/form.model'; import { TaskDetailsModel } from '../models/task-details.model'; @@ -31,13 +30,9 @@ import 'rxjs/add/observable/from'; @Injectable() export class TaskListService { - private tasksListSubject = new Subject(); - - public tasksList$: Observable; constructor(private apiService: AlfrescoApiService, private logService: LogService) { - this.tasksList$ = this.tasksListSubject.asObservable(); } /** @@ -88,8 +83,7 @@ export class TaskListService { */ getTasks(requestNode: TaskQueryRequestRepresentationModel): Observable { return Observable.fromPromise(this.callApiTasksFiltered(requestNode)) - .map((res: any) => { - this.tasksListSubject.next(res); + .map((res: TaskListModel) => { return res; }).catch(err => this.handleError(err)); } @@ -136,7 +130,6 @@ export class TaskListService { const tasks = Object.assign({}, activeTasks); tasks.total += completedTasks.total; tasks.data = tasks.data.concat(completedTasks.data); - this.tasksListSubject.next(tasks); return tasks; } ); @@ -374,7 +367,6 @@ export class TaskListService { private handleError(error: any) { this.logService.error(error); - this.tasksListSubject.error(error); return Observable.throw(error || 'Server error'); }