diff --git a/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html b/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html
index 41fe068288..490748ab8d 100644
--- a/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html
+++ b/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html
@@ -160,7 +160,6 @@
/>
0"
#paginator
[pageNumber]="selectedPageNumber || defaultPageNumber"
[pageSize]="selectedPageSize || defaultPageSize"
diff --git a/libs/openchallenges/challenge-search/src/lib/challenge-search.component.ts b/libs/openchallenges/challenge-search/src/lib/challenge-search.component.ts
index 81d117e563..5622ac6d6d 100644
--- a/libs/openchallenges/challenge-search/src/lib/challenge-search.component.ts
+++ b/libs/openchallenges/challenge-search/src/lib/challenge-search.component.ts
@@ -208,7 +208,7 @@ export class ChallengeSearchComponent
);
this.searchedTerms = params['searchTerms'];
this.selectedPageNumber = +params['pageNumber'] || this.defaultPageNumber;
- this.selectedPageSize = +params['pageSize'] || this.defaultPageSize;
+ this.selectedPageSize = this.defaultPageSize; // no available pageSize options for users
this.sortedBy = params['sort'] || this.defaultSortedBy;
const defaultQuery: ChallengeSearchQuery = {
@@ -309,6 +309,7 @@ export class ChallengeSearchComponent
// update challenges and total number of results
this.searchResultsCount = page.totalElements;
this.challenges = page.challenges;
+ console.log(this.paginator.pageNumber);
});
}
diff --git a/libs/openchallenges/ui/src/lib/paginator/paginator.component.html b/libs/openchallenges/ui/src/lib/paginator/paginator.component.html
index ad5473c1a0..c392d3892b 100644
--- a/libs/openchallenges/ui/src/lib/paginator/paginator.component.html
+++ b/libs/openchallenges/ui/src/lib/paginator/paginator.component.html
@@ -8,4 +8,5 @@
[showCurrentPageReport]="true"
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} results"
(onPageChange)="onPageChange($event)"
+ [alwaysShow]="false"
>
diff --git a/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts b/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
index 9ba3a2e84c..cc9b3f9e86 100644
--- a/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
+++ b/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
@@ -5,6 +5,7 @@ import {
Output,
EventEmitter,
ViewChild,
+ OnInit,
} from '@angular/core';
import {
Paginator,
@@ -18,7 +19,7 @@ import {
templateUrl: './paginator.component.html',
styleUrls: ['./paginator.component.scss'],
})
-export class PaginatorComponent {
+export class PaginatorComponent implements OnInit {
@Input({ required: true }) pageNumber = 0; // index of the new page
@Input({ required: false }) pageLinkSize = 5;
@Input({ required: true }) pageSize = 0; // number of items to display in new page
@@ -29,10 +30,9 @@ export class PaginatorComponent {
itemIndex = 0; // index of the first item in the new page
- // change itemIndex's value will not dynamically trigger selection updates - seems a primeng issue
- // ngOnInit(): void {
- // this.itemIndex = this.pageNumber * this.pageSize;
- // }
+ ngOnInit(): void {
+ this.itemIndex = this.pageNumber * this.pageSize;
+ }
onPageChange(event: any): void {
this.pageChange.emit(event);