amelioration du style globale

This commit is contained in:
MiharyR 2021-11-26 17:05:12 +01:00
parent cd1f323686
commit d1ac1b77f0
36 changed files with 191 additions and 112 deletions

View file

@ -35,7 +35,7 @@
<mat-radio-button value="user" (click)="this.roleName = 'user'; onFilter()">
Utilisateur
</mat-radio-button><br>
<mat-radio-button value="advertiser" (click)="this.roleName = 'advertiser'; onFilter()">
<mat-radio-button value="url" (click)="this.roleName = 'url'; onFilter()">
Annonceur
</mat-radio-button><br>
<mat-radio-button value="admin" (click)="this.roleName = 'admin'; onFilter()">

View file

@ -133,6 +133,11 @@
<mat-label>Login</mat-label>
<input matInput type="text" [(ngModel)]="user.login">
</mat-form-field><br>
<!-- company -->
<mat-form-field appearance="fill" *ngIf="user.role.name === 'advertiser'">
<mat-label>Entreprise</mat-label>
<input matInput type="text" [(ngModel)]="user.company">
</mat-form-field><br *ngIf="user.role.name === 'advertiser'">
</div>
<!-- mdp + confirmation -->

View file

@ -38,6 +38,7 @@ export class PopupCreateUserComponent implements OnInit
dateOfBirth: null,
gender: "man",
interests: [],
company: "",
isActive: false,
isAccepted: false,
createdAt: new Date(),
@ -72,12 +73,8 @@ export class PopupCreateUserComponent implements OnInit
this.errorMessage = "Veuillez remplir le champ 'email'.";
this.hasError = true;
}
if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
this.hasError = true;
}
else if(!this.isValidEmail(this.user.email)) {
this.errorMessage = "Email invalide";
this.errorMessage = "Email invalide.";
this.hasError = true;
}
else if(this.password.length === 0) {
@ -88,6 +85,14 @@ export class PopupCreateUserComponent implements OnInit
this.errorMessage = "Le mot de passe est différent de sa confirmation.";
this.hasError = true;
}
else if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
this.hasError = true;
}
else if((this.user.role.name === 'advertiser') && (this.user.company.length === 0)) {
this.errorMessage = "Veuillez remplir le champ 'entreprise'.";
this.hasError = true;
}
else {
this.errorMessage = "" ;
this.hasError = false;

View file

@ -62,7 +62,7 @@
<div class="col-6 myLabel">Rôle:</div>
<div class="col-6 myValue">
<span *ngIf="user.role.name === 'user'">Utilisateur</span>
<span *ngIf="user.role.name === 'advertiser'">Annonceur</span>
<span *ngIf="user.role.name === 'url'">Annonceur</span>
<span *ngIf="user.role.name === 'admin'">Admin</span>
</div>
</div>