[Task 72397] undo test consoles and fix pagination issue

This commit is contained in:
Raf Ponsaerts
2020-08-11 13:13:02 +02:00
parent 0553f68607
commit cb7335208f
2 changed files with 3 additions and 7 deletions

View File

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

View File

@@ -56,18 +56,14 @@ export class FileSectionComponent implements OnInit {
} else {
this.currentPage++;
}
console.log(this.isLastPage);
console.log(this.currentPage);
this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage, elementsPerPage: 1 }).pipe(
this.bitstreamDataService.findAllByItemAndBundleName(this.item, 'ORIGINAL', { currentPage: this.currentPage }).pipe(
filter((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => hasValue(bitstreamsRD)),
takeWhile((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => hasNoValue(bitstreamsRD.payload) && hasNoValue(bitstreamsRD.error), true)
).subscribe((bitstreamsRD: RemoteData<PaginatedList<Bitstream>>) => {
const current: Bitstream[] = this.bitstreams$.getValue();
this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]);
this.isLoading = false;
this.isLastPage = hasNoValue(bitstreamsRD.payload.next);
console.log("lel");
console.log(this.isLastPage);
this.isLastPage = this.currentPage === bitstreamsRD.payload.totalPages;
});
}
}