From 0553f68607ecb693f9e1b95420e4a3dd0df98d2b Mon Sep 17 00:00:00 2001 From: Raf Ponsaerts Date: Tue, 11 Aug 2020 11:58:42 +0200 Subject: [PATCH] [Task 72397] adding debug consoles and pageSize --- .../file-section/full-file-section.component.ts | 2 +- .../field-components/file-section/file-section.component.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts index 70950d9227..e6206a3d5f 100644 --- a/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/+item-page/full/field-components/file-section/full-file-section.component.ts @@ -29,7 +29,7 @@ export class FullFileSectionComponent extends FileSectionComponent implements On originals$: Observable>>; licenses$: Observable>>; - pageSize = 5; + pageSize = 2; originalOptions = Object.assign(new PaginationComponentOptions(),{ id: 'original-bitstreams-options', currentPage: 1, diff --git a/src/app/+item-page/simple/field-components/file-section/file-section.component.ts b/src/app/+item-page/simple/field-components/file-section/file-section.component.ts index 0d869608e1..e4da4f2cca 100644 --- a/src/app/+item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/+item-page/simple/field-components/file-section/file-section.component.ts @@ -56,7 +56,9 @@ export class FileSectionComponent implements OnInit { } else { this.currentPage++; } - this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage }).pipe( + console.log(this.isLastPage); + console.log(this.currentPage); + this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage, elementsPerPage: 1 }).pipe( filter((bitstreamsRD: RemoteData>) => hasValue(bitstreamsRD)), takeWhile((bitstreamsRD: RemoteData>) => hasNoValue(bitstreamsRD.payload) && hasNoValue(bitstreamsRD.error), true) ).subscribe((bitstreamsRD: RemoteData>) => { @@ -64,6 +66,8 @@ export class FileSectionComponent implements OnInit { this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]); this.isLoading = false; this.isLastPage = hasNoValue(bitstreamsRD.payload.next); + console.log("lel"); + console.log(this.isLastPage); }); } }