general tweaks and start on featured datasets paging

This commit is contained in:
Alex Martzios 2022-07-06 10:12:05 +03:00
parent 4d8897d743
commit cd7a6722ac
9 changed files with 26 additions and 21 deletions

View File

@ -6,7 +6,7 @@
<img *ngIf="organization.logo_url" <img *ngIf="organization.logo_url"
[src]="organization.logo_url | urlPrefix" [src]="organization.logo_url | urlPrefix"
alt="{{(organization.name)?organization.name:''}} logo" alt="{{(organization.name)?organization.name:''}} logo"
class="uk-blend-multiply" loading="lazy"> class="uk-blend-multiply uk-height-max-xsmall" loading="lazy">
</div> </div>
<div class="affiliation-name multi-line-ellipsis lines-3" *ngIf="organization.name && fullView"> <div class="affiliation-name multi-line-ellipsis lines-3" *ngIf="organization.name && fullView">
<p class="uk-text-emphasis uk-text-bold uk-margin-remove"> <p class="uk-text-emphasis uk-text-bold uk-margin-remove">

View File

@ -19,9 +19,6 @@ import {properties} from "../../environments/environment";
width: 260px !important; width: 260px !important;
height: 260px !important; height: 260px !important;
} }
.affiliation-logo img {
max-height: 60px !important;
}
.supportingOrganizations img, svg { .supportingOrganizations img, svg {
-webkit-filter: grayscale(1); -webkit-filter: grayscale(1);
filter: grayscale(1); filter: grayscale(1);

View File

@ -1,7 +1,4 @@
<div> <div>
<div id="stickhere">
</div>
<ng-template #tab_content <ng-template #tab_content
let-resultType="resultType" let-fetch="fetch" let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-resultType="resultType" let-fetch="fetch" let-searchLinkToAdvancedPage="searchLinkToAdvancedPage"
let-params="params" let-type="type" let-typeName="typeName" let-showImpactFactors="showImpactFactors"> let-params="params" let-type="type" let-typeName="typeName" let-showImpactFactors="showImpactFactors">
@ -730,13 +727,18 @@
<search-tab [fetch]="fetchFeaturedDatasets" [resultType]="'dataset'" <search-tab [fetch]="fetchFeaturedDatasets" [resultType]="'dataset'"
[properties]="properties" customTitle="Featured Datasets" [properties]="properties" customTitle="Featured Datasets"
[showImpactFactors]="false" [showEnermaps]="true"> [showImpactFactors]="false" [showEnermaps]="true">
<div class="uk-margin-top uk-margin-bottom uk-text-meta"> <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>Here are listed some of the most important energy datasets as selected by energy experts.</div>
<div> <div>
Check them if you want to easily explore and visualize the European energy landscape, Check them if you want to easily explore and visualize the European energy landscape,
using only well-known datasets which you can trust. using only well-known datasets which you can trust.
</div> </div>
</div> </div>
<!-- <no-load-paging *ngIf="fetchFeaturedDatasets && fetchFeaturedDatasets.results.length > size" [type]="'Featured Datasets'"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="size"
[totalResults]="fetchFeaturedDatasets.results.length" >
</no-load-paging> -->
</search-tab> </search-tab>
</div> </div>
</div> </div>

View File

@ -98,6 +98,9 @@ export class CommunityComponent {
public thresholdDescription: number = 500; public thresholdDescription: number = 500;
public descriptionDiff: number = 100; public descriptionDiff: number = 100;
page = 1;
size = 5;
subscribers: number = 0; subscribers: number = 0;
subs: Subscription[] = []; subs: Subscription[] = [];
@ -388,6 +391,7 @@ export class CommunityComponent {
) )
) { ) {
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, page, size, this.properties, "enermaps::selection"); this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, page, size, this.properties, "enermaps::selection");
// console.log(this.fetchFeaturedDatasets);
} }
this.reloadFeaturedDatasets = false; this.reloadFeaturedDatasets = false;
} }
@ -660,5 +664,9 @@ export class CommunityComponent {
disableSelectChange(event: boolean) { disableSelectChange(event: boolean) {
this.disableSelect = event; this.disableSelect = event;
this.cdr.detectChanges(); this.cdr.detectChanges();
}
public updatePage(event) {
this.page = event.value;
} }
} }

View File

@ -33,6 +33,7 @@ import {AdvancedSearchInputModule} from '../openaireLibrary/sharedComponents/adv
import {InputModule} from '../openaireLibrary/sharedComponents/input/input.module'; import {InputModule} from '../openaireLibrary/sharedComponents/input/input.module';
import {QuickSelectionsModule} from '../openaireLibrary/searchPages/searchUtils/quick-selections.module'; import {QuickSelectionsModule} from '../openaireLibrary/searchPages/searchUtils/quick-selections.module';
import {IconsModule} from '../openaireLibrary/utils/icons/icons.module'; import {IconsModule} from '../openaireLibrary/utils/icons/icons.module';
import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-paging.module';
@NgModule({ @NgModule({
imports: [ imports: [
@ -42,7 +43,7 @@ import {IconsModule} from '../openaireLibrary/utils/icons/icons.module';
SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule, SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule,
SEOServiceModule, MatSelectModule, EntitiesSelectionModule, SEOServiceModule, MatSelectModule, EntitiesSelectionModule,
TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule, TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule,
AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule, NoLoadPaging
], ],
declarations: [ declarations: [
CommunityComponent CommunityComponent

View File

@ -103,9 +103,10 @@ export class CuratorsComponent {
private getCurators() { private getCurators() {
this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => { this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => {
this.curators = curators; this.curators = curators;
for (let i = 0; i < this.curators.length; i++) { this.showLoading = false;
this.showMore[i] = false; }, error => {
} console.error(error);
this.curators = [];
this.showLoading = false; this.showLoading = false;
})); }));
} }
@ -122,10 +123,6 @@ export class CuratorsComponent {
})); }));
} }
public toggle(index: number) {
this.showMore[index] = !this.showMore[index];
}
format(name: string) { format(name: string) {
if (name) { if (name) {
return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name); return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name);

View File

@ -92,7 +92,7 @@
[page]="page" [pageSize]="size" [page]="page" [pageSize]="size"
[totalResults]="communityIds.length" > [totalResults]="communityIds.length" >
</no-load-paging> </no-load-paging>
<div *ngIf="communityIds && communityIds.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m" uk-grid <div *ngIf="communityIds && communityIds.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid
uk-height-match="target: .header, .body"> uk-height-match="target: .header, .body">
<ng-template ngFor let-item [ngForOf]="communityIds" let-i="index"> <ng-template ngFor let-item [ngForOf]="communityIds" let-i="index">
<div *ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]['zenodoid']]" <div *ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]['zenodoid']]"

@ -1 +1 @@
Subproject commit de829d2bccc33b4231c1c1349dd449a2dfb1f8c4 Subproject commit db5c95fe248c0e4fe059602185ee8a6161d9949f

@ -1 +1 @@
Subproject commit 8f8b85e69d5c505ed59b12b8b70348096f339775 Subproject commit 32040ce807ad4945e7682b39a3fbc6faecf2f619