Started implementing user settings -> security -> e-mail management

This commit is contained in:
2026-04-18 19:28:51 +02:00
parent 4eaaacac2c
commit 20e67ecd85
9 changed files with 254 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
<div class="option">
<ng-template [(tuiDialog)]="changePasswordDialogOpen"
[tuiDialogOptions]="{label: ('chat.userSettingsDialog.security.changePasswordDialog.'+ (changePasswordRemoveMode() ? 'labelRemove' : serviceManager.currentSession()!.userData.passwordSet ? 'label' : 'labelSet'))|translate}">
<form [formGroup]="changePasswordForm" style="display: flex; flex-direction: column; gap: 10px">
<form [formGroup]="changeEmailForm" style="display: flex; flex-direction: column; gap: 10px">
@if (serviceManager.currentSession()!.userData.passwordSet) {
<tui-textfield iconStart="@tui.key">
<label
@@ -9,13 +9,13 @@
<input formControlName="currentPassword" tuiInput type="password">
</tui-textfield>
@if (changePasswordForm.controls['currentPassword'].dirty) {
@if (changePasswordForm.controls['currentPassword'].hasError("required")) {
@if (changeEmailForm.controls['currentPassword'].dirty) {
@if (changeEmailForm.controls['currentPassword'].hasError("required")) {
<tui-error
[error]="'chat.userSettingsDialog.security.changePasswordDialog.errors.currentPasswordRequired'|translate"></tui-error>
}
@if (changePasswordForm.controls['currentPassword'].hasError("incorrect")) {
@if (changeEmailForm.controls['currentPassword'].hasError("incorrect")) {
<tui-error
[error]="'chat.userSettingsDialog.security.changePasswordDialog.errors.incorrectPassword'|translate"></tui-error>
}
@@ -38,8 +38,8 @@
<footer>
<button tuiButton iconStart="@tui.check" [loading]="changePasswordPending()"
[disabled]="changePasswordForm.invalid || changePasswordPending()"
(click)="changePassword(changePasswordForm.controls['currentPassword'].value, changePasswordForm.controls['newPassword'].value)">
[disabled]="changeEmailForm.invalid || changePasswordPending()"
(click)="changePassword(changeEmailForm.controls['currentPassword'].value, changeEmailForm.controls['newPassword'].value)">
{{ ('chat.userSettingsDialog.security.changePasswordDialog.' + (changePasswordRemoveMode() ? 'labelRemove' : serviceManager.currentSession()!.userData.passwordSet ? 'label' : 'labelSet'))|translate }}
</button>
</footer>