Merge branch 'RED-7593' into 'master'
RED-7593: added warning notification in case of missing admin email. See merge request redactmanager/red-ui!443
This commit is contained in:
commit
53123e05e0
@ -62,8 +62,12 @@ export class SmtpFormComponent extends BaseFormComponent implements OnInit {
|
||||
async testConnection() {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
await firstValueFrom(this._smtpConfigService.testSMTPConfiguration(this.form.getRawValue()));
|
||||
this._toaster.success(_('general-config-screen.test.success'));
|
||||
const response = await firstValueFrom(this._smtpConfigService.testSMTPConfiguration(this.form.getRawValue()));
|
||||
if (!response.adminEmail) {
|
||||
this._toaster.warning(_('general-config-screen.test.warning'), { params: { recipientEmail: response.recipientEmail } });
|
||||
} else {
|
||||
this._toaster.success(_('general-config-screen.test.success'));
|
||||
}
|
||||
} catch (e) {
|
||||
this._toaster.error(_('general-config-screen.test.error'));
|
||||
} finally {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GenericService } from '@iqser/common-ui';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
import { ISmtpConfiguration, ITextConnectionResponse } from '@red/domain';
|
||||
|
||||
@Injectable()
|
||||
export class SmtpConfigService extends GenericService<unknown> {
|
||||
@ -12,7 +12,7 @@ export class SmtpConfigService extends GenericService<unknown> {
|
||||
}
|
||||
|
||||
testSMTPConfiguration(body: ISmtpConfiguration) {
|
||||
return this._post(body, `${this._defaultModelPath}/smtp/test`);
|
||||
return this._post<ITextConnectionResponse>(body, `${this._defaultModelPath}/smtp/test`);
|
||||
}
|
||||
|
||||
getCurrentSMTPConfiguration() {
|
||||
|
||||
@ -1642,7 +1642,8 @@
|
||||
},
|
||||
"test": {
|
||||
"error": "Die Test-E-Mail konnte nicht gesendet werden! Bitte überprüfen Sie die E-Mail-Adresse.",
|
||||
"success": "Die Test-E-Mail wurde erfolgreich versendet!"
|
||||
"success": "Die Test-E-Mail wurde erfolgreich versendet!",
|
||||
"warning": ""
|
||||
},
|
||||
"title": "SMTP-Konto konfigurieren"
|
||||
},
|
||||
@ -2505,4 +2506,4 @@
|
||||
}
|
||||
},
|
||||
"yesterday": "Gestern"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1642,7 +1642,8 @@
|
||||
},
|
||||
"test": {
|
||||
"error": "Test e-mail could not be sent. Please double-check the email address.",
|
||||
"success": "Test e-mail was sent successfully!"
|
||||
"success": "Test e-mail was sent successfully!",
|
||||
"warning": "Admin mail address not set. Test email sent to {recipientEmail} instead."
|
||||
},
|
||||
"title": "Configure SMTP account"
|
||||
},
|
||||
@ -2505,4 +2506,4 @@
|
||||
}
|
||||
},
|
||||
"yesterday": "Yesterday"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1642,7 +1642,8 @@
|
||||
},
|
||||
"test": {
|
||||
"error": "Die Test-E-Mail konnte nicht gesendet werden! Bitte überprüfen Sie die E-Mail-Adresse.",
|
||||
"success": "Die Test-E-Mail wurde erfolgreich versendet!"
|
||||
"success": "Die Test-E-Mail wurde erfolgreich versendet!",
|
||||
"warning": ""
|
||||
},
|
||||
"title": "SMTP-Konto konfigurieren"
|
||||
},
|
||||
@ -2505,4 +2506,4 @@
|
||||
}
|
||||
},
|
||||
"yesterday": "Gestern"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1642,7 +1642,8 @@
|
||||
},
|
||||
"test": {
|
||||
"error": "Test e-mail could not be sent! Please revise the e-mail address.",
|
||||
"success": "Test e-mail was sent successfully!"
|
||||
"success": "Test e-mail was sent successfully!",
|
||||
"warning": "Admin mail address not set. Test email sent to {recipientEmail} instead."
|
||||
},
|
||||
"title": "Configure SMTP Account"
|
||||
},
|
||||
@ -2505,4 +2506,4 @@
|
||||
}
|
||||
},
|
||||
"yesterday": "Yesterday"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,3 +13,10 @@ export interface ISmtpConfiguration {
|
||||
starttls?: boolean;
|
||||
user?: string;
|
||||
}
|
||||
|
||||
export interface ITextConnectionResponse {
|
||||
adminEmail: boolean;
|
||||
reasonPhrase: string;
|
||||
recipientEmail: string;
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user