diff --git a/landingPages/landing-utils/relatedTo.component.ts b/landingPages/landing-utils/relatedTo.component.ts index a1787d26..a6190dc5 100644 --- a/landingPages/landing-utils/relatedTo.component.ts +++ b/landingPages/landing-utils/relatedTo.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from '@angular/core'; +import {Component, Input, OnInit} from '@angular/core'; import {Subscriber} from 'rxjs'; import {properties} from 'src/environments/environment'; @@ -11,36 +11,114 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; @Component({ selector: 'relatedTo', template: ` -
Communities
-
- - {{item['labelContext']}} - + + +
+
+ +
+ OpenAIRE Connect image +
+
+
+ +
+
+ +
+ OpenAIRE Connect image +
+
+
+ +
+
+
+
+
+ Visit Connect gateways: +
+ +
+
+
+ OpenAIRE Connect image +
+
+
+
+ +
Communities
+
+ {{item['labelContext']}} - - {{item['labelCategory']}} - : {{item['labelConcept']}} - -
- - + + + + {{item['labelCategory']}} + : {{item['labelConcept']}} +
+
+
+ + View less + +
+
+ + View more + +
+ ` }) -export class RelatedToComponent { - @Input() contexts: { "idContext": string, "labelContext": string, "labelCategory": string, "labelConcept": string, "link": string }[]; - +export class RelatedToComponent implements OnInit { + @Input() contexts: { "idContext": string, "labelContext": string, "labelCategory": string, "labelConcept": string, "link": string, "logo": string }[]; + @Input() connectLinksView: boolean = false; + public threshold: number = 5; public showNum: number = 5; + public gateways = []; private subscriptions = []; constructor(private communityService: CommunityService, @@ -48,7 +126,7 @@ export class RelatedToComponent { } ngOnInit() { - if(properties.environment === "development") { + if(this.connectLinksView && properties.environment === "development") { this.contexts.forEach( context => { if(context.idContext) { this.subscriptions.push( @@ -65,6 +143,16 @@ export class RelatedToComponent { url = 'https://' + context.idContext + '.openaire.eu'; } context.link = url; + // grabbing the logoUrl for the gateway links + if(community.logoUrl) { + context.logo = community.logoUrl; + } + for(let gateway of this.gateways) { + if(gateway.link == context.link) { + return; // skips so that we don't get duplicate gateways + } + } + this.gateways.push(context); } }) ); diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 8d0e76b9..e1ec2cd9 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -59,6 +59,10 @@ {{resultLandingInfo.countries.join(", ")}} + + + +