Merge pull request #8745 from ArtemDzhereleiko/AD/bug-fix/mail-server-oauth2

Fixed oauth2 mail server settings
This commit is contained in:
Andrew Shvayka 2023-06-15 12:59:10 +03:00 committed by GitHub
commit 6b8cbbd3c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -331,7 +331,7 @@
</fieldset> </fieldset>
<div fxLayout="row" fxLayoutAlign="end center" fxLayout.xs="column" fxLayoutAlign.xs="end" fxLayoutGap="16px"> <div fxLayout="row" fxLayoutAlign="end center" fxLayout.xs="column" fxLayoutAlign.xs="end" fxLayoutGap="16px">
<button mat-raised-button type="button" <button mat-raised-button type="button"
[disabled]="(isLoading$ | async) || mailSettings.invalid || domainForm.invalid || (mailSettings.dirty || domainForm.dirty)" [disabled]="(isLoading$ | async) || mailSettings.get('enableOauth2').value ? mailSettings.invalid || domainForm.invalid || (mailSettings.dirty || domainForm.dirty) : mailSettings.invalid"
(click)="sendTestMail()"> (click)="sendTestMail()">
{{'admin.send-test-mail' | translate}} {{'admin.send-test-mail' | translate}}
</button> </button>

View File

@ -416,6 +416,9 @@ export class MailServerComponent extends PageComponent implements OnInit, OnDest
private get mailSettingsFormValue(): MailServerSettings { private get mailSettingsFormValue(): MailServerSettings {
const formValue = this.mailSettings.getRawValue() as Required<typeof this.mailSettings.value>; const formValue = this.mailSettings.getRawValue() as Required<typeof this.mailSettings.value>;
delete formValue.changePassword; delete formValue.changePassword;
if (!isDefinedAndNotNull(formValue.password)) {
delete formValue.password;
}
return formValue; return formValue;
} }