diff --git a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html index e95cb3aecb..aa2dc97788 100644 --- a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html +++ b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html @@ -1,29 +1,43 @@ -
- - -
- - - - +
+ + + +
+ + + +
+ + + + +
diff --git a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts index 747ec48113..5063c9d2db 100644 --- a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts +++ b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts @@ -34,6 +34,8 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy { @ViewChild('taskCloud') taskCloud: ServiceTaskListCloudComponent; + appName = 'simpleapp'; + isFilterLoaded = false; selectedRow: any; @@ -50,6 +52,7 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy { selectedAction: { id: number, name: string, actionType: string}; selectedContextAction: { id: number, name: string, actionType: string}; selectionMode: string; + filterId: string; private onDestroy$ = new Subject(); @@ -86,6 +89,11 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy { } } + onTaskFilterSelected(filter: ServiceTaskFilterCloudModel) { + this.filterId = filter.id; + this.editedFilter = filter; + } + onChangePageSize(event: PaginationModel) { this.userPreference.paginationSize = event.maxItems; } @@ -95,6 +103,7 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy { } onFilterChange(filter: ServiceTaskFilterCloudModel) { + this.appName = filter.appName; this.editedFilter = Object.assign({}, filter); this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })]; } diff --git a/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts index 71433cb029..2b8ba7f968 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts @@ -236,7 +236,7 @@ export class ServiceTaskFilterCloudService { * @returns String of task filters preference key */ private prepareKey(appName: string): string { - return `task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`; + return `service-task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`; } /** @@ -262,7 +262,7 @@ export class ServiceTaskFilterCloudService { key: 'my-service-tasks', icon: 'inbox', appName, - status: 'ALL', + status: '', sort: 'startedDate', order: 'DESC' } as ServiceTaskFilterCloudModel, diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/base-task-list-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-list/components/base-task-list-cloud.component.ts index 9bd9680a3f..b94cba2c03 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/base-task-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/base-task-list-cloud.component.ts @@ -248,7 +248,7 @@ export abstract class BaseTaskListCloudComponent extends DataTableSchema impleme } isValidSorting(sorting: TaskListCloudSortingModel[]) { - return sorting.length && sorting[0].orderBy && sorting[0].direction; + return sorting && sorting.length && sorting[0].orderBy && sorting[0].direction; } abstract load(requestNode); diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/service-task-list-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-list/components/service-task-list-cloud.component.ts index d944162088..6af500ccdd 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/service-task-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/service-task-list-cloud.component.ts @@ -34,7 +34,7 @@ export class ServiceTaskListCloudComponent extends BaseTaskListCloudComponent { static PRESET_KEY = 'adf-cloud-service-task-list.presets'; @Input() - queryParams: { [key: string]: string } = {}; + queryParams: { [key: string]: any } = {}; constructor(private taskListCloudService: TaskListCloudService, appConfigService: AppConfigService, @@ -57,13 +57,27 @@ export class ServiceTaskListCloudComponent extends BaseTaskListCloudComponent { } createRequestNode(): ServiceTaskQueryCloudRequestModel { - const requestNode = { - ...this.queryParams, + const requestNode: ServiceTaskQueryCloudRequestModel = { appName: this.appName, maxItems: this.size, skipCount: this.skipCount, - sorting: this.sorting - }; - return requestNode; + sorting: this.sorting, + id: this.queryParams.serviceTaskId, + activityName: this.queryParams.activityName, + activityType: this.queryParams.activityType, + completedDate: this.queryParams.completedDate, + elementId: this.queryParams.elementId, + executionId: this.queryParams.executionId, + processDefinitionId: this.queryParams.processDefinitionId, + processDefinitionKey: this.queryParams.processDefinitionKey, + processDefinitionVersion: this.queryParams.processDefinitionVersion, + processInstanceId: this.queryParams.processInstanceId, + serviceFullName: this.queryParams.serviceFullName, + serviceName: this.queryParams.serviceName, + serviceVersion: this.queryParams.serviceVersion, + startedDate: this.queryParams.startedDate, + status: this.queryParams.status + } as ServiceTaskQueryCloudRequestModel; + return requestNode; } }