From b7243ba5939564e14a648ac9cc92c7528c6642d3 Mon Sep 17 00:00:00 2001 From: mkovalua Date: Wed, 8 Oct 2025 15:39:46 +0300 Subject: [PATCH 1/2] fix( add email/merge account ): show model with merge warning if acc already exists and add alternative email modal if not exists --- src/app/app.component.ts | 7 +++++-- .../confirm-email/confirm-email.component.html | 12 ++++++++++-- src/assets/i18n/en.json | 13 ++++++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 90da93795..22cf04d4b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -62,10 +62,13 @@ 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.isMerge.title' + : 'home.confirmEmail.isNotMerge.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..694a8d666 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.isMerge.description' | translate) + : ('home.confirmEmail.isNotMerge.description' | translate) + }} {{ email.emailAddress }} - {{ 'home.confirmEmail.description2' | translate }} + {{ + email.isMerge + ? ('home.confirmEmail.isMerge.description2' | translate) + : ('home.confirmEmail.isNotMerge.description2' | translate) + }}

diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 355bd04eb..de5febbe2 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -388,9 +388,16 @@ } }, "confirmEmail": { - "title": "Add alternative email", - "description": "Do you want to add ", - "description2": "to your profile ?", + "isMerge": { + "title": "Merge account", + "description": "Would you like to merge ", + "description2": "into your account? This action is irreversible." + }, + "isNotMerge": { + "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." From 509342855ea871120fd9f5f07ce288efe58a8889 Mon Sep 17 00:00:00 2001 From: mkovalua Date: Wed, 8 Oct 2025 18:37:03 +0300 Subject: [PATCH 2/2] fix( add email/merge account ): update modal text --- src/app/app.component.ts | 4 +--- .../confirm-email.component.html | 14 +++++++++----- .../confirm-email/confirm-email.component.ts | 10 ++++++++-- src/assets/i18n/en.json | 19 +++++++++++-------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 22cf04d4b..839318eaf 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -64,9 +64,7 @@ export class AppComponent implements OnInit { private showEmailDialog() { const unverifiedEmailsData = this.unverifiedEmails(); this.customDialogService.open(ConfirmEmailComponent, { - header: unverifiedEmailsData[0].isMerge - ? 'home.confirmEmail.isMerge.title' - : 'home.confirmEmail.isNotMerge.title', + header: unverifiedEmailsData[0].isMerge ? 'home.confirmEmail.merge.title' : 'home.confirmEmail.add.title', width: '448px', 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 694a8d666..861a1c63d 100644 --- a/src/app/shared/components/confirm-email/confirm-email.component.html +++ b/src/app/shared/components/confirm-email/confirm-email.component.html @@ -3,14 +3,14 @@

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

@@ -27,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 de5febbe2..428e96b05 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -388,19 +388,22 @@ } }, "confirmEmail": { - "isMerge": { + "merge": { "title": "Merge account", "description": "Would you like to merge ", - "description2": "into your account? This action is irreversible." + "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." }, - "isNotMerge": { + "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." + "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": {