Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User effective user orcid to store contributors #1708

Merged
merged 10 commits into from
Jul 28, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function getContributor(): Contributor[] {
function getUserRecord(): UserRecord {
return {
userInfo: {
REAL_USER_ORCID: '0000-0000-0000-000X',
EFFECTIVE_USER_ORCID: '0000-0000-0000-000X',
},
} as UserRecord
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export class WorkContributorRolesComponent implements OnInit {
private getRecordHolderContribution(): Contributor {
return this.contributors?.find(
(c) =>
c?.contributorOrcid?.path === this.userRecord?.userInfo?.REAL_USER_ORCID
c?.contributorOrcid?.path ===
this.userRecord?.userInfo?.EFFECTIVE_USER_ORCID
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class WorkContributorsComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.id = this.userRecord?.userInfo?.REAL_USER_ORCID
// EFFECTIVE_USER_ORCID keeps the ORCID id of the user you are on.
// REAL_USER_ORCID will contain the orcid id of a delegator when on delegation mode.
this.id = this.userRecord?.userInfo?.EFFECTIVE_USER_ORCID
this.platform
.get()
.pipe(takeUntil(this.$destroy))
Expand Down