Commit 43c6c39a authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #16956 TIME 0:10 add title + automatic phone number replacement

parent 67e5af45
......@@ -130,10 +130,11 @@ export class CreateExternalUserComponent implements OnInit {
if (item.type === 'user') {
this.http.get('../rest/users/' + item.id).pipe(
tap((data: any) => {
const phone: string = data.phone;
this.userOTP.firstname = data.firstname;
this.userOTP.lastname = data.lastname;
this.userOTP.email = data.mail;
this.userOTP.phone = data.phone !== undefined ? data.phone.replace(/( |\.|\-)/g, '').replace('0', '+33') : '';
this.userOTP.phone = phone !== undefined ? phone.replace(/( |\.|\-)/g, '').replace('0', '+33') : '';
}),
catchError((err: any) => {
this.notify.handleSoftErrors(err);
......@@ -143,10 +144,11 @@ export class CreateExternalUserComponent implements OnInit {
} else if (item.type === 'contact') {
this.http.get('../rest/contacts/' + item.id).pipe(
tap((data: any) => {
const phone: string = data.phone;
this.userOTP.firstname = data.firstname;
this.userOTP.lastname = data.lastname;
this.userOTP.email = data.email;
this.userOTP.phone = data.phone.replace(/( |\.|\-)/g, '').replace('0', '+33');
this.userOTP.phone = phone !== undefined ? phone.replace(/( |\.|\-)/g, '').replace('0', '+33') : '';
}),
catchError((err: any) => {
this.notify.handleSoftErrors(err);
......
......@@ -75,7 +75,7 @@
<mat-icon class="fas fa-edit" color="primary"></mat-icon>
</button>
<button class="currentRoleButton" [class.readonly]="!adminMode" [color]="diffusion.role === 'visa' ? 'default':'primary'" mat-raised-button
title="{{'lang.' + diffusion.role | translate}}"
title="{{'lang.' + diffusion.role + (diffusion.role === 'sign' ? 'User' : '') | translate}}"
[matMenuTriggerFor]="rolesMenu" [disabled]="!adminMode">{{'lang.' + diffusion.role + (diffusion.role === 'sign' ? 'User' : '') | translate}}</button>
<mat-menu #rolesMenu="matMenu">
<ng-container *ngFor="let role of diffusion.availableRoles">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment