From 99198fb0d9d36688b88e78350b5f8f7df0efa0b6 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 11 Aug 2020 12:39:55 +0000 Subject: [PATCH] [Library|Trunk] Domain: properties --> domain: change it to https:// + domain (needed fro jsonld) getCommunityFromDomain function: split to remove the https:// git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59248 d315682c-612b-4755-9ff5-7f18f6832af3 --- connect/connectHelper.ts | 3 ++- .../service/open-aire-jsonld-converter.service.ts | 4 +++- utils/properties/environment-specific.service.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 259f41b8..e4c7b07f 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -3,7 +3,8 @@ import {HttpParams} from '@angular/common/http'; export class ConnectHelper { public static getCommunityFromDomain(domain: string): string{ - //domain = "beta.covid-19.openaire.eu"; //for testing + // domain = "https://mes.openaire.eu"; //for testing + domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix if (domain.indexOf('openaire.eu') === -1) { return null; } diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts index 2d5254ee..24eb9d8e 100644 --- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts +++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts @@ -17,7 +17,9 @@ export class OpenAireJsonldConverterService { organization["@type"] = "Organization"; organization["name"] = name; organization["url"] = URL; - organization["logo"] = logoURL; + if(logoURL && logoURL.length > 0 ) { + organization["logo"] = logoURL; + } if(description){ organization["description"] = description; } diff --git a/utils/properties/environment-specific.service.ts b/utils/properties/environment-specific.service.ts index deb34a7a..378092fc 100644 --- a/utils/properties/environment-specific.service.ts +++ b/utils/properties/environment-specific.service.ts @@ -17,7 +17,7 @@ export class EnvironmentSpecificService { private propertiesPath = "/assets/env-properties.json?v=2"; constructor(private http: HttpClient, @Optional() @Inject(REQUEST) private request: Request) { - properties.domain = this.getDomain(); + properties.domain = "https://" + this.getDomain(); } public loadEnvironment() {