* After rebase (#4232)

This commit is contained in:
siva kumar
2019-02-01 19:48:00 +05:30
committed by Maurizio Vitale
parent cbc8043d02
commit 120177f152
4 changed files with 57 additions and 0 deletions

View File

@@ -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', () => {

View File

@@ -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,

View File

@@ -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;