diff --git a/src/app/account-settings/account-settings.module.ts b/src/app/account-settings/account-settings.module.ts index b7f9a3bd55..5a906d3eb5 100644 --- a/src/app/account-settings/account-settings.module.ts +++ b/src/app/account-settings/account-settings.module.ts @@ -24,9 +24,6 @@ import { TwoFactorAuthenticationFormModule } from '../cdk/two-factor-authenticat import { VerificationEmailModalService } from '../core/verification-email-modal/verification-email-modal.service' import { SharedModule } from '../shared/shared.module' import { AccountSettingsRoutingModule } from './account-settings-routing.module' -import { DialogActionsDuplicatedMergedConfirmedComponent } from './components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component' -import { DialogActionsDuplicatedTwoFactorAuthComponent } from './components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component' -import { DialogActionsDuplicatedComponent } from './components/dialog-actions-duplicated/dialog-actions-duplicated.component' import { DialogSecurityAlternateAccountDeleteComponent } from './components/dialog-security-alternate-account-delete/dialog-security-alternate-account-delete.component' import { SettingsActionsDeactivateComponent } from './components/settings-actions-deactivate/settings-actions-deactivate.component' import { SettingsActionsDownloadComponent } from './components/settings-actions-download/settings-actions-download.component' @@ -68,9 +65,6 @@ import { ConfirmDeactivateAccountComponent } from './pages/confirm-deactivate-ac SettingsActionsDownloadComponent, SettingsActionsDeactivateComponent, SettingsActionsDuplicatedComponent, - DialogActionsDuplicatedComponent, - DialogActionsDuplicatedMergedConfirmedComponent, - DialogActionsDuplicatedTwoFactorAuthComponent, SettingsSharingComponent, SettingsSharingQrCodeComponent, SettingsSharingHtmlCodeComponent, diff --git a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.html b/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.html deleted file mode 100644 index b4a7bdffee..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.html +++ /dev/null @@ -1,43 +0,0 @@ - - Duplicate record removed! - ORCID record - {{ data.deprecatingOrcid }} - - has been removed and now refers to your current record, - - - {{ data.primaryAccountName }} - {{ data.primaryOrcid }} - - - - diff --git a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.scss b/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.spec.ts b/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.spec.ts deleted file mode 100644 index e7dc6b1022..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { DialogActionsDuplicatedMergedConfirmedComponent } from './dialog-actions-duplicated-merged-confirmed.component' -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog' -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' - -describe('DialogActionsDuplicatedMergedConfirmedComponent', () => { - let component: DialogActionsDuplicatedMergedConfirmedComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [DialogActionsDuplicatedMergedConfirmedComponent], - providers: [ - { provide: MatDialogRef, useValue: {} }, - { provide: MAT_DIALOG_DATA, useValue: {} }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents() - }) - - beforeEach(() => { - fixture = TestBed.createComponent( - DialogActionsDuplicatedMergedConfirmedComponent - ) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.ts b/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.ts deleted file mode 100644 index 3cc916cfeb..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core' -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog' -import { DuplicateRemoveEndpoint } from 'src/app/types/account-actions-duplicated' -@Component({ - selector: 'app-dialog-actions-duplicated-merged-confirmed', - templateUrl: './dialog-actions-duplicated-merged-confirmed.component.html', - styleUrls: ['./dialog-actions-duplicated-merged-confirmed.component.scss'], - preserveWhitespaces: true, - standalone: false, -}) -export class DialogActionsDuplicatedMergedConfirmedComponent implements OnInit { - baseUrl = runtimeEnvironment.BASE_URL - - constructor( - private matRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DuplicateRemoveEndpoint - ) {} - - ngOnInit(): void {} - - ok() { - this.matRef.close(this.data) - } -} diff --git a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.html b/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.html deleted file mode 100644 index 02688a9cc5..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - Two factor authentication - - - - diff --git a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.scss b/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.spec.ts b/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.spec.ts deleted file mode 100644 index 383c5cf999..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { DialogActionsDuplicatedTwoFactorAuthComponent } from './dialog-actions-duplicated-two-factor-auth.component' -import { WINDOW_PROVIDERS } from '../../../cdk/window' -import { PlatformInfoService } from '../../../cdk/platform-info' -import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service' -import { SnackbarService } from '../../../cdk/snackbar/snackbar.service' -import { MatSnackBar } from '@angular/material/snack-bar' -import { - MAT_DIALOG_DATA, - MatDialog, - MatDialogRef, -} from '@angular/material/dialog' -import { Overlay } from '@angular/cdk/overlay' -import { HttpClientTestingModule } from '@angular/common/http/testing' -import { RouterTestingModule } from '@angular/router/testing' -import { TwoFactorAuthenticationService } from '../../../core/two-factor-authentication/two-factor-authentication.service' - -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' - -describe('DialogActionsDuplicatedTwoFactorAuthComponent', () => { - let component: DialogActionsDuplicatedTwoFactorAuthComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule], - declarations: [DialogActionsDuplicatedTwoFactorAuthComponent], - providers: [ - { provide: MatDialogRef, useValue: {} }, - { provide: MAT_DIALOG_DATA, useValue: {} }, - WINDOW_PROVIDERS, - TwoFactorAuthenticationService, - PlatformInfoService, - ErrorHandlerService, - SnackbarService, - MatSnackBar, - MatDialog, - Overlay, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents() - }) - - beforeEach(() => { - fixture = TestBed.createComponent( - DialogActionsDuplicatedTwoFactorAuthComponent - ) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.ts b/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.ts deleted file mode 100644 index 5121589682..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated-two-factor-auth/dialog-actions-duplicated-two-factor-auth.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core' -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog' -import { OauthService } from 'src/app/core/oauth/oauth.service' -import { DuplicateRemoveEndpoint } from 'src/app/types/account-actions-duplicated' - -import { DialogActionsDuplicatedMergedConfirmedComponent } from '../dialog-actions-duplicated-merged-confirmed/dialog-actions-duplicated-merged-confirmed.component' -import { TwoFactorAuthenticationService } from '../../../core/two-factor-authentication/two-factor-authentication.service' - -@Component({ - selector: 'app-dialog-actions-duplicated-two-factor-auth', - templateUrl: './dialog-actions-duplicated-two-factor-auth.component.html', - styleUrls: ['./dialog-actions-duplicated-two-factor-auth.component.scss'], - standalone: false, -}) -export class DialogActionsDuplicatedTwoFactorAuthComponent implements OnInit { - showBadVerificationCode: boolean - showBadRecoveryCode: boolean - loading: boolean - constructor( - private _twoFactorAuthenticationService: TwoFactorAuthenticationService, - private matRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DuplicateRemoveEndpoint - ) {} - - ngOnInit(): void {} - authenticate(code: { verificationCode?: string; recoveryCode?: string }) { - this.showBadVerificationCode = false - this.showBadRecoveryCode = false - this.loading = true - this._twoFactorAuthenticationService - .submitCodeForAnotherAccount({ - orcid: this.data.deprecatingOrcid, - verificationCode: code.verificationCode || null, - recoveryCode: code.recoveryCode || null, - errors: [], - redirectUrl: null, - }) - .subscribe((res) => { - this.loading = false - if (res.errors && res.errors.length > 0) { - if (res.errors[0].includes('verification')) { - this.showBadVerificationCode = true - } else { - this.showBadRecoveryCode = true - } - } else if (res.redirectUrl) { - this.matRef.close(this.data) - } - }) - } -} diff --git a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.html b/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.html deleted file mode 100644 index 4ed2df5107..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.html +++ /dev/null @@ -1,100 +0,0 @@ - - Remove duplicate record - - - - - Warning! All information will be deleted from the duplicate record. Only - the email addresses will be transferred to your main ORCID record. - Removing a duplicate record cannot be undone. - - - -

- Remove this record -

- - {{ data.deprecatingAccountName }} - ({{ data.deprecatingOrcid }}) - - - Name is private - {{ data.deprecatingOrcid }} - -
{{ email }}
- -

- Keep this record -

- - - {{ data.primaryAccountName }} - ({{ data.primaryOrcid }}) - - - - {{ data.primaryOrcid }} - -
{{ email }}
- - - - -
diff --git a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss b/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss deleted file mode 100644 index ff0d54d759..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -h2 { - border-bottom: solid 2px; - padding-bottom: 8px; - margin-bottom: 16px; -} diff --git a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss-theme.scss b/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss-theme.scss deleted file mode 100644 index ddb1f163d4..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.scss-theme.scss +++ /dev/null @@ -1,19 +0,0 @@ -@use '@angular/material' as mat; -@import 'src/assets/scss/material.orcid-theme.scss'; - -@mixin dialog-actions-duplicated($theme) { - $primary: map-get($theme, primary); - $accent: map-get($theme, accent); - $warn: map-get($theme, accent); - $foreground: map-get($theme, foreground); - $background: map-get($theme, background); - - h2.remove { - border-color: map-get($foreground, 'state-warning-dark'); - } - h2.keep { - border-color: mat.m2-get-color-from-palette($accent, 400); - } -} - -@include dialog-actions-duplicated($orcid-app-theme); diff --git a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.spec.ts b/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.spec.ts deleted file mode 100644 index d63bdff293..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { DialogActionsDuplicatedComponent } from './dialog-actions-duplicated.component' -import { HttpClientTestingModule } from '@angular/common/http/testing' -import { RouterTestingModule } from '@angular/router/testing' -import { - MAT_DIALOG_DATA, - MatDialog, - MatDialogRef, -} from '@angular/material/dialog' -import { WINDOW_PROVIDERS } from '../../../cdk/window' -import { PlatformInfoService } from '../../../cdk/platform-info' -import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service' -import { SnackbarService } from '../../../cdk/snackbar/snackbar.service' -import { MatSnackBar } from '@angular/material/snack-bar' -import { Overlay } from '@angular/cdk/overlay' - -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' - -describe('DialogActionsDuplicatedComponent', () => { - let component: DialogActionsDuplicatedComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule], - declarations: [DialogActionsDuplicatedComponent], - providers: [ - { provide: MatDialogRef, useValue: {} }, - { provide: MAT_DIALOG_DATA, useValue: {} }, - WINDOW_PROVIDERS, - PlatformInfoService, - ErrorHandlerService, - SnackbarService, - MatSnackBar, - MatDialog, - Overlay, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents() - }) - - beforeEach(() => { - fixture = TestBed.createComponent(DialogActionsDuplicatedComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.ts b/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.ts deleted file mode 100644 index f19876df1b..0000000000 --- a/src/app/account-settings/components/dialog-actions-duplicated/dialog-actions-duplicated.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core' -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog' -import { PlatformInfoService } from 'src/app/cdk/platform-info' -import { DuplicateRemoveEndpoint } from 'src/app/types/account-actions-duplicated' -@Component({ - selector: 'app-dialog-actions-duplicated', - templateUrl: './dialog-actions-duplicated.component.html', - styleUrls: [ - './dialog-actions-duplicated.component.scss', - './dialog-actions-duplicated.component.scss-theme.scss', - ], - standalone: false, -}) -export class DialogActionsDuplicatedComponent implements OnInit { - isMobile: boolean - baseUrl = runtimeEnvironment.BASE_URL - constructor( - private matRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DuplicateRemoveEndpoint, - private _platform: PlatformInfoService - ) {} - - ngOnInit(): void { - this._platform.get().subscribe((platform) => { - this.isMobile = platform.columns4 || platform.columns8 - }) - } - - ok() { - this.matRef.close(this.data) - } - cancel() { - this.matRef.close(null) - } -} diff --git a/src/app/account-settings/components/settings-actions-duplicated/settings-actions-duplicated.component.html b/src/app/account-settings/components/settings-actions-duplicated/settings-actions-duplicated.component.html index 3cda8dee92..483a7972ca 100644 --- a/src/app/account-settings/components/settings-actions-duplicated/settings-actions-duplicated.component.html +++ b/src/app/account-settings/components/settings-actions-duplicated/settings-actions-duplicated.component.html @@ -1,110 +1,158 @@ -
-

- If you have two or more ORCID records you can easily remove any unwanted - duplicates. + @if (success) { + +

Duplicate account removed

+

+ The record {{ orcidToDeprecate }} has been deprecated. +

+ + } @if (cancelAuthentication) { + +

Duplicate account not removed

+

+ We could not verify your ORCID account details. The duplicate record has + not been deprecated.

+
+ } +

+ If you have two or more ORCID records you can easily remove any unwanted + duplicates. +

+

+ Learn more about removing duplicate records +

- + +

What happens when you remove a duplicate ORCID account?

-
    -
  • - - - The email addresses associated with the duplicate record are added - to this record - ({{ userSession?.userInfo?.EFFECTIVE_USER_ORCID }}) +
      +
    • + The email addresses are transferred from the duplicate account to + {{ orcid }}
    • -
    • - - All other information is deleted from the duplicate record +
    • + All information on the duplicate account is permanently deleted
    - -

    - Learn more about removing duplicate records + + @if (authenticated) { + +

    You are removing this duplicate account

    + @if (data.deprecatingAccountName) { +

    {{ data.deprecatingAccountName }}

    + } @else { +

    Name is private

    + } +

    + https:{{ baseUrl + data.deprecatingOrcid }}

    -

    - If you have more than one duplicate record repeat the process for each - record. + Email addresses to be transferred to this account ({{ orcid }}) +

    {{ data.deprecatingEmails?.join(', ') }}
    + All other information on this account will be permanently deleted. + +
  • + } @else { +
    +

    Which account do you want to remove?

    +

    + You will need to verify your sign in details for the duplicate account + before it can be removed.

    - - -