[ADF-2039] pagination fixes (#2742)

* pagination fixes

* test fixes
This commit is contained in:
Denys Vuika
2017-11-27 22:39:58 +00:00
committed by Eugenio Romano
parent 24fb8763c5
commit 82dca30d7f
7 changed files with 117 additions and 96 deletions

View File

@@ -173,6 +173,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
infiniteLoading: boolean = false;
noPermission: boolean = false;
selection = new Array<MinimalNodeEntity>();
// PaginatedComponent implementation
pagination = new Subject<Pagination>();
private layoutPresets = {};
@@ -860,6 +862,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
// PaginatedComponent implementation
updatePagination(params: PaginationQueryParams) {
const needsReload = this.maxItems !== params.maxItems || this.skipCount !== params.skipCount;
@@ -871,9 +874,15 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
// PaginatedComponent implementation
get supportedPageSizes(): number[] {
return this.appConfig.get('document-list.supportedPageSizes', [5, 10, 15, 25]);
}
ngOnDestroy() {
if (this.contextActionHandlerSubscription) {
this.contextActionHandlerSubscription.unsubscribe();
this.contextActionHandlerSubscription = null;
}
}
}