diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/smtp-form/smtp-form.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/smtp-form/smtp-form.component.ts index 7be3cd13e..2514390c9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/smtp-form/smtp-form.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/smtp-form/smtp-form.component.ts @@ -1,38 +1,38 @@ import { Component, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { ISmtpConfiguration } from '@red/domain'; +import { FormBuilder, Validators } from '@angular/forms'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { BaseFormComponent, IconButtonTypes, IqserPermissionsService, LoadingService, Toaster } from '@iqser/common-ui'; +import { ISmtpConfiguration } from '@red/domain'; +import { Roles } from '@users/roles'; +import { firstValueFrom } from 'rxjs'; import { AdminDialogService } from '../../../services/admin-dialog.service'; import { SmtpConfigService } from '../../../services/smtp-config.service'; -import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { firstValueFrom } from 'rxjs'; -import { Roles } from '@users/roles'; @Component({ selector: 'redaction-smtp-form', templateUrl: './smtp-form.component.html', }) export class SmtpFormComponent extends BaseFormComponent implements OnInit { + #initialConfiguration: ISmtpConfiguration; readonly iconButtonTypes = IconButtonTypes; - private _initialConfiguration: ISmtpConfiguration; constructor( - private readonly _formBuilder: UntypedFormBuilder, + private readonly _formBuilder: FormBuilder, private readonly _dialogService: AdminDialogService, private readonly _smtpConfigService: SmtpConfigService, private readonly _loadingService: LoadingService, private readonly _toaster: Toaster, - private readonly _permissionsService: IqserPermissionsService, + permissionsService: IqserPermissionsService, ) { super(); - this.form = this._getForm(); - if (!_permissionsService.has(Roles.smtp.write)) { + this.form = this.#getForm(); + if (!permissionsService.has(Roles.smtp.write)) { this.form.disable(); } } async ngOnInit(): Promise { - await this._loadData(); + await this.#loadData(); } onToggleAuthentication(checked: boolean): void { @@ -54,9 +54,9 @@ export class SmtpFormComponent extends BaseFormComponent implements OnInit { async save() { this._loadingService.start(); await firstValueFrom(this._smtpConfigService.updateSMTPConfiguration(this.form.getRawValue())); - this._initialConfiguration = this.form.getRawValue(); + this.#initialConfiguration = this.form.getRawValue(); this._loadingService.stop(); - await this._loadData(); + await this.#loadData(); } async testConnection() { @@ -71,7 +71,7 @@ export class SmtpFormComponent extends BaseFormComponent implements OnInit { } } - private _getForm(): UntypedFormGroup { + #getForm() { return this._formBuilder.group({ host: [undefined, Validators.required], port: [25], @@ -88,12 +88,12 @@ export class SmtpFormComponent extends BaseFormComponent implements OnInit { }); } - private async _loadData() { + async #loadData() { this._loadingService.start(); try { - this._initialConfiguration = await firstValueFrom(this._smtpConfigService.getCurrentSMTPConfiguration()); - this.form.patchValue(this._initialConfiguration, { emitEvent: false }); + this.#initialConfiguration = await firstValueFrom(this._smtpConfigService.getCurrentSMTPConfiguration()); + this.form.patchValue(this.#initialConfiguration, { emitEvent: false }); } catch (e) {} this.initialFormValue = this.form.getRawValue(); diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html index f272c2b53..0f7faf0f4 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html @@ -7,7 +7,7 @@ >
-
+
{{ redactedText }}
@@ -50,7 +50,7 @@
- +
@@ -59,6 +59,11 @@
+
+ + +
+