deposit url fix

This commit is contained in:
Efstratios Giannopoulos 2024-05-30 13:26:35 +03:00
parent 17a15274de
commit 687fe81b9a
3 changed files with 11 additions and 9 deletions

View File

@ -175,6 +175,11 @@ export class ConfigurationService extends BaseComponent {
return this._organizationId;
}
private _depositRecordUrlIdPlaceholder: string;
get depositRecordUrlIdPlaceholder(): string {
return this._depositRecordUrlIdPlaceholder;
}
public loadConfiguration(): Promise<any> {
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;
}

View File

@ -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 "";

View File

@ -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}"
}
}