From 1ae5558126d7d78595511cd806d6be4bddc25e6f Mon Sep 17 00:00:00 2001 From: camorra-skk Date: Tue, 20 Feb 2018 20:24:30 +0530 Subject: [PATCH] [ADF-2324] Process Pagination - Items per page is not saved on user preferences (#2966) * Made the pagination pageSize to be reflected according to the changes done in either tasklist or processlist pagination. --- .../process-service.component.html | 4 +++- .../process-service.component.ts | 20 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/demo-shell/src/app/components/process-service/process-service.component.html b/demo-shell/src/app/components/process-service/process-service.component.html index 19c7c58443..8975b61c08 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.html +++ b/demo-shell/src/app/components/process-service/process-service.component.html @@ -1,4 +1,4 @@ - +
@@ -58,6 +58,7 @@ @@ -155,6 +156,7 @@ 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 13b3ecb944..9aea5af04a 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 @@ -24,10 +24,12 @@ import { OnDestroy, OnInit, ViewChild, - ViewEncapsulation + ViewEncapsulation, + EventEmitter, + Output } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { ProcessInstanceFilterRepresentation } from 'alfresco-js-api'; +import { ProcessInstanceFilterRepresentation, Pagination } from 'alfresco-js-api'; import { FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, FormService, DynamicTableRow, ValidateDynamicTableRowEvent, AppConfigService, PaginationComponent @@ -106,6 +108,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit @Input() appId: number = null; + @Output() + changePageSize: EventEmitter = new EventEmitter(); + fileShowed = false; selectFirstReport = false; @@ -160,7 +165,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit private preferenceService: UserPreferencesService) { this.dataTasks = new ObjectDataTableAdapter(); this.dataTasks.setSorting(new DataSorting('created', 'desc')); - this.supportedPages = this.preferenceService.getDifferentPageSizes(); this.paginationPageSize = this.preferenceService.paginationSize; this.defaultProcessName = this.appConfig.get('adf-start-process.name'); @@ -216,6 +220,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit this.currentProcessInstanceId = null; }); this.layoutType = AppsListComponent.LAYOUT_GRID; + this.supportedPages = this.preferenceService.getDifferentPageSizes(); } ngOnDestroy() { @@ -232,6 +237,15 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit this.taskPage = 0; } + onTabChange(event: Pagination): void { + this.paginationPageSize = this.preferenceService.paginationSize; + } + + onChangePageSize(event: Pagination): void { + this.preferenceService.paginationSize = event.maxItems; + this.changePageSize.emit(event); + } + onReportClick(event: any): void { this.report = event; }