[MNT-22924] Fix slow search results loading, limit number of pages (#7609)

* [MNT-22924] Fix slow search results loading, limit number of pages

* Add unit test

* Changed some of the values
This commit is contained in:
Thomas Hunter
2022-05-11 09:53:05 +01:00
committed by GitHub
parent fd0626391c
commit e844faff79
3 changed files with 36 additions and 3 deletions

View File

@@ -41,20 +41,20 @@
data-automation-id="page-selector"
[attr.aria-label]="'CORE.PAGINATION.ARIA.CURRENT_PAGE' | translate"
[matMenuTriggerFor]="pagesMenu"
*ngIf="pages.length > 1">
*ngIf="lastPage > 1">
<mat-icon>arrow_drop_down</mat-icon>
</button>
<div *ngIf="pagination.totalItems">
<span class="adf-pagination__total-pages">
{{ 'CORE.PAGINATION.TOTAL_PAGES' | translate: { total: pages.length } }}
{{ 'CORE.PAGINATION.TOTAL_PAGES' | translate: { total: lastPage } }}
</span>
</div>
<mat-menu #pagesMenu="matMenu" class="adf-pagination__page-selector">
<button
mat-menu-item
*ngFor="let pageNumber of pages"
*ngFor="let pageNumber of limitedPages"
(click)="onChangePageNumber(pageNumber)">
{{ pageNumber }}
</button>