diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 90da93795..839318eaf 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -62,10 +62,11 @@ export class AppComponent implements OnInit { } private showEmailDialog() { + const unverifiedEmailsData = this.unverifiedEmails(); this.customDialogService.open(ConfirmEmailComponent, { - header: 'home.confirmEmail.title', + header: unverifiedEmailsData[0].isMerge ? 'home.confirmEmail.merge.title' : 'home.confirmEmail.add.title', width: '448px', - data: this.unverifiedEmails(), + data: unverifiedEmailsData, }); } } diff --git a/src/app/shared/components/confirm-email/confirm-email.component.html b/src/app/shared/components/confirm-email/confirm-email.component.html index 7a52115e1..861a1c63d 100644 --- a/src/app/shared/components/confirm-email/confirm-email.component.html +++ b/src/app/shared/components/confirm-email/confirm-email.component.html @@ -1,9 +1,17 @@
@if (!isSubmitting()) {

- {{ 'home.confirmEmail.description' | translate }} + {{ + email.isMerge + ? ('home.confirmEmail.merge.description' | translate) + : ('home.confirmEmail.add.description' | translate) + }} {{ email.emailAddress }} - {{ 'home.confirmEmail.description2' | translate }} + {{ + email.isMerge + ? ('home.confirmEmail.merge.description2' | translate) + : ('home.confirmEmail.add.description2' | translate) + }}

@@ -19,7 +27,11 @@ class="w-full" styleClass="w-full" (onClick)="verifyEmail()" - [label]="'home.confirmEmail.goToEmails' | translate" + [label]=" + email.isMerge + ? ('home.confirmEmail.merge.goToEmails' | translate) + : ('home.confirmEmail.add.goToEmails' | translate) + " >
} @else { diff --git a/src/app/shared/components/confirm-email/confirm-email.component.ts b/src/app/shared/components/confirm-email/confirm-email.component.ts index c7ce1f632..54a102a92 100644 --- a/src/app/shared/components/confirm-email/confirm-email.component.ts +++ b/src/app/shared/components/confirm-email/confirm-email.component.ts @@ -37,22 +37,28 @@ export class ConfirmEmailComponent { } closeDialog() { + let isMerge = this.email.isMerge; this.actions .deleteEmail(this.email.id) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { - this.toastService.showSuccess('home.confirmEmail.emailNotAdded', { name: this.email.emailAddress }); + let showSuccessText = isMerge ? 'home.confirmEmail.merge.emailNotAdded' : 'home.confirmEmail.add.emailNotAdded'; + this.toastService.showSuccess(showSuccessText, { name: this.email.emailAddress }); this.dialogRef.close(); }); } verifyEmail() { + let isMerge = this.email.isMerge; this.actions .verifyEmail(this.email.id) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe({ next: () => { - this.toastService.showSuccess('home.confirmEmail.emailVerified', { name: this.email.emailAddress }); + let showSuccessText = isMerge + ? 'home.confirmEmail.merge.emailVerified' + : 'home.confirmEmail.add.emailVerified'; + this.toastService.showSuccess(showSuccessText, { name: this.email.emailAddress }); this.dialogRef.close(); }, error: () => this.dialogRef.close(), diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 355bd04eb..428e96b05 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -388,12 +388,22 @@ } }, "confirmEmail": { - "title": "Add alternative email", - "description": "Do you want to add ", - "description2": "to your profile ?", - "goToEmails": "Add email", - "emailNotAdded": "{{name}} has not been added to your account.", - "emailVerified": "{{name}} has been added to your account." + "merge": { + "title": "Merge account", + "description": "Would you like to merge ", + "description2": "into your account? This action is irreversible.", + "goToEmails": "Merge account", + "emailNotAdded": "{{name}} has not been merged into your account.", + "emailVerified": "{{name}} has been merged into your account." + }, + "add": { + "title": "Add alternative email", + "description": "Do you want to add ", + "description2": "to your profile ?", + "goToEmails": "Add email", + "emailNotAdded": "{{name}} has not been added to your account.", + "emailVerified": "{{name}} has been added to your account." + } } }, "myProjects": {