[ADF-3438] Bugs in Task List Demo Component fixed (#3809)

* [ADF-3438] Bugs in Task List Demo Component fixed

* [ADF-3438] Added default size value for pagination
This commit is contained in:
davidcanonieto
2018-09-20 14:02:15 +01:00
committed by Eugenio Romano
parent dc64231ba5
commit 244d1aae85

View File

@@ -26,37 +26,25 @@ import { debounceTime } from 'rxjs/operators';
}) })
export class TaskListDemoComponent implements OnInit { export class TaskListDemoComponent implements OnInit {
DEFAULT_SIZE = 20;
defaultAppId: number;
taskListForm: FormGroup; taskListForm: FormGroup;
errorMessage: string; errorMessage: string;
appId: number; appId: number;
defaultAppId: number;
id: string; id: string;
processDefinitionId: string; processDefinitionId: string;
processInstanceId: string; processInstanceId: string;
state: string; state: string;
assignment: string; assignment: string;
name: string; name: string;
sort: string; sort: string;
start: number; start: number;
size: number = this.DEFAULT_SIZE;
size: number; page: number = 0;
page: number;
dueAfter: string; dueAfter: string;
dueBefore: string; dueBefore: string;
includeProcessInstance: boolean; includeProcessInstance: boolean;
@@ -129,7 +117,7 @@ export class TaskListDemoComponent implements OnInit {
if (this.isFormValid()) { if (this.isFormValid()) {
this.filterTasks(taskFilter); this.filterTasks(taskFilter);
} }
}); });
} }
filterTasks(taskFilter: any) { filterTasks(taskFilter: any) {
@@ -142,8 +130,13 @@ export class TaskListDemoComponent implements OnInit {
this.state = taskFilter.taskState; this.state = taskFilter.taskState;
this.sort = taskFilter.taskSort; this.sort = taskFilter.taskSort;
this.start = taskFilter.taskStart; this.start = taskFilter.taskStart;
this.size = taskFilter.taskSize; this.size = +taskFilter.taskSize;
this.page = taskFilter.taskPage;
if (taskFilter.page > 0) {
this.page = +taskFilter.taskPage - 1;
} else {
this.page = +taskFilter.taskPage;
}
this.dueAfter = taskFilter.taskDueAfter; this.dueAfter = taskFilter.taskDueAfter;
this.dueBefore = taskFilter.taskDueBefore; this.dueBefore = taskFilter.taskDueBefore;
@@ -165,7 +158,7 @@ export class TaskListDemoComponent implements OnInit {
this.state = null; this.state = null;
this.sort = null; this.sort = null;
this.start = null; this.start = null;
this.size = null; this.size = this.DEFAULT_SIZE;
this.page = null; this.page = null;
this.dueAfter = null; this.dueAfter = null;
this.dueBefore = null; this.dueBefore = null;