Skip to content

Commit

Permalink
feat: hide pagination if only one page
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jun 25, 2024
1 parent 82df79f commit 31a6704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/datahub-e2e/src/e2e/search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ describe('search', () => {
beforeEach(() => {
cy.visit('/search')
})
it('should display the pagination', () => {
cy.get('mel-datahub-pagination-buttons').should('be.visible')
// if more than 18 datasets, pagination should be visible, please adapt test
it('should not display the pagination', () => {
cy.get('mel-datahub-pagination-buttons').should('not.exist')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
[numberOfResults]="pageSize"
></mel-datahub-results-list-grid>
<div class="flex justify-center mt-16">
@if((searchFacade.isLoading$ | async) === false){
@if((searchFacade.isLoading$ | async) === false && (searchFacade.totalPages$
| async) > 1){
<mel-datahub-pagination-buttons
[totalPages]="searchFacade.totalPages$ | async"
[currentPage]="searchFacade.currentPage$ | async"
Expand Down

0 comments on commit 31a6704

Please sign in to comment.