diff --git a/landingPages/landing-utils/relatedTo.component.ts b/landingPages/landing-utils/relatedTo.component.ts index 056eb435..c41f4bff 100644 --- a/landingPages/landing-utils/relatedTo.component.ts +++ b/landingPages/landing-utils/relatedTo.component.ts @@ -11,7 +11,7 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; @Component({ selector: 'relatedTo', template: ` -
+
Communities
@@ -169,52 +169,50 @@ export class RelatedToComponent implements OnInit { ngOnInit() { this.contexts.sort(this.compare); - if(properties.environment === "development") { - let index = 0; - this.contexts.forEach( context => { - if(context.idContext) { - this.subscriptions.push( - this.userManagementService.getUserInfo().subscribe( user => { - //- handling subscribe errors? - this.subscriptions.push( - this.communityService.getCommunity(context.idContext).subscribe( community => { - if(community && !ConnectHelper.isPrivate(community,user) && (this.currentCommunity != context.idContext)) { - // creating the link, based on the enviroment - let url = ''; - if(properties.environment == "beta") { - url = 'https://beta.' + context.idContext + '.openaire.eu'; - } else { - url = 'https://' + context.idContext + '.openaire.eu'; - } - context.link = url; - 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); + let index = 0; + this.contexts.forEach( context => { + if(context.idContext) { + this.subscriptions.push( + this.userManagementService.getUserInfo().subscribe( user => { + //- handling subscribe errors? + this.subscriptions.push( + this.communityService.getCommunity(context.idContext).subscribe( community => { + if(community && !ConnectHelper.isPrivate(community,user) && (this.currentCommunity != context.idContext)) { + // creating the link, based on the enviroment + let url = ''; + if(properties.environment == "beta") { + url = 'https://beta.' + context.idContext + '.openaire.eu'; } else { - if(this.currentCommunity != context.idContext) { - for(let other of this.otherCommunities) { - if(other.idContext == context.idContext) { - return; // skips so that we don't get duplicate communities because of the multiple concepts - } + url = 'https://' + context.idContext + '.openaire.eu'; + } + context.link = url; + 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); + } else { + if(this.currentCommunity != context.idContext) { + for(let other of this.otherCommunities) { + if(other.idContext == context.idContext) { + return; // skips so that we don't get duplicate communities because of the multiple concepts } } - this.otherCommunities.push(context); } - index++; - if(index == this.contexts.length) { - this.gateways.sort(this.compare); - this.otherCommunities.sort(this.compare); - } - }) - ); - }) - ); - } - }); - } + this.otherCommunities.push(context); + } + index++; + if(index == this.contexts.length) { + this.gateways.sort(this.compare); + this.otherCommunities.sort(this.compare); + } + }) + ); + }) + ); + } + }); } ngOnDestroy() {