move configurations to red-domain
This commit is contained in:
parent
223399d6eb
commit
8646e9630a
@ -2,7 +2,7 @@ import { Component, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { SMTPConfiguration } from '@redaction/red-ui-http';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-smtp-auth-dialog',
|
||||
@ -16,7 +16,7 @@ export class SmtpAuthDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _userService: UserService,
|
||||
public dialogRef: MatDialogRef<SmtpAuthDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: SMTPConfiguration,
|
||||
@Inject(MAT_DIALOG_DATA) public data: ISmtpConfiguration,
|
||||
) {
|
||||
this.authForm = this._formBuilder.group({
|
||||
user: [data?.user || this._userService.currentUser.email, [Validators.required]],
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { GeneralConfigurationModel, SMTPConfiguration } from '@redaction/red-ui-http';
|
||||
import { IGeneralConfiguration, ISmtpConfiguration } from '@red/domain';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AutoUnsubscribe, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -21,8 +21,8 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnI
|
||||
readonly configForm: FormGroup;
|
||||
readonly smtpForm: FormGroup;
|
||||
|
||||
private _initialGeneralConfiguration: GeneralConfigurationModel;
|
||||
private _initialSMTPConfiguration: SMTPConfiguration;
|
||||
private _initialGeneralConfiguration: IGeneralConfiguration;
|
||||
private _initialSMTPConfiguration: ISmtpConfiguration;
|
||||
|
||||
constructor(
|
||||
private readonly _toaster: Toaster,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { GenericService, RequiredParam, Validate } from '@iqser/common-ui';
|
||||
import { SMTPConfiguration } from '@redaction/red-ui-http';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
|
||||
@Injectable()
|
||||
export class SmtpConfigService extends GenericService<unknown> {
|
||||
@ -9,12 +9,12 @@ export class SmtpConfigService extends GenericService<unknown> {
|
||||
}
|
||||
|
||||
@Validate()
|
||||
updateSMTPConfiguration(@RequiredParam() body: SMTPConfiguration) {
|
||||
updateSMTPConfiguration(@RequiredParam() body: ISmtpConfiguration) {
|
||||
return this._post(body, `${this._defaultModelPath}/smtp`);
|
||||
}
|
||||
|
||||
@Validate()
|
||||
testSMTPConfiguration(@RequiredParam() body: SMTPConfiguration) {
|
||||
testSMTPConfiguration(@RequiredParam() body: ISmtpConfiguration) {
|
||||
return this._post(body, `${this._defaultModelPath}/smtp/test`);
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { GenericService, RequiredParam, Validate } from '@iqser/common-ui';
|
||||
import { GeneralConfigurationModel } from '@redaction/red-ui-http';
|
||||
import { IGeneralConfiguration } from '@red/domain';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GeneralSettingsService extends GenericService<GeneralConfigurationModel> {
|
||||
export class GeneralSettingsService extends GenericService<IGeneralConfiguration> {
|
||||
constructor(protected readonly _injector: Injector) {
|
||||
super(_injector, 'configuration');
|
||||
}
|
||||
@ -15,7 +15,7 @@ export class GeneralSettingsService extends GenericService<GeneralConfigurationM
|
||||
}
|
||||
|
||||
@Validate()
|
||||
updateGeneralConfigurations(@RequiredParam() body: GeneralConfigurationModel) {
|
||||
updateGeneralConfigurations(@RequiredParam() body: IGeneralConfiguration) {
|
||||
return this._post<unknown>(body, `${this._defaultModelPath}/general`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,3 +14,4 @@ export * from './lib/file-attributes';
|
||||
export * from './lib/files';
|
||||
export * from './lib/downloads';
|
||||
export * from './lib/reports';
|
||||
export * from './lib/configuration';
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
export interface IGeneralConfiguration {
|
||||
auxiliaryName?: string;
|
||||
displayName?: string;
|
||||
forgotPasswordFunctionEnabled?: boolean;
|
||||
}
|
||||
2
libs/red-domain/src/lib/configuration/index.ts
Normal file
2
libs/red-domain/src/lib/configuration/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './general-configuration';
|
||||
export * from './smtp-configuration';
|
||||
15
libs/red-domain/src/lib/configuration/smtp-configuration.ts
Normal file
15
libs/red-domain/src/lib/configuration/smtp-configuration.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export interface ISmtpConfiguration {
|
||||
auth?: boolean;
|
||||
envelopeFrom?: string;
|
||||
from?: string;
|
||||
fromDisplayName?: string;
|
||||
host?: string;
|
||||
id?: string;
|
||||
password?: string;
|
||||
port?: number;
|
||||
replyTo?: string;
|
||||
replyToDisplayName?: string;
|
||||
ssl?: boolean;
|
||||
starttls?: boolean;
|
||||
user?: string;
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
/**
|
||||
* API Documentation for Redaction Gateway
|
||||
* Description for redaction
|
||||
*
|
||||
* OpenAPI spec version: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface GeneralConfigurationModel {
|
||||
auxiliaryName?: string;
|
||||
displayName?: string;
|
||||
forgotPasswordFunctionEnabled?: boolean;
|
||||
}
|
||||
@ -3,10 +3,8 @@ export * from './categoryModel';
|
||||
export * from './colors';
|
||||
export * from './digitalSignature';
|
||||
export * from './digitalSignatureViewModel';
|
||||
export * from './generalConfigurationModel';
|
||||
export * from './idRemoval';
|
||||
export * from './imageRecategorizationRequest';
|
||||
export * from './placeholdersResponse';
|
||||
export * from './rules';
|
||||
export * from './smtp-configuration';
|
||||
export * from './watermarkModel';
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
/**
|
||||
* API Documentation for Redaction Gateway
|
||||
* Description for redaction
|
||||
*
|
||||
* OpenAPI spec version: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface SMTPConfiguration {
|
||||
auth?: boolean;
|
||||
envelopeFrom?: string;
|
||||
from?: string;
|
||||
fromDisplayName?: string;
|
||||
host?: string;
|
||||
id?: string;
|
||||
password?: string;
|
||||
port?: number;
|
||||
replyTo?: string;
|
||||
replyToDisplayName?: string;
|
||||
ssl?: boolean;
|
||||
starttls?: boolean;
|
||||
user?: string;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user