From 2d0893ff453a14b996b112bb3b4d612e2704d898 Mon Sep 17 00:00:00 2001 From: Alex-Coded4 Date: Thu, 7 Jul 2022 12:49:10 +0300 Subject: [PATCH] add paging for featured datasets tab (enermaps) --- utils/tabs/contents/search-tab.component.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index 320a152d..96e02b31 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -36,10 +36,10 @@ import {StringUtils} from "../../string-utils.class"; - + @@ -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; + } }