Started implementing user settings -> security -> e-mail management
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user