From f9da526f0ca3073f3f61c2cbae32b4853791f806 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Wed, 8 Apr 2026 10:46:18 -0400 Subject: [PATCH 1/2] =?UTF-8?q?[ENG-10063]=20orcid=20integration=C2=A0=20(?= =?UTF-8?q?#939)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(profile-settings): Add query-param to specify a tab (#906) * [ENG-10584][ENG-10585] Allow users to disconnect existing orcid in social tab (#912) * feat(settings): Allow users to disconnect orcid in social tab * feat(settings): Add dummy connect button when no orcid is associated with user * chore(settings): move authenticated identity to own component * refactor(settings): Implement CR suggestions; Update tests * refactor(settings): Update authenticated identity test * refactor(settings): Update authenticated identity test to use OSFTestingModule * feat(settings): Allow user to connect ORCID in profile settings page (#918) * [ENG-10684] Update Authenticated Identity section (#924) * feat(settings): update authenticated identity section * style(settings): Update styles * refactor(settings): Update Authenticated Identity section * chore(settings): Update Authenticated identity section language (#930) * fix(settings): Update connectOrcid to properly logging user out (#934) --- src/app/core/services/auth.service.ts | 4 +- .../profile-information.component.ts | 3 +- .../authenticated-identity.component.html | 40 ++++++++ .../authenticated-identity.component.scss | 0 .../authenticated-identity.component.spec.ts | 71 ++++++++++++++ .../authenticated-identity.component.ts | 92 ++++++++++++++++++ .../components/social/social.component.html | 2 + .../social/social.component.spec.ts | 8 +- .../components/social/social.component.ts | 7 +- .../profile-settings.component.spec.ts | 15 ++- .../profile-settings.component.ts | 19 +++- .../enums/external-identity-status.enum.ts | 5 + .../models/user/external-identity.model.ts | 4 +- src/assets/i18n/en.json | 5 + .../images/integrations/orcid-logotype.png | Bin 0 -> 14455 bytes 15 files changed, 265 insertions(+), 10 deletions(-) create mode 100644 src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.html create mode 100644 src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.scss create mode 100644 src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.spec.ts create mode 100644 src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.ts create mode 100644 src/app/shared/enums/external-identity-status.enum.ts create mode 100644 src/assets/images/integrations/orcid-logotype.png diff --git a/src/app/core/services/auth.service.ts b/src/app/core/services/auth.service.ts index b51cb58b9..074e4d732 100644 --- a/src/app/core/services/auth.service.ts +++ b/src/app/core/services/auth.service.ts @@ -73,13 +73,13 @@ export class AuthService { window.location.href = loginUrl; } - logout(): void { + logout(nextUrl?: string): void { this.loaderService.show(); this.actions.clearCurrentUser(); if (isPlatformBrowser(this.platformId)) { this.cookieService.deleteAll(); - window.location.href = `${this.webUrl}/logout/?next=${encodeURIComponent('/')}`; + window.location.href = `${this.webUrl}/logout/?next=${encodeURIComponent(nextUrl || '/')}`; } } diff --git a/src/app/features/profile/components/profile-information/profile-information.component.ts b/src/app/features/profile/components/profile-information/profile-information.component.ts index da555cac9..68b9edf81 100644 --- a/src/app/features/profile/components/profile-information/profile-information.component.ts +++ b/src/app/features/profile/components/profile-information/profile-information.component.ts @@ -10,6 +10,7 @@ import { RouterLink } from '@angular/router'; import { EducationHistoryComponent } from '@osf/shared/components/education-history/education-history.component'; import { EmploymentHistoryComponent } from '@osf/shared/components/employment-history/employment-history.component'; import { SOCIAL_LINKS } from '@osf/shared/constants/social-links.const'; +import { ExternalIdentityStatus } from '@osf/shared/enums/external-identity-status.enum'; import { IS_MEDIUM } from '@osf/shared/helpers/breakpoints.tokens'; import { Institution } from '@osf/shared/models/institutions/institutions.model'; import { UserModel } from '@osf/shared/models/user/user.model'; @@ -50,7 +51,7 @@ export class ProfileInformationComponent { orcidId = computed(() => { const orcid = this.currentUser()?.external_identity?.ORCID; - return orcid?.status?.toUpperCase() === 'VERIFIED' ? orcid.id : undefined; + return orcid?.status?.toUpperCase() === ExternalIdentityStatus.VERIFIED ? orcid.id : undefined; }); toProfileSettings() { diff --git a/src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.html b/src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.html new file mode 100644 index 000000000..ecd67c295 --- /dev/null +++ b/src/app/features/settings/profile-settings/components/authenticated-identity/authenticated-identity.component.html @@ -0,0 +1,40 @@ +
{{ 'settings.profileSettings.social.orcidWarning' | translate }}
+