[#5352] Fix broken pagination if totalItems is missing (#5473)

* [#5352] Fix broken pagination if totalItems is missing. This happens when a search query is executed against Solr and not the DB

* fix lint issues

Co-authored-by: Arik Sidney Guggenheim <ariksidney@outlook.com>
This commit is contained in:
Eugenio Romano
2020-02-21 12:12:28 +00:00
committed by GitHub
parent b7de48c821
commit feebaebd6c
3 changed files with 51 additions and 11 deletions

View File

@@ -1,12 +1,7 @@
<ng-container *ngIf="hasItems">
<div class="adf-pagination__block adf-pagination__range-block">
<span class="adf-pagination__range">
{{
'CORE.PAGINATION.ITEMS_RANGE' | translate: {
range: range.join('-'),
total: pagination.totalItems
}
}}
{{ itemRangeText }}
</span>
</div>
@@ -50,9 +45,11 @@
<mat-icon>arrow_drop_down</mat-icon>
</button>
<span class="adf-pagination__total-pages">
{{ 'CORE.PAGINATION.TOTAL_PAGES' | translate: { total: pages.length } }}
</span>
<div *ngIf="pagination.totalItems">
<span class="adf-pagination__total-pages">
{{ 'CORE.PAGINATION.TOTAL_PAGES' | translate: { total: pages.length } }}
</span>
</div>
<mat-menu #pagesMenu="matMenu" class="adf-pagination__page-selector">
<button