Skip to content
Snippets Groups Projects
Commit 98f9c1cc authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT hide passwords in profil

parent 2ac61268
No related branches found
No related tags found
No related merge requests found
...@@ -32,17 +32,19 @@ ...@@ -32,17 +32,19 @@
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-container *ngIf="showPassword"> <ng-container *ngIf="showPassword">
<mat-form-field class="input-row"> <mat-form-field class="input-row">
<input name="currentPassword" matInput [(ngModel)]="password.currentPassword" placeholder="Mot de passe actuel" <input name="currentPassword" matInput [(ngModel)]="password.currentPassword" placeholder="Mot de passe actuel" [type]="hideCurrentPassword ? 'password' : 'text'">
type="password"> <mat-icon matSuffix (click)="hideCurrentPassword = !hideCurrentPassword" class="fa fa-2x" [ngClass]="[hideCurrentPassword ? 'fa-eye-slash' : 'fa-eye']"></mat-icon>
</mat-form-field> </mat-form-field>
<mat-form-field class="input-row"> <mat-form-field class="input-row">
<input name="newPassword" matInput [(ngModel)]="password.newPassword" placeholder="Nouveau mot de passe" <input name="newPassword" matInput [(ngModel)]="password.newPassword" placeholder="Nouveau mot de passe" [type]="hideNewPassword ? 'password' : 'text'"
type="password" (keyup)="checkPasswordValidity(password.newPassword)"> (keyup)="checkPasswordValidity(password.newPassword)">
<mat-icon matSuffix (click)="hideNewPassword = !hideNewPassword" class="fa fa-2x" [ngClass]="[hideNewPassword ? 'fa-eye-slash' : 'fa-eye']"></mat-icon>
<mat-hint style="color:red;">{{handlePassword.errorMsg}}</mat-hint> <mat-hint style="color:red;">{{handlePassword.errorMsg}}</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field class="input-row"> <mat-form-field class="input-row">
<input name="passwordConfirmation" matInput [(ngModel)]="password.passwordConfirmation" <input name="passwordConfirmation" matInput [(ngModel)]="password.passwordConfirmation"
placeholder="Confirmer le nouveau mot de passe" type="password"> placeholder="Confirmer le nouveau mot de passe" [type]="hideNewPasswordConfirm ? 'password' : 'text'">
<mat-icon matSuffix (click)="hideNewPasswordConfirm = !hideNewPasswordConfirm" class="fa fa-2x" [ngClass]="[hideNewPasswordConfirm ? 'fa-eye-slash' : 'fa-eye']"></mat-icon>
<mat-hint style="color:red;" *ngIf="password.passwordConfirmation !== password.newPassword">Les <mat-hint style="color:red;" *ngIf="password.passwordConfirmation !== password.newPassword">Les
mots de passe ne correspondent pas !</mat-hint> mots de passe ne correspondent pas !</mat-hint>
<mat-hint style="color:green;" *ngIf="password.passwordConfirmation === password.newPassword && password.newPassword.length > 0 && password.passwordConfirmation.length> 0">Les <mat-hint style="color:green;" *ngIf="password.passwordConfirmation === password.newPassword && password.newPassword.length > 0 && password.passwordConfirmation.length> 0">Les
......
...@@ -20,7 +20,9 @@ export class ProfileComponent implements OnInit { ...@@ -20,7 +20,9 @@ export class ProfileComponent implements OnInit {
@Input('snavLeftComponent') snavLeftComponent: MatSidenav; @Input('snavLeftComponent') snavLeftComponent: MatSidenav;
profileInfo: any = {}; profileInfo: any = {};
hideCurrentPassword: Boolean = true;
hideNewPassword: Boolean = true;
hideNewPasswordConfirm: Boolean = true;
// HANDLE PASSWORD // HANDLE PASSWORD
passwordRules: any = { passwordRules: any = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment