Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<div class="flex flex-column gap-6">
@if (!isSubmitting()) {
<p class="font-normal">
{{ 'home.confirmEmail.description' | translate }}
{{
email.isMerge
? ('home.confirmEmail.merge.description' | translate)
: ('home.confirmEmail.add.description' | translate)
}}
<span class="inline font-bold">{{ email.emailAddress }}</span>
{{ 'home.confirmEmail.description2' | translate }}
{{
email.isMerge
? ('home.confirmEmail.merge.description2' | translate)
: ('home.confirmEmail.add.description2' | translate)
}}
</p>

<div class="flex w-full justify-content-center gap-2">
Expand All @@ -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)
"
></p-button>
</div>
} @else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
22 changes: 16 additions & 6 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading