diff --git a/docs/process-services-cloud/task-list-cloud.component.md b/docs/process-services-cloud/task-list-cloud.component.md index e4f07cbfcb..f15c77c634 100644 --- a/docs/process-services-cloud/task-list-cloud.component.md +++ b/docs/process-services-cloud/task-list-cloud.component.md @@ -55,6 +55,8 @@ when the task list is empty: | assignee | `string` | "" | The assignee 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). | | createdDate | `string` | "" | Filter the tasks. Display only tasks created on the supplied date. | | dueDate | `string` | "" | Filter the tasks. Display only tasks with dueDate equal to the supplied date. | +| lastModifiedFrom | `string` | "" | Filter the tasks. Display only tasks with lastModifiedFrom equal to the supplied date. | +| lastModifiedTo | `string` | "" | Filter the tasks. Display only tasks with lastModifiedTo equal to the supplied date. | | id | `string` | "" | Filter the tasks. Display only tasks with id equal to the supplied value. | | multiselect | `boolean` | false | Toggles multiple row selection, rendering a checkbox at the beginning of each row. | | name | `string` | "" | Filter the tasks. Display only tasks with the supplied name. | @@ -64,6 +66,9 @@ when the task list is empty: | selectionMode | `string` | "single" | Row selection mode. Can be none, `single` or `multiple`. For `multiple` mode, you can use the Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows. | | sorting | [`TaskListCloudSortingModel`](../../lib/process-services-cloud/src/lib/task/task-list/models/task-list-sorting.model.ts)`[]` | | Specifies how the table should be sorted. The parameters are for BE sorting. | | status | `string` | "" | Filter the tasks. Display only tasks with status equal to the supplied value. | +| owner | `string` | "" | Filter the tasks. Display only tasks with owner equal to the supplied value. | +| priority | `string` | "" | Filter the tasks. Display only tasks with priority equal to the supplied value. | +| standAlone | `string` | "" | Filter the tasks. Display only the tasks that belong to a process in case is false or tasks that doesn't belong to a process in case of true. | ### Events diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts index 62b4ed2b48..92c496eac3 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts @@ -201,6 +201,28 @@ describe('TaskListCloudComponent', () => { fixture.detectChanges(); expect(component.isListEmpty()).toBeTruthy(); }); + + it('should reload the task list when input parameters changed', () => { + const getTaskByRequestSpy = spyOn(taskListCloudService, 'getTaskByRequest').and.returnValue(of(fakeGlobalTask)); + component.applicationName = 'mock-app-name'; + component.priority = 1; + component.status = 'mock-status'; + component.lastModifiedFrom = 'mock-lastmodified-date'; + component.owner = 'mock-owner-name'; + const priorityChange = new SimpleChange(undefined, 1, true); + const statusChange = new SimpleChange(undefined, 'mock-status', true); + const lastModifiedFromChange = new SimpleChange(undefined, 'mock-lastmodified-date', true); + const ownerChange = new SimpleChange(undefined, 'mock-owner-name', true); + component.ngOnChanges({ + 'priority': priorityChange, + 'status': statusChange, + 'lastModifiedFrom': lastModifiedFromChange, + 'owner': ownerChange + }); + fixture.detectChanges(); + expect(component.isListEmpty()).toBeFalsy(); + expect(getTaskByRequestSpy).toHaveBeenCalled(); + }); }); describe('Injecting custom colums for tasklist - CustomTaskListComponent', () => { diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts index 22a9553e76..11be8e3b96 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts @@ -60,6 +60,14 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges @Input() dueDate: string = ''; + /** Filter the tasks. Display only tasks with lastModifiedFrom equal to the supplied date. */ + @Input() + lastModifiedFrom: string = ''; + + /** Filter the tasks. Display only tasks with lastModifiedTo equal to the supplied date. */ + @Input() + lastModifiedTo: string = ''; + /** Filter the tasks. Display only tasks with id equal to the supplied value. */ @Input() id: string = ''; @@ -84,6 +92,18 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges @Input() status: string = ''; + /** Filter the tasks. Display only tasks with owner equal to the supplied value. */ + @Input() + owner: string = ''; + + /** Filter the tasks. Display only tasks with priority equal to the supplied value. */ + @Input() + priority: number; + + /** Filter the tasks. Display only the tasks that belong to a process in case is false or tasks that doesn't belong to a process in case of true. */ + @Input() + standAlone: boolean = false; + /** * Row selection mode. Can be none, `single` or `multiple`. For `multiple` mode, * you can use the Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for @@ -238,6 +258,10 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges parentTaskId: this.parentTaskId, processDefinitionId: this.processDefinitionId, processInstanceId: this.processInstanceId, + owner: this.owner, + priority: this.priority, + lastModifiedFrom: this.lastModifiedFrom, + lastModifiedTo: this.lastModifiedTo, status: this.status, maxItems: this.size, skipCount: this.skipCount, diff --git a/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts b/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts index 29706df99e..496beee83e 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts @@ -25,10 +25,13 @@ export class TaskQueryCloudRequestModel { createdDate?: Date; description?: string; dueDate?: null; + lastModifiedFrom?: null; + lastModifiedTo?: null; id?: string; name?: string; owner?: string; parentTaskId?: string; + standAlone?: boolean; priority?: number; processDefinitionId?: string; processInstanceId?: string; @@ -46,10 +49,13 @@ export class TaskQueryCloudRequestModel { this.createdDate = obj.createdDate; this.description = obj.description; this.dueDate = obj.dueDate; + this.lastModifiedFrom = obj.lastModifiedFrom; + this.lastModifiedTo = obj.lastModifiedTo; this.id = obj.id; this.name = obj.name; this.owner = obj.owner; this.parentTaskId = obj.parentTaskId; + this.standAlone = obj.standAlone; this.priority = obj.priority; this.processDefinitionId = obj.processDefinitionId; this.processInstanceId = obj.processInstanceId;