This commit is contained in:
Sana EL HIRI 2022-03-13 18:45:28 +01:00
parent bcc27e9250
commit 3326b48eab
8 changed files with 41 additions and 35 deletions

View File

@ -77,7 +77,7 @@ registerLocaleData(localeFr)
DeconnexionComponent,
HumeurComponent,
AlertComponent,
PageAjoutEvenementsComponent,
PageAjoutEvenementsComponent,
PageSupportComponent
],
imports: [

View File

@ -6,6 +6,7 @@
<div class="text-center"><div class="rounded-circle"id="couleur"[style.background-color]="membre.couleur"></div></div>
<div class="text-center mt-3">
<h3 class="mt-2 mb-0">{{membre.prenom }} {{membre.nom }}</h3>
<!-- [hidden] pour cacher le bouton si le membre a un profil enfant-->
<div class="buttons text-center"><button button type="button" class="btn btn-outline-primary px-4"
routerLink="../modifier-membre/{{membre.id}}"
routerLinkActive="active-custom"

View File

@ -16,15 +16,13 @@ export class CardMemberComponent implements OnInit {
ngOnInit(): void {
/** Récupérer le rôle de l'uilisateur connecté pour lui imposer des limitations s'il a un ROLE_ENFANT **/
/** Il s'agit de cacher les boutons qui permettent de modifier et supprimer les profils (html)**/
/** Il s'agit de cacher les boutons qui permettent de modifier et supprimer les profils ([hidden] dans html)**/
const userRole = this.tokenService.getRole();
if(userRole == "ROLE_PARENT"){
this.parent = true;
console.log('Rôle : ' + userRole);
}
else if(userRole== "ROLE_ENFANT"){
this.parent = false;
console.log('Rôle : ' + userRole);
}
}

View File

@ -2,38 +2,27 @@
<main class="form-signin">
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
<div class="connexion">
<div class="form-floating">
<input type="email" class="form-control" id="floatingInput" placeholder="" name="email" ngModel required
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
'is-invalid': signinForm.form.touched && signinForm.form.value['email'] == ''}">
<label for="floatingInput">Adresse email</label>
<div class="form-floating">
<input type="email" class="form-control" id="floatingInput" placeholder=""
name="email" ngModel required
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
'is-invalid': signinForm.form.touched && signinForm.form.value['email'] == ''}">
<label for="floatingInput">Adresse email</label>
</div>
<div class="form-floating">
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
required [ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['password'] != '' ,
'is-invalid': signinForm.form.touched && signinForm.form.value['password'] == ''}">
<label for="floatingPassword">Mot de passe</label>
</div>
<button class="w-100 btn btn-lg btn-outline-success" type="submit" [disabled]="signinForm.invalid">Se
connecter
</button>
</div>
<div class="form-floating">
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
required [ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['password'] != '' ,
'is-invalid': signinForm.form.touched && signinForm.form.value['password'] == ''}">
<label for="floatingPassword">Mot de passe</label>
</div>
<button class="w-100 btn btn-lg btn-outline-success" type="submit" [disabled]="signinForm.invalid">Se
connecter</button>
</div>
<button class="w-100 btn btn-lg btn-outline-success" routerLink="../creation-compte"
routerLinkActive="active-custom">S'inscrire</button>
routerLinkActive="active-custom">S'inscrire</button>
</form>
<a routerLink="/password-oublie" routerLinkActive="active-custom" class="nav-link">password perdu ?</a>
<!-- <div *ngIf="errorForm">
<p class="text-danger">Il manque des informations dans le formulaire...</p>
</div> -->
<app-alert *ngIf="isShow" [alert]="alert" (eventClose)="onClickCloseAlert();"></app-alert>
<!-- <div *ngIf="isShow">
<div class="alert alert-{{alert.type}}" role="alert">
{{alert.content}}
</div>
</div> -->
</main>
</div>

View File

@ -157,6 +157,7 @@
Ajouter le membre
</button>
</form>
<app-alert *ngIf="isShow" [alert]="alert" (eventClose)="onClickCloseAlert();"></app-alert>
</div>
</div>
</div>

View File

@ -28,6 +28,7 @@ export class PageAddMemberComponent implements OnInit {
private fb: FormBuilder
) {
this.addMemberForm = new FormGroup({});
this.isShow = false;
}
ngOnInit(): void {
@ -130,4 +131,10 @@ export class PageAddMemberComponent implements OnInit {
}
};
}
//fermeture du message d'alerte
onClickCloseAlert(){
console.log('fermeture');
this.isShow = ! this.isShow;
}
}

View File

@ -149,7 +149,7 @@
[disabled]="signupForm.invalid">
CREER MON COMPTE
</button>
</form>
<app-alert *ngIf="isShow" [alert]="alert" (eventClose)="onClickCloseAlert();"></app-alert>
</main>
</div>

View File

@ -18,6 +18,8 @@ import { AuthService } from '../../services/auth.service';
})
export class PageSignupComponent implements OnInit {
public signupForm: FormGroup;
alert: any;
isShow!: boolean;
constructor(
private authService: AuthService,
@ -26,10 +28,11 @@ export class PageSignupComponent implements OnInit {
private fb: FormBuilder
) {
this.signupForm = new FormGroup({});
this.isShow = false;
}
ngOnInit(): void {
// *********************************pensser a changer group car déprécié********************************
// ********************************* Pour V2 : changer group car déprécié********************************
this.signupForm = this.fb.group(
{
teamNameFc: new FormControl('', [Validators.required]),
@ -101,7 +104,8 @@ export class PageSignupComponent implements OnInit {
});
} else {
// affichage erreur
this.alert={"type":"danger", "content":"Votre profil n'a pas été créé"};
this.isShow = true;
}
}
/** Méthode pour compare le mot de passe et la confirmation de mot de passe **/
@ -122,4 +126,10 @@ export class PageSignupComponent implements OnInit {
}
};
}
//fermeture du message d'alerte
onClickCloseAlert(){
console.log('fermeture');
this.isShow = ! this.isShow;
}
}