From 9809d3a8cc1a52d01976dcf1b039ef5a4e7e4112 Mon Sep 17 00:00:00 2001
From: Rongrong Chai <73901500+rrchai@users.noreply.github.com>
Date: Wed, 1 Nov 2023 11:13:00 -0400
Subject: [PATCH] hide page size options on search pages (#2298)
---
.../challenge-search/src/lib/challenge-search.component.html | 1 -
.../org-search/src/lib/org-search.component.html | 1 -
.../openchallenges/ui/src/lib/paginator/paginator.component.ts | 3 ++-
3 files changed, 2 insertions(+), 3 deletions(-)
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 843268eb42..a8f9f5dfcf 100644
--- a/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html
+++ b/libs/openchallenges/challenge-search/src/lib/challenge-search.component.html
@@ -161,7 +161,6 @@
Results ({{ searchResultsCount }})
[pageNumber]="selectedPageNumber || defaultPageNumber"
[pageSize]="selectedPageSize || defaultPageSize"
[totalRecords]="searchResultsCount"
- [itemsPerPage]="[12, 24, 36, 48]"
(pageChange)="onParamChange({ pageNumber: $event.page, pageSize: $event.rows,})"
/>
diff --git a/libs/openchallenges/org-search/src/lib/org-search.component.html b/libs/openchallenges/org-search/src/lib/org-search.component.html
index 59a84ea8d3..24210bc772 100644
--- a/libs/openchallenges/org-search/src/lib/org-search.component.html
+++ b/libs/openchallenges/org-search/src/lib/org-search.component.html
@@ -71,7 +71,6 @@ Results ({{ searchResultsCount }})
[pageNumber]="selectedPageNumber || defaultPageNumber"
[pageSize]="selectedPageSize || defaultPageSize"
[totalRecords]="searchResultsCount"
- [itemsPerPage]="[12, 24, 36, 48]"
(pageChange)="onParamChange({ pageNumber: $event.page, pageSize: $event.rows,})"
/>
diff --git a/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts b/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
index 4fcc1bceba..4c18b58aa6 100644
--- a/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
+++ b/libs/openchallenges/ui/src/lib/paginator/paginator.component.ts
@@ -14,7 +14,8 @@ export class PaginatorComponent implements OnInit {
@Input({ required: false }) pageLinkSize = 5;
@Input({ required: true }) pageSize = 0; // number of rows to display in new page
@Input({ required: true }) totalRecords = 0;
- @Input({ required: true }) itemsPerPage!: number[];
+ @Input({ required: false }) itemsPerPage!: number[];
+
@Output() pageChange = new EventEmitter();
itemIndex = 0; // index of the first item in the new page