Merge Angular 16 Irish Monitor to develop #33

Merged
k.triantafyllou merged 151 commits from angular-16-irish-monitor into develop 2024-02-13 09:32:41 +01:00
1 changed files with 15 additions and 12 deletions
Showing only changes of commit 76003bf6d9 - Show all commits

View File

@ -35,19 +35,22 @@ export class SearchOrcidService {
//headers.append('Accept', 'application/orcid+json'); //headers.append('Accept', 'application/orcid+json');
let headers = new HttpHeaders({'Accept': 'application/orcid+json'}); let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
let url = properties.searchOrcidURL + term + '/record'; let url ="https://pub.orcid.org/v3.0/expanded-search/?q=orcid:" + term + '&start=0&rows=50';
return this.http.get(url, {headers: headers})
return this.http.get(url, { headers: headers }) .pipe(map(res => res['expanded-result']))
//.map(res => res.json()['person'])
.pipe(map(res => res['person']))
.pipe(map(res => [res['name']['given-names'],
res['name']['family-name'],
res['name'], res['name']['institution-name']]))
.pipe(map(res => { .pipe(map(res => {
let authors = [] if(res) {
SearchOrcidService.parseOrcidAuthor(res, [], authors, addId) for (let auth_result of res) {
return authors.length > 0 ? authors[0] : null; const author = {};
author['id'] = auth_result['orcid-id'];
author['authorGivenName'] = auth_result['given-names'];
author['authorFamilyName'] = auth_result['family-names'];
author['institutions'] = auth_result['institution-name'];
return author;
}
}
return null;
})); }));
} }
searchOrcidAuthors(term: string, searchOrcidAuthors(term: string,