fix issue with enermaps tab: use search-results instead of search-tab

This commit is contained in:
argirok 2023-10-16 12:13:42 +03:00
parent cc5d3cbdb3
commit 9e5505c297
2 changed files with 15 additions and 8 deletions

View File

@ -737,9 +737,11 @@
*ngIf="activeTab == 'enermaps' && communityId == 'enermaps' && fetchFeaturedDatasets.searchUtils.totalResults > 0 && isEntityEnabled('dataset')">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding uk-padding-remove-horizontal">
<search-tab [fetch]="fetchFeaturedDatasets" [resultType]="'dataset'"
[properties]="properties" customTitle="Featured Datasets" [currentPage]="page"
[showEnermaps]="true">
<div class="uk-flex uk-flex-between uk-flex-middle uk-margin-bottom" >
<div class="uk-text-meta uk-text-large uk-text-uppercase">
<span>Featured Datasets</span>
</div>
</div>
<div class="uk-margin-top uk-margin-medium-bottom uk-text-meta">
<div>Here are listed some of the most important energy datasets as selected by energy experts.</div>
<div>
@ -747,12 +749,16 @@
using only well-known datasets which you can trust.
</div>
</div>
<no-load-paging *ngIf="fetchFeaturedDatasets && fetchFeaturedDatasets.results.length > size" [type]="'Featured Datasets'"
<no-load-paging *ngIf="fetchFeaturedDatasets && fetchFeaturedDatasets.searchUtils.totalResults > size" [type]="'Featured Datasets'"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="size"
[totalResults]="fetchFeaturedDatasets.results.length" >
[page]="fetchFeaturedDatasets.searchUtils.page" [pageSize]="size"
[totalResults]="fetchFeaturedDatasets.searchUtils.totalResults" >
</no-load-paging>
</search-tab>
<search-result [properties]="properties"
[results]="fetchFeaturedDatasets.results"
[status]="fetchFeaturedDatasets.searchUtils.status"
[type]="'dataset'" [showEnermaps]="true" >
</search-result>
</div>
</div>
</div>

View File

@ -386,7 +386,6 @@ export class CommunityComponent {
)
) {
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, page, size, this.properties, "enermaps::selection");
// console.log(this.fetchFeaturedDatasets);
}
this.reloadFeaturedDatasets = false;
}
@ -663,5 +662,7 @@ export class CommunityComponent {
public updatePage(event) {
this.page = event.value;
this.fetchFeaturedDatasets.searchUtils.page = event.value;
this.fetchFeaturedDatasets.results = this.fetchFeaturedDatasets.allResults.slice((this.page - 1) * this.searchNumber, this.page * this.searchNumber) ;
}
}