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 eb28daed4..a26e4464b 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -154,7 +154,7 @@ export class ConfigurationService extends BaseComponent { get authProviders(): AuthProviders { return this._authProviders; } - + private _analyticsProviders: AnalyticsProviders; get analyticsProviders(): AnalyticsProviders { return this._analyticsProviders; @@ -175,6 +175,11 @@ export class ConfigurationService extends BaseComponent { return this._organizationId; } + private _depositRecordUrlIdPlaceholder: string; + get depositRecordUrlIdPlaceholder(): string { + return this._depositRecordUrlIdPlaceholder; + } + public loadConfiguration(): Promise { return new Promise((r, e) => { // We need to exclude all interceptors here, for the initial configuration request. @@ -249,6 +254,7 @@ export class ConfigurationService extends BaseComponent { this._researcherId = config.referenceTypes.researcherId; this._grantId = config.referenceTypes.grantId; this._organizationId = config.referenceTypes.organizationId; + this._depositRecordUrlIdPlaceholder = config.deposit.recordUrlIdPlaceholder; } diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 0375446f9..920399f0a 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -569,14 +569,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { //TODO: needs rewriting const repository = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId); if (typeof repository !== "undefined") { - if (doiModel.repositoryId == "Zenodo") { - const doiarr = doiModel.doi.split('.'); - const id = doiarr[doiarr.length - 1]; - return repository.repositoryRecordUrl + id; - } - else { - return repository.repositoryRecordUrl + doiModel.doi; - } + return repository.repositoryRecordUrl.replace(this.configurationService.depositRecordUrlIdPlaceholder, doiModel.doi); } else { return ""; diff --git a/dmp-frontend/src/assets/config/config.json b/dmp-frontend/src/assets/config/config.json index e3cd639ea..7016d43e7 100644 --- a/dmp-frontend/src/assets/config/config.json +++ b/dmp-frontend/src/assets/config/config.json @@ -82,5 +82,8 @@ "researcherId": "5a2112e7-ea99-4cfe-98a1-68665e26726e", "grantId": "5b9c284f-f041-4995-96cc-fad7ad13289c", "organizationId": "7eeffb98-58fb-4921-82ec-e27f32f8e738" + }, + "deposit":{ + "recordUrlIdPlaceholder": "{doi_id}" } }