Production release (for EOSC EXPLORE) December 2023 #24

Merged
konstantina.galouni merged 10 commits from develop into master 2023-12-12 11:43:47 +01:00
1 changed files with 9 additions and 3 deletions
Showing only changes of commit f537920702 - Show all commits

View File

@ -193,7 +193,7 @@ export class Identifier {
pid = Identifier.getRawDOIValue(pid);
return {"class": "doi", "id": pid};
} else if (Identifier.isValidORCID(pid)) {
return {"class": "ORCID", "id": pid};
return {"class": "ORCID", "id": Identifier.getRawORCID(pid)};
} else if (Identifier.isValidPMCID(pid)) {
return {"class": "pmc", "id": pid};
} else if (Identifier.isValidPMID(pid)) {
@ -236,9 +236,15 @@ export class Identifier {
public static isValidORCID(str: string): boolean {
let exp = /\b\d{4}-\d{4}-\d{4}-(\d{3}X|\d{4})\b/g;
return str.match(exp) != null;
return str.match(exp) != null || this.getRawORCID(str).match(exp) != null;
}
public static getRawORCID(id: string): string {
if(id.indexOf("orcid.org")!=-1 && id.split("orcid.org/").length > 1){
id = id.split("orcid.org/")[1];
}
return id;
}
public static isValidPMID(str: string): boolean {
let exp = /^\d*$/g;
return str.match(exp) != null;