diff --git a/lang/en.json b/lang/en.json index 040c1aa6f216ce7291bbfefd52db4f7c35555bcd..38b9ecd869e08b9492239573cb273c2fa5f6011f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -158,6 +158,7 @@ "actions": "Actions", "addNote": "Add note", "filterInfo": "Filter by subject / reference", - "attachment": "attachment" + "attachment": "attachment", + "deleteSubtitution": "Delete subtitution" } } diff --git a/lang/fr.json b/lang/fr.json index 7192a9a2b943a652ce65c909d762142d43a9849d..a9d8976703f807209e68a322a77dcb2456ee3a30 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -158,6 +158,7 @@ "actions": "Actions", "addNote": "Ajouter un commentaire", "filterInfo": "Filtrer par objet / référence", - "attachment": "annexe" + "attachment": "annexe", + "deleteSubtitution": "Supprimer la délégation" } } diff --git a/src/frontend/app/profile/profile.component.html b/src/frontend/app/profile/profile.component.html index 0b5d001cf100cba67e0d5816b9f4eaf51d56d1c1..4b6611934a8f45e2f8bd063dffcd88f134692f80 100644 --- a/src/frontend/app/profile/profile.component.html +++ b/src/frontend/app/profile/profile.component.html @@ -242,7 +242,6 @@ <mat-form-field style="width:100%"> <mat-select placeholder="{{'lang.chooseSubstitute' | translate}}" name="usersRest" [(ngModel)]="profileInfo.substitute"> - <mat-option value=""></mat-option> <ng-container *ngFor="let userRest of usersRest"> <mat-option *ngIf="userRest.id !== profileInfo.id" [value]="userRest.id"> @@ -250,10 +249,14 @@ {{userRest.lastname}}</mat-option> </ng-container> </mat-select> + <button matSuffix *ngIf="profileInfo.substitute != null" mat-icon-button type="button" + (tap)="profileInfo.substitute = null" color="warn" title="{{'lang.deleteSubtitution' | translate}}"> + <mat-icon fontSet="fas" fontIcon="fa-times fa-2x"></mat-icon> + </button> </mat-form-field> </div> </div> - <fieldset *ngIf="this.profileInfo.substitute !== '' && this.profileInfo.substitute !== undefined"> + <fieldset *ngIf="profileInfo.substitute != null"> <legend align="left">{{'lang.signSubstituted' | translate}} :</legend> <ng-container> <button type="button" class="signListButton" mat-stroked-button *ngFor="let signature of signaturesService.signaturesList; let i=index" (click)="toggleSignature(i)" [class.selected]="signature.substituted"><img [src]="sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + signature.encodedSignature)"/></button> diff --git a/src/frontend/app/profile/profile.component.ts b/src/frontend/app/profile/profile.component.ts index 699eec9d0570ec58274b311e8945a9d423cfee12..8c26988154c38439f872e582a02aca35b881fb27 100644 --- a/src/frontend/app/profile/profile.component.ts +++ b/src/frontend/app/profile/profile.component.ts @@ -22,7 +22,7 @@ export class ProfileComponent implements OnInit { @ViewChild('passwordContent') passwordContent: MatExpansionPanel; profileInfo: any = { - substitute: '', + substitute: null, preferences: [] }; hideCurrentPassword: Boolean = true; @@ -204,7 +204,7 @@ export class ProfileComponent implements OnInit { 'substitute': this.profileInfo.substitute, }; - if (this.profileInfo.substitute !== '') { + if (this.profileInfo.substitute !== null) { alert('Vous avez choisi une délégation, vous ne pourrez plus viser ou signer de courrier.'); } @@ -257,7 +257,7 @@ export class ProfileComponent implements OnInit { this.closeProfile(); } - if (this.profileInfo.substitute !== '') { + if (this.profileInfo.substitute !== null) { this.http.patch('../rest/users/' + this.signaturesService.userLogged.id + '/signatures/substituted', {'signatures': this.signaturesService.signaturesList}) .subscribe(() => { }, (err) => { this.notificationService.handleErrors(err);