From 2261f4ae6f8ea4a2d52aaf75c857e583bf913721 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Sep 2022 14:08:01 +0300 Subject: [PATCH] [Library | new-theme]: orcidWork.ts: [Bug fix] When no resultLandingInfo.types, set work['type'] according to resultLandingInfo.resultType | icons.ts: [Bug fix] Remove unnecessary classes in orcid_add and orcid_bin icons - class had always the value of the first loaded icon (less problem). --- orcid/orcidWork.ts | 9 ++++++--- utils/icons/icons.ts | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/orcid/orcidWork.ts b/orcid/orcidWork.ts index 83816617..9bceefae 100644 --- a/orcid/orcidWork.ts +++ b/orcid/orcidWork.ts @@ -25,13 +25,13 @@ export class WorkV3_0 { private static mapType(type: string): string { if(type == "Annotation") { return "annotation"; - } else if(type == "Article") { + } else if(type == "Article" || type == "publication") { return "journal-article"; } else if(type == "Book") { return "book"; } else if(type == "Clinical Trial") { return "test"; - } else if(type == "Dataset") { + } else if(type == "Dataset" || type == "dataset") { return "data-set"; } else if(type == "Doctoral thesis") { return "dissertation-thesis"; @@ -55,7 +55,7 @@ export class WorkV3_0 { return "working-paper"; } else if(type == "Review") { return "book-review"; - } else if(type == "Software") { + } else if(type == "Software" || type == "software") { return "software"; } return "other"; @@ -121,6 +121,9 @@ export class WorkV3_0 { } // work['type'] = this.mapType(resultLandingInfo.types[0]); } + if(!work['type']) { + work['type'] = this.mapType(resultLandingInfo.resultType); + } if(resultLandingInfo.date || resultLandingInfo.dateofacceptance) { if(resultLandingInfo.dateofacceptance) { diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index 07e21dbd..1a6447dd 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -200,12 +200,12 @@ export const filters = { export const orcid_add = { name: 'orcid_add', - data: '' + data: '' } export const orcid_bin = { name: 'orcid_bin', - data: '' + data: '' } export const link = {