diff --git a/src/frontend/app/administration/sendmail/sendmail-administration.component.html b/src/frontend/app/administration/sendmail/sendmail-administration.component.html index 2959ad3f1e535725861ad22dd736a3952720760a..255c4bf2261bfaaa068773bb68076f352cef15ce 100644 --- a/src/frontend/app/administration/sendmail/sendmail-administration.component.html +++ b/src/frontend/app/administration/sendmail/sendmail-administration.component.html @@ -6,7 +6,7 @@ <menu-nav></menu-nav> <mat-nav-list> <h3 mat-subheader>{{lang.actions}}</h3> - <a mat-list-item *ngIf="sendmail.host.length > 0" (click)="snav2.toggle()"> + <a mat-list-item (click)="snav2.toggle();"> <mat-icon color="primary" mat-list-icon class="fas fa-signal"></mat-icon> <p mat-line> {{lang.checkSendmail}} @@ -26,7 +26,7 @@ <div class="col-md-12" style="margin-bottom: 20px;"> <mat-form-field> <mat-select #smtpType (selectionChange)="changeDesc(smtpType)" name="smtpType" - placeholder="Type de configuration" [(ngModel)]="sendmail.type"> + placeholder="Type de configuration" [(ngModel)]="sendmail.type" required> <mat-option *ngFor="let type of smtpTypeList" [value]="type.id"> {{type.label}} </mat-option> @@ -38,8 +38,8 @@ <div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'"> <div class="col-md-2"> <mat-form-field> - <mat-select name="SMTPSecure" placeholder="Méthode d'authentification" - [disabled]="sendmail.type != 'smtp'" [(ngModel)]="sendmail.secure"> + <mat-select name="SMTPSecure" placeholder="{{lang.smtpAuth}}" + [disabled]="sendmail.type != 'smtp'" [(ngModel)]="sendmail.secure" required> <mat-option *ngFor="let security of smtpSecList" [value]="security"> {{security}} </mat-option> @@ -49,13 +49,13 @@ <div class="col-md-9"> <mat-form-field> <input matInput name="host" [disabled]="sendmail.type != 'smtp'" - [(ngModel)]="sendmail.host" placeholder="{{lang.host}}"> + [(ngModel)]="sendmail.host" placeholder="{{lang.host}}" required> </mat-form-field> </div> <div class="col-md-1"> <mat-form-field> <input name="port" type="number" matInput [(ngModel)]="sendmail.port" - [disabled]="sendmail.type != 'smtp'" placeholder="{{lang.port}}"> + [disabled]="sendmail.type != 'smtp'" placeholder="{{lang.port}}" required> </mat-form-field> </div> </div> @@ -69,14 +69,14 @@ <div class="col-md-12"> <mat-form-field> <input name="user" [(ngModel)]="sendmail.user" [disabled]="!sendmail.auth || sendmail.type != 'smtp'" - matInput placeholder="{{lang.id}}"> + matInput placeholder="{{lang.id}}" required> </mat-form-field> </div> <div class="col-md-12"> <mat-form-field> <input name="password" [type]="hidePassword ? 'password' : 'text'" [(ngModel)]="sendmail.password" [disabled]="!sendmail.auth || sendmail.type != 'smtp'" matInput - placeholder="{{lang.password}}"> + placeholder="{{lang.password}}" required> <mat-icon color="primary" style="cursor: pointer;" matSuffix (click)="hidePassword = !hidePassword" class="fa fa-2x" [ngClass]="[hidePassword ? 'fa-eye-slash' : 'fa-eye']"></mat-icon> </mat-form-field> @@ -91,7 +91,7 @@ </div> </div> <div class="col-md-12 text-center" style="padding:10px;"> - <button mat-raised-button type="submit" color="primary" [disabled]="checkModif()">{{lang.validate}}</button> + <button mat-raised-button type="submit" color="primary" [disabled]="checkModif() || !sendmailForm.valid">{{lang.validate}}</button> <button mat-raised-button type="button" color="default" [disabled]="checkModif()" (click)="cancelModification()">{{lang.cancel}}</button> </div> @@ -102,13 +102,13 @@ </mat-sidenav-content> <mat-sidenav #snav2 [mode]="mobileQuery.matches ? 'over' : 'side'" [fixedInViewport]="mobileQuery.matches" fixedTopGap="56" position='end' [opened]="mobileQuery.matches ? false : false" style="overflow-x:hidden;width:500px;" - (opened)="initEmailSend()"> + (opened)="onSubmit();initEmailSend()"> <mat-nav-list disableRipple="true"> <h3 mat-subheader>{{lang.emailSendTest}}</h3> <div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'"> <div class="col-md-12"> <mat-form-field> - <input matInput placeholder="Adresse d'envoi" [(ngModel)]="currentUser.mail" [disabled]="emailSendLoading"> + <input matInput placeholder="Adresse d'envoi" [(ngModel)]="recipientTest" [disabled]="emailSendLoading"> <mat-icon *ngIf="!emailSendLoading" title="{{lang.beginSendTest}}" (click)="testEmailSend()" color="primary" style="cursor: pointer;" matSuffix class="fa fa-paper-plane fa-2x"></mat-icon> </mat-form-field> diff --git a/src/frontend/app/administration/sendmail/sendmail-administration.component.ts b/src/frontend/app/administration/sendmail/sendmail-administration.component.ts index fd3108d90dd45afdf9e86c4bbda790223eab3546..90304f79d233729b1a2db89b82646013a003609a 100644 --- a/src/frontend/app/administration/sendmail/sendmail-administration.component.ts +++ b/src/frontend/app/administration/sendmail/sendmail-administration.component.ts @@ -65,6 +65,7 @@ export class SendmailAdministrationComponent implements OnInit { msg : '' }; currentUser: any = {}; + recipientTest: string = ''; @@ -76,7 +77,7 @@ export class SendmailAdministrationComponent implements OnInit { } ngOnInit(): void { - this.headerService.setHeader(this.lang.sendmail); + this.headerService.setHeader(this.lang.sendmailShort); window['MainHeaderComponent'].setSnav(this.sidenavLeft); window['MainHeaderComponent'].setSnavRight(null); @@ -125,6 +126,7 @@ export class SendmailAdministrationComponent implements OnInit { this.http.get('../../rest/currentUser/profile') .subscribe((data: any) => { this.currentUser = data; + this.recipientTest = data.mail; }); } } @@ -136,7 +138,7 @@ export class SendmailAdministrationComponent implements OnInit { }; let email = { "sender": { "email": this.currentUser.mail }, - "recipients": [this.currentUser.mail], + "recipients": [this.recipientTest], "object": "test mail envoi", "status": "SENDMAILTEST", "body": "test mail envoi", diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index a533fd1835e7eb73453fc38200e917fe60346a09..1c69b35457d3b6ca9c17491b3a0a80d65f22de45 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -363,6 +363,7 @@ export const LANG_EN = { "selectAll" : "Select all", "selectedDocumentStatus" : "Document status selected", "sendmail" : "Sendmail", + "sendmailShort" : "Sendmail", "sendTo" : "Send to", "shortLabel" : "Short label", "signatures" : "Signatures", @@ -735,6 +736,7 @@ export const LANG_EN = { "isMulticontact" : "Multi-contact", "emailSendTest" : "Email send test", "beginSendTest" : "Begin send test", - "emailSendSuccess" : "Email sent", - "emailSendInProgress" : "Sending email...", + "emailSendSuccess" : "Email sent", + "emailSendInProgress" : "Sending email...", + "smtpAuth" : "Authentication methode", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 5652e4b86adf1b4ac4071d2e3422f67d49b3b4e3..c8a350c7ab45ee01f4d4980c38360e84c2bf0611 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -453,6 +453,7 @@ export const LANG_FR = { "selectAll" : "Sélectionner tout", "selectedDocumentStatus" : "Statut du document à prendre en compte", "sendmail" : "Envoi de courriels et plis numériques", + "sendmailShort" : "Envoi de courriels", "sendTo" : "Envoyer à ", "september" : "Septembre", "septemberShort" : "Sept.", @@ -762,7 +763,8 @@ export const LANG_FR = { "emailSendTest" : "Test d'envoi", "beginSendTest" : "Commencer le test", "emailSendSuccess" : "Envoi réussi", - "emailSendInProgress" : "En cours d'envoi", + "emailSendInProgress" : "En cours d'envoi...", + "smtpAuth" : "Méthode d'authentification", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index d1aa6c861a3d5ae6fec022b99f7e2f17626806d1..83b87099525ad80eb365e64244eb537b5ad436ec 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -766,4 +766,6 @@ export const LANG_NL = { "beginSendTest" : "_TO_TRANSLATE", "emailSendSuccess" : "_TO_TRANSLATE", "emailSendInProgress" : "_TO_TRANSLATE", + "smtpAuth" : "_TO_TRANSLATE", + "sendmailShort" : "_TO_TRANSLATE", };