add paging for featured datasets tab (enermaps)

This commit is contained in:
Alex-Coded4 2022-07-07 12:49:10 +03:00
parent fc5fcfaede
commit 2d0893ff45
1 changed files with 9 additions and 4 deletions

View File

@ -36,10 +36,10 @@ import {StringUtils} from "../../string-utils.class";
</ng-container>
<ng-container *ngIf="fetch.searchUtils.status == errorCodes.DONE">
<search-result [properties]="properties"
[results]="fetch.results"
[status]="fetch.searchUtils.status"
[type]="resultType" [showImpactFactors]="showImpactFactors" [showEnermaps]="showEnermaps">
<search-result [properties]="properties"
[results]="results"
[status]="fetch.searchUtils.status"
[type]="resultType" [showImpactFactors]="showImpactFactors" [showEnermaps]="showEnermaps">
</search-result>
<!-- <div *ngIf="searchLinkToAdvancedPage && fetch.results?.length > 0" class="uk-text-right">-->
@ -62,10 +62,15 @@ export class SearchTabComponent {
@Input() showImpactFactors;
@Input() customTitle;
@Input() showEnermaps: boolean;
@Input() currentPage: number = null;
public errorCodes: ErrorCodes = new ErrorCodes();
public getEntityName(entityType: string): string {
return StringUtils.getEntityName(entityType, true);
}
get results() {
return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results;
}
}