[Task 72397] adding debug consoles and pageSize

This commit is contained in:
Raf Ponsaerts
2020-08-11 11:58:42 +02:00
parent f6f87a5738
commit 0553f68607
2 changed files with 6 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ export class FullFileSectionComponent extends FileSectionComponent implements On
originals$: Observable<RemoteData<PaginatedList<Bitstream>>>; originals$: Observable<RemoteData<PaginatedList<Bitstream>>>;
licenses$: Observable<RemoteData<PaginatedList<Bitstream>>>; licenses$: Observable<RemoteData<PaginatedList<Bitstream>>>;
pageSize = 5; pageSize = 2;
originalOptions = Object.assign(new PaginationComponentOptions(),{ originalOptions = Object.assign(new PaginationComponentOptions(),{
id: 'original-bitstreams-options', id: 'original-bitstreams-options',
currentPage: 1, currentPage: 1,

View File

@@ -56,7 +56,9 @@ export class FileSectionComponent implements OnInit {
} else { } else {
this.currentPage++; 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<PaginatedList<Bitstream>>) => hasValue(bitstreamsRD)), filter((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => hasValue(bitstreamsRD)),
takeWhile((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => hasNoValue(bitstreamsRD.payload) && hasNoValue(bitstreamsRD.error), true) takeWhile((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => hasNoValue(bitstreamsRD.payload) && hasNoValue(bitstreamsRD.error), true)
).subscribe((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => { ).subscribe((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => {
@@ -64,6 +66,8 @@ export class FileSectionComponent implements OnInit {
this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]); this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]);
this.isLoading = false; this.isLoading = false;
this.isLastPage = hasNoValue(bitstreamsRD.payload.next); this.isLastPage = hasNoValue(bitstreamsRD.payload.next);
console.log("lel");
console.log(this.isLastPage);
}); });
} }
} }