File tree Expand file tree Collapse file tree 6 files changed +20
-4
lines changed
features/profile/components/profile-information Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,10 @@ <h1>{{ currentUser()?.fullName }}</h1>
1414
1515 < div class ="flex flex-column gap-4 min-w-0 xl:align-items-end xl:flex-1 ">
1616 < div class ="flex flex-column gap-3 w-full md:flex-row xl:gap-4 xl:justify-content-end ">
17- @if (currentUser()?.social?.orcid ) {
17+ @if (orcidId() ) {
1818 < div class ="flex flex-row align-items-center gap-2 ">
1919 < img ngSrc ="assets/icons/colored/orcid.svg " width ="16 " height ="16 " alt ="orcid " />
20- < a class ="font-bold " [href] ="'https://orcid.org/' + currentUser()?.social?.orcid ">
21- https://orcid.org/{{ currentUser()?.social?.orcid }}
22- </ a >
20+ < a class ="font-bold " [href] ="'https://orcid.org/' + orcidId() "> https://orcid.org/{{ orcidId() }} </ a >
2321 </ div >
2422 }
2523
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ export class ProfileInformationComponent {
4343
4444 userSocials = computed ( ( ) => mapUserSocials ( this . currentUser ( ) ?. social , SOCIAL_LINKS ) ) ;
4545
46+ orcidId = computed ( ( ) => {
47+ const orcid = this . currentUser ( ) ?. external_identity ?. ORCID ;
48+ return orcid ?. status ?. toUpperCase ( ) === 'VERIFIED' ? orcid . id : undefined ;
49+ } ) ;
50+
4651 toProfileSettings ( ) {
4752 this . editProfile . emit ( ) ;
4853 }
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class UserMapper {
3232 employment : user . attributes . employment ,
3333 iri : user . links . iri ,
3434 social : user . attributes . social ,
35+ external_identity : user . attributes . external_identity ,
3536 defaultRegionId : user . relationships ?. default_region ?. data ?. id ,
3637 canViewReviews : user . attributes . can_view_reviews === true , // [NS] Do not simplify it
3738 timezone : user . attributes . timezone ,
Original file line number Diff line number Diff line change 1+ export interface OrcidInfo {
2+ id : string ;
3+ status : string ;
4+ }
5+
6+ export interface ExternalIdentityModel {
7+ ORCID ?: OrcidInfo | null ;
8+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { ResponseDataJsonApi } from '../common/json-api.model';
22
33import { Education } from './education.model' ;
44import { Employment } from './employment.model' ;
5+ import { ExternalIdentityModel } from './external-identity.model' ;
56import { SocialModel } from './social.model' ;
67
78export type UserResponseJsonApi = ResponseDataJsonApi < UserDataJsonApi > ;
@@ -47,6 +48,7 @@ export interface UserAttributesJsonApi {
4748 suffix : string ;
4849 locale : string ;
4950 social : SocialModel ;
51+ external_identity : ExternalIdentityModel ;
5052 timezone : string ;
5153}
5254
Original file line number Diff line number Diff line change 11import { Education } from './education.model' ;
22import { Employment } from './employment.model' ;
3+ import { ExternalIdentityModel } from './external-identity.model' ;
34import { SocialModel } from './social.model' ;
45
56export interface UserData {
@@ -24,6 +25,7 @@ export interface UserModel {
2425 timezone : string ;
2526 locale : string ;
2627 social : SocialModel ;
28+ external_identity : ExternalIdentityModel ;
2729 defaultRegionId : string ;
2830 link ?: string ;
2931 iri ?: string ;
You can’t perform that action at this time.
0 commit comments