diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts index 43863854a..e19029555 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -154,6 +154,21 @@ export class ConfigurationService extends BaseComponent { return this._authProviders; } + private _researcherId: any; + get researcherId(): boolean { + return this._researcherId; + } + + private _grantId: any; + get grantId(): boolean { + return this._grantId; + } + + private _organizationId: any; + get organizationId(): boolean { + return this._organizationId; + } + public loadConfiguration(): Promise { return new Promise((r, e) => { // We need to exclude all interceptors here, for the initial configuration request. @@ -224,6 +239,10 @@ export class ConfigurationService extends BaseComponent { this._newReleaseNotificationLink = config.newReleaseNotification?.link; this._newReleaseNotificationVersionCode = config.newReleaseNotification?.versionCode; this._authProviders = AuthProviders.parseValue(config.authProviders); + this._researcherId = config.referenceTypes.researcherId; + this._grantId = config.referenceTypes.grantId; + this._organizationId = config.referenceTypes.organizationId; + } } diff --git a/dmp-frontend/src/app/core/services/reference-type/reference-type.service.ts b/dmp-frontend/src/app/core/services/reference-type/reference-type.service.ts index 100a0a5bd..d4c22fd73 100644 --- a/dmp-frontend/src/app/core/services/reference-type/reference-type.service.ts +++ b/dmp-frontend/src/app/core/services/reference-type/reference-type.service.ts @@ -131,14 +131,14 @@ export class ReferenceTypeService { } public getResearcherReferenceType(): any { - return '5a2112e7-ea99-4cfe-98a1-68665e26726e'; + return this.configurationService.researcherId; } public getGrantReferenceType(): any { - return '5b9c284f-f041-4995-96cc-fad7ad13289c'; + return this.configurationService.grantId; } public getOrganizationReferenceType(): any { - return '7eeffb98-58fb-4921-82ec-e27f32f8e738'; + return this.configurationService.organizationId; } } \ No newline at end of file diff --git a/dmp-frontend/src/assets/config/config.json b/dmp-frontend/src/assets/config/config.json index f43a62736..83be8f664 100644 --- a/dmp-frontend/src/assets/config/config.json +++ b/dmp-frontend/src/assets/config/config.json @@ -65,5 +65,10 @@ "cultures": ["en"] } ] + }, + "referenceTypes": { + "researcherId": "5a2112e7-ea99-4cfe-98a1-68665e26726e", + "grantId": "5b9c284f-f041-4995-96cc-fad7ad13289c", + "organizationId": "7eeffb98-58fb-4921-82ec-e27f32f8e738" } }