commit
725665ad16
8 changed files with 41 additions and 35 deletions
|
@ -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"><div class="rounded-circle"id="couleur"[style.background-color]="membre.couleur"></div></div>
|
||||||
<div class="text-center mt-3">
|
<div class="text-center mt-3">
|
||||||
<h3 class="mt-2 mb-0">{{membre.prenom }} {{membre.nom }}</h3>
|
<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"
|
<div class="buttons text-center"><button button type="button" class="btn btn-outline-primary px-4"
|
||||||
routerLink="../modifier-membre/{{membre.id}}"
|
routerLink="../modifier-membre/{{membre.id}}"
|
||||||
routerLinkActive="active-custom"
|
routerLinkActive="active-custom"
|
||||||
|
|
|
@ -16,15 +16,13 @@ export class CardMemberComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
/** Récupérer le rôle de l'uilisateur connecté pour lui imposer des limitations s'il a un ROLE_ENFANT **/
|
/** 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();
|
const userRole = this.tokenService.getRole();
|
||||||
if(userRole == "ROLE_PARENT"){
|
if(userRole == "ROLE_PARENT"){
|
||||||
this.parent = true;
|
this.parent = true;
|
||||||
console.log('Rôle : ' + userRole);
|
|
||||||
}
|
}
|
||||||
else if(userRole== "ROLE_ENFANT"){
|
else if(userRole== "ROLE_ENFANT"){
|
||||||
this.parent = false;
|
this.parent = false;
|
||||||
console.log('Rôle : ' + userRole);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,38 +2,27 @@
|
||||||
<main class="form-signin">
|
<main class="form-signin">
|
||||||
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
||||||
<div class="connexion">
|
<div class="connexion">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="email" class="form-control" id="floatingInput" placeholder="" name="email" ngModel required
|
<input type="email" class="form-control" id="floatingInput" placeholder=""
|
||||||
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
|
name="email" ngModel required
|
||||||
'is-invalid': signinForm.form.touched && signinForm.form.value['email'] == ''}">
|
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
|
||||||
<label for="floatingInput">Adresse email</label>
|
'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>
|
||||||
<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"
|
<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>
|
</form>
|
||||||
<a routerLink="/password-oublie" routerLinkActive="active-custom" class="nav-link">password perdu ?</a>
|
<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>
|
<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>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -157,6 +157,7 @@
|
||||||
Ajouter le membre
|
Ajouter le membre
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
<app-alert *ngIf="isShow" [alert]="alert" (eventClose)="onClickCloseAlert();"></app-alert>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,6 +28,7 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
this.addMemberForm = new FormGroup({});
|
this.addMemberForm = new FormGroup({});
|
||||||
|
this.isShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@ -130,4 +131,10 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//fermeture du message d'alerte
|
||||||
|
onClickCloseAlert(){
|
||||||
|
console.log('fermeture');
|
||||||
|
this.isShow = ! this.isShow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
[disabled]="signupForm.invalid">
|
[disabled]="signupForm.invalid">
|
||||||
CREER MON COMPTE
|
CREER MON COMPTE
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<app-alert *ngIf="isShow" [alert]="alert" (eventClose)="onClickCloseAlert();"></app-alert>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,6 +18,8 @@ import { AuthService } from '../../services/auth.service';
|
||||||
})
|
})
|
||||||
export class PageSignupComponent implements OnInit {
|
export class PageSignupComponent implements OnInit {
|
||||||
public signupForm: FormGroup;
|
public signupForm: FormGroup;
|
||||||
|
alert: any;
|
||||||
|
isShow!: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
|
@ -26,10 +28,11 @@ export class PageSignupComponent implements OnInit {
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
this.signupForm = new FormGroup({});
|
this.signupForm = new FormGroup({});
|
||||||
|
this.isShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
// *********************************pensser a changer group car déprécié********************************
|
// ********************************* Pour V2 : changer group car déprécié********************************
|
||||||
this.signupForm = this.fb.group(
|
this.signupForm = this.fb.group(
|
||||||
{
|
{
|
||||||
teamNameFc: new FormControl('', [Validators.required]),
|
teamNameFc: new FormControl('', [Validators.required]),
|
||||||
|
@ -101,7 +104,8 @@ export class PageSignupComponent implements OnInit {
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} 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 **/
|
/** 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue