merge avec dev
This commit is contained in:
commit
bd3ee44a1d
74 changed files with 1525 additions and 480 deletions
|
|
@ -1,31 +1,48 @@
|
|||
<app-header></app-header>
|
||||
<app-deconnexion></app-deconnexion>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<app-side-bar></app-side-bar>
|
||||
<div class="col-9 offset-2" id="main">
|
||||
<h1>Ma team</h1>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button button type="button" class="btn btn-primary btn-lg"
|
||||
routerLink="../modifier-compte"
|
||||
routerLinkActive="active-custom">Modifier mon compte</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button button type="button" class="btn btn-primary btn-lg"
|
||||
routerLink="../supprimer-compte"
|
||||
routerLinkActive="active-custom">Supprimer mon compte</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button button type="button" class="btn btn-primary btn-lg"
|
||||
routerLink="../ajout-membre"
|
||||
routerLinkActive="active-custom">Ajouter un membre</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col" *ngFor="let membreData of listMembres">
|
||||
<app-card-member [membre]="membreData">
|
||||
</app-card-member>
|
||||
</div>
|
||||
</div>
|
||||
<h1>Ma team</h1>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button
|
||||
button
|
||||
type="button"
|
||||
class="btn btn-primary btn-lg"
|
||||
routerLink="../modifier-compte"
|
||||
routerLinkActive="active-custom"
|
||||
>
|
||||
Modifier mon compte
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button
|
||||
button
|
||||
type="button"
|
||||
class="btn btn-primary btn-lg"
|
||||
routerLink="../supprimer-compte"
|
||||
routerLinkActive="active-custom"
|
||||
>
|
||||
Supprimer mon compte
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button
|
||||
button
|
||||
type="button"
|
||||
class="btn btn-primary btn-lg"
|
||||
routerLink="../ajout-membre"
|
||||
routerLinkActive="active-custom"
|
||||
>
|
||||
Ajouter un membre
|
||||
</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col" *ngFor="let membreData of listMembres">
|
||||
<app-card-member [membre]="membreData"> </app-card-member>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { MembreService } from 'src/app/services/membre.service';
|
||||
import { TeamService } from 'src/app/services/team.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-account',
|
||||
|
|
@ -10,14 +10,15 @@ import { TeamService } from 'src/app/services/team.service';
|
|||
export class PageAccountComponent implements OnInit {
|
||||
public listMembres: any[];
|
||||
|
||||
constructor(private teamService: TeamService, private membreService: MembreService) {
|
||||
constructor(private membreService: MembreService) {
|
||||
this.listMembres = [];
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.membreService.getMembres().subscribe((membres: any[]) => {
|
||||
this.membreService.getMembresByTeamId()?.subscribe((membres: any[]) => {
|
||||
console.log(membres);
|
||||
this.listMembres = membres;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-accueil',
|
||||
|
|
@ -7,9 +10,15 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class PageAccueilComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
constructor(private http: HttpClient, private router: Router, private tokenService: TokenService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const token = this.tokenService.getToken();
|
||||
if(token){
|
||||
this.router.navigate(['tableau-de-bord']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<app-side-bar></app-side-bar>
|
||||
|
|
@ -6,12 +7,14 @@
|
|||
<div class="form-addMember">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
|
||||
<div class="form-floating">
|
||||
<input type="color"
|
||||
class="form-control"
|
||||
id="floatingInputcouleur"
|
||||
placeholder=""
|
||||
name="couleur"
|
||||
formControlName="couleurFc">
|
||||
<input
|
||||
type="color"
|
||||
class="form-control"
|
||||
id="floatingInputcouleur"
|
||||
placeholder=""
|
||||
name="couleur"
|
||||
formControlName="couleurFc"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
|
|
@ -68,7 +71,9 @@
|
|||
!addMemberForm.controls['dateNaissanceFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
|
||||
<label for="floatingInputdateNaissance"
|
||||
>VOTRE DATE DE NAISSANCE</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
|
|
@ -87,7 +92,20 @@
|
|||
!addMemberForm.controls['emailFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingInputemail">VOTRE EMAIL</label>
|
||||
<label for="floatingInputemail">Votre Email</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<select
|
||||
class="form-control"
|
||||
id="floatingInputRole"
|
||||
placeholder=""
|
||||
name="Role"
|
||||
formControlName="roleFc"
|
||||
>
|
||||
<option value="ROLE_PARENT">Adulte</option>
|
||||
<option value="ROLE_ENFANT">Enfant</option>
|
||||
</select>
|
||||
<label value="ROLE_PARENT">Sélectionner un profil</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
|
|
@ -125,17 +143,20 @@
|
|||
!addMemberForm.controls['passwordConfirmFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
|
||||
<label for="floatingPasswordConfirm"
|
||||
>CONFIRMEZ VOTRE MOT DE PASSE</label
|
||||
>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="w-100 btn btn-lg btn-outline-success"
|
||||
type="submit"
|
||||
[disabled]="addMemberForm.invalid"
|
||||
>Ajouter le membre</button>
|
||||
>
|
||||
Ajouter le membre
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { Mail } from 'src/app/models/mail';
|
||||
import { Membre } from 'src/app/models/membre';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { MailService } from 'src/app/services/mail.service';
|
||||
import { MembreService } from 'src/app/services/membre.service';
|
||||
|
||||
@Component({
|
||||
|
|
@ -15,6 +17,7 @@ export class PageAddMemberComponent implements OnInit {
|
|||
public addMemberForm: FormGroup;
|
||||
constructor(
|
||||
private membreService: MembreService,
|
||||
private mailService: MailService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private fb: FormBuilder
|
||||
|
|
@ -29,6 +32,7 @@ export class PageAddMemberComponent implements OnInit {
|
|||
firstNameFc: new FormControl('', [Validators.required]),
|
||||
lastNameFc: new FormControl('', [Validators.required]),
|
||||
dateNaissanceFc: new FormControl('', [Validators.required]),
|
||||
roleFc: new FormControl('', []),
|
||||
couleurFc: new FormControl('', []),
|
||||
emailFc: new FormControl('', [
|
||||
Validators.email,
|
||||
|
|
@ -53,9 +57,10 @@ export class PageAddMemberComponent implements OnInit {
|
|||
public onSubmit(): void {
|
||||
console.log('value : ', this.addMemberForm.value);
|
||||
console.log('form : ', this.addMemberForm);
|
||||
const firstNameValue = this.addMemberForm.value['firstNameFc'];
|
||||
const lastNameValue = this.addMemberForm.value['lastNameFc'];
|
||||
const firstNameValue = this.addMemberForm.value['firstNameFc'];
|
||||
const emailValue = this.addMemberForm.value['emailFc'];
|
||||
const roleValue = this.addMemberForm.value['roleFc'];
|
||||
const passwordValue = this.addMemberForm.value['passwordFc'];
|
||||
const dateNaissanceValue = this.addMemberForm.value['dateNaissanceFc'];
|
||||
const couleurValue = this.addMemberForm.value['couleurFc'];
|
||||
|
|
@ -63,19 +68,31 @@ export class PageAddMemberComponent implements OnInit {
|
|||
|
||||
|
||||
const membre: Membre = {
|
||||
nom: firstNameValue,
|
||||
prenom: lastNameValue,
|
||||
nom: lastNameValue,
|
||||
prenom: firstNameValue,
|
||||
email: emailValue,
|
||||
password: passwordValue,
|
||||
couleur: couleurValue,
|
||||
dateNaissance: dateNaissanceValue,
|
||||
passwordConfirm: passwordConfirmValue,
|
||||
roleList: ["ROLE_PARENT"]
|
||||
roleList: [roleValue]
|
||||
};
|
||||
|
||||
const mail: Mail = {
|
||||
recipient: emailValue,
|
||||
subject: "Votre mot de passe Organizee",
|
||||
//message: 'Votre mot de passe'
|
||||
message: `Bonjour ${firstNameValue}!\n Voici vos identifiants de connexion : \n
|
||||
Identifiant : ${emailValue}
|
||||
Mot de passe : ${passwordValue}`
|
||||
};
|
||||
|
||||
|
||||
if (membre.email !== '' && membre.password !== '') {
|
||||
this.membreService.addMembre(membre).subscribe((resp) => {
|
||||
this.membreService.addMembre(membre)?.subscribe((resp) => {
|
||||
this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
|
||||
console.log("Mail envoyé");
|
||||
})
|
||||
this.router.navigate(['compte']);
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,37 +1,80 @@
|
|||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
|
||||
<div class="alert alert-{{alert.type}}" role="alert" style="position:absolute;z-index:999;top:50%;left:40%; width: 500px;" *ngIf="isShow" id="showAlert">
|
||||
{{alert.content}}
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close" (click)="onClickCloseAlert()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div
|
||||
class="alert alert-{{ alert.type }}"
|
||||
role="alert"
|
||||
style="position: absolute; z-index: 999; top: 50%; left: 40%; width: 500px"
|
||||
*ngIf="isShow"
|
||||
id="showAlert"
|
||||
>
|
||||
{{ alert.content }}
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
data-dismiss="alert"
|
||||
aria-label="Close"
|
||||
(click)="onClickCloseAlert()"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;">
|
||||
<div style="width:150px;">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;">
|
||||
<div class="wrap">
|
||||
<div class="left">
|
||||
<daypilot-navigator [config]="navigatorConfig" [(date)]="date" #navigator></daypilot-navigator>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div style="width:100%; margin:10px">
|
||||
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigatePrevious($event)">Previous</a>
|
||||
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigateToday($event)">Today</a>
|
||||
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigateNext($event)">Next</a>
|
||||
team : {{teamId}} - user: {{userId}} - role: {{role}}
|
||||
<span style="float:right"><a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;">Ajouter un évènement</a></span>
|
||||
|
||||
</div>
|
||||
|
||||
<daypilot-calendar [config]="config" [events]="events" #calendar (viewChange)="viewChange()"></daypilot-calendar>
|
||||
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<div style="width: 150px">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
|
||||
<div style="width: 100%">
|
||||
<div class="wrap">
|
||||
<div class="left">
|
||||
<daypilot-navigator
|
||||
[config]="navigatorConfig"
|
||||
[(date)]="date"
|
||||
#navigator
|
||||
></daypilot-navigator>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div style="width: 100%; margin: 10px">
|
||||
<a
|
||||
href="#"
|
||||
class="btn btn-sm btn-primary"
|
||||
style="margin-right: 5px"
|
||||
(click)="navigatePrevious($event)"
|
||||
>Previous</a
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
class="btn btn-sm btn-primary"
|
||||
style="margin-right: 5px"
|
||||
(click)="navigateToday($event)"
|
||||
>Today</a
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
class="btn btn-sm btn-primary"
|
||||
style="margin-right: 5px"
|
||||
(click)="navigateNext($event)"
|
||||
>Next</a
|
||||
>
|
||||
team : {{ teamId }} - user: {{ userId }} - role: {{ role }}
|
||||
<span style="float: right"
|
||||
><a
|
||||
href="#"
|
||||
class="btn btn-sm btn-primary"
|
||||
style="margin-right: 5px"
|
||||
>Ajouter un évènement</a
|
||||
></span
|
||||
>
|
||||
</div>
|
||||
|
||||
<daypilot-calendar
|
||||
[config]="config"
|
||||
[events]="events"
|
||||
#calendar
|
||||
(viewChange)="viewChange()"
|
||||
></daypilot-calendar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,86 +1,147 @@
|
|||
<div>
|
||||
<app-header></app-header>
|
||||
<app-header></app-header>
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class="ajoutContact-form text-center">
|
||||
<h1>Ajouter un contact</h1>
|
||||
</div>
|
||||
<div class="ajoutContact-form text-center">
|
||||
<h3>Ajouter un contact</h3>
|
||||
<main class="form-ajoutContact">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
|
||||
|
||||
<div class="form-floating">
|
||||
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
||||
formControlName="couleurFc">
|
||||
</div>
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="color"
|
||||
class="form-control"
|
||||
id="floatingInputcouleur"
|
||||
placeholder=""
|
||||
name="couleur"
|
||||
formControlName="couleurFc"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floatingInputlastName"
|
||||
placeholder=""
|
||||
name="lastName"
|
||||
formControlName="lastNameFc">
|
||||
<label for="floatingInputlastName">Nom</label>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputlastName"
|
||||
placeholder=""
|
||||
name="lastName"
|
||||
formControlName="lastNameFc"
|
||||
/>
|
||||
<label for="floatingInputlastName">Nom</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputfirstName"
|
||||
placeholder=""
|
||||
name="firstName"
|
||||
formControlName="firstNameFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Prénom</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputTelephone"
|
||||
placeholder=""
|
||||
name="telephone"
|
||||
formControlName="telephoneFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Téléphone</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
id="floatingInput"
|
||||
placeholder=""
|
||||
name="email"
|
||||
formControlName="emailFc"
|
||||
/>
|
||||
<label for="floatingInput">Adresse email</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="date"
|
||||
class="form-control"
|
||||
id="floatingInputdateNaissance"
|
||||
placeholder=""
|
||||
name="dateNaissance"
|
||||
formControlName="dateNaissanceFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Date de naissance</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floatingInputfirstName"
|
||||
placeholder=""
|
||||
name="firstName"
|
||||
formControlName="firstNameFc">
|
||||
<label for="floatingInputfirstName">Prénom</label>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputAdresse"
|
||||
placeholder=""
|
||||
name="adresse"
|
||||
formControlName="adresseFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Adresse</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputTelephone"
|
||||
placeholder=""
|
||||
name="telephone"
|
||||
formControlName="telephoneFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Téléphone</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
id="floatingInput"
|
||||
placeholder=""
|
||||
name="email"
|
||||
formControlName="emailFc"
|
||||
/>
|
||||
<label for="floatingInput">Adresse email</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floatingInputTelephone"
|
||||
placeholder=""
|
||||
name="telephone"
|
||||
formControlName="telephoneFc">
|
||||
<label for="floatingInputfirstName">Téléphone</label>
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="date"
|
||||
class="form-control"
|
||||
id="floatingInputdateNaissance"
|
||||
placeholder=""
|
||||
name="dateNaissance"
|
||||
formControlName="dateNaissanceFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Date de naissance</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputAdresse"
|
||||
placeholder=""
|
||||
name="adresse"
|
||||
formControlName="adresseFc"
|
||||
/>
|
||||
<label for="floatingInputfirstName">Adresse</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input type="email"
|
||||
class="form-control"
|
||||
id="floatingInput"
|
||||
placeholder=""
|
||||
name="email"
|
||||
formControlName="emailFc">
|
||||
<label for="floatingInput">Adresse email</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-floating">
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="floatingInputdateNaissance"
|
||||
placeholder=""
|
||||
name="dateNaissance"
|
||||
formControlName="dateNaissanceFc">
|
||||
<label for="floatingInputfirstName">Date de naissance</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floatingInputAdresse"
|
||||
placeholder=""
|
||||
name="adresse"
|
||||
formControlName="adresseFc">
|
||||
<label for="floatingInputfirstName">Adresse</label>
|
||||
</div>
|
||||
|
||||
<button class="w-100 btn btn-lg btn-secondary"
|
||||
type="submit"
|
||||
[disabled]="ajoutContactForm.invalid">Valider</button>
|
||||
|
||||
</form>
|
||||
<button
|
||||
class="w-100 btn btn-lg btn-secondary"
|
||||
type="submit"
|
||||
[disabled]="ajoutContactForm.invalid"
|
||||
>
|
||||
Valider
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,27 +1,40 @@
|
|||
<app-header></app-header>
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class=" col team-form text-center">
|
||||
<h1>Créer votre team</h1>
|
||||
<main class="form-team">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floatingInputName"
|
||||
placeholder=""
|
||||
name="name"
|
||||
formControlName="nameFc"
|
||||
[ngClass]="{'is-valid' : teamForm.controls['nameFc'].touched && teamForm.controls['nameFc'].valid,
|
||||
'is-invalid': teamForm.controls['nameFc'].touched && !teamForm.controls['nameFc'].valid}">
|
||||
<label for="floatingInputName">Nom</label>
|
||||
</div>
|
||||
<button class="w-100 btn btn-lg btn-success"
|
||||
type="submit"
|
||||
[disabled]="teamForm.invalid">Je crée ma team</button>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class="col team-form text-center">
|
||||
<h1>Créer votre team</h1>
|
||||
<main class="form-team">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
|
||||
<div class="form-floating">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="floatingInputName"
|
||||
placeholder=""
|
||||
name="name"
|
||||
formControlName="nameFc"
|
||||
[ngClass]="{
|
||||
'is-valid':
|
||||
teamForm.controls['nameFc'].touched &&
|
||||
teamForm.controls['nameFc'].valid,
|
||||
'is-invalid':
|
||||
teamForm.controls['nameFc'].touched &&
|
||||
!teamForm.controls['nameFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingInputName">Nom</label>
|
||||
</div>
|
||||
<button
|
||||
class="w-100 btn btn-lg btn-success"
|
||||
type="submit"
|
||||
[disabled]="teamForm.invalid"
|
||||
>
|
||||
Je crée ma team
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
} from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { Team } from 'src/app/models/team';
|
||||
import { MembreService } from 'src/app/services/membre.service';
|
||||
import { TeamService } from 'src/app/services/team.service';
|
||||
|
||||
@Component({
|
||||
|
|
@ -18,6 +19,7 @@ export class PageCreationTeamComponent implements OnInit {
|
|||
public teamForm: FormGroup;
|
||||
constructor(
|
||||
private teamService: TeamService,
|
||||
private membreService: MembreService,
|
||||
private router: Router,
|
||||
private fb: FormBuilder
|
||||
) {
|
||||
|
|
@ -39,9 +41,6 @@ export class PageCreationTeamComponent implements OnInit {
|
|||
const team: Team = {
|
||||
nom : nameValue,
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (team.nom !== '' ) {
|
||||
this.teamService.addTeam(team).subscribe((resp) => {
|
||||
this.router.navigate(['compte']);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,35 @@
|
|||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
<app-meteo></app-meteo>
|
||||
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
<button button type="button" class="btn btn-primary btn-lg" routerLink="../creation-team"
|
||||
routerLinkActive="active-custom">Créer ma team</button>
|
||||
<app-deconnexion></app-deconnexion>
|
||||
|
||||
<div class="container">
|
||||
<div>
|
||||
<h3 class="titre">Bienvenue {{ conectedUser.prenom }}!!</h3>
|
||||
</div>
|
||||
<div class="row d-flex align-items-center flex-row">
|
||||
<div class="col-sm-3 col-xs-6 box border" id="boxThree">
|
||||
<app-meteo></app-meteo>
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-6 box border" id="boxTwo">
|
||||
<app-calendrier>A venir</app-calendrier>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3 col-xs-6 box border" id="boxFour">
|
||||
<div>
|
||||
<app-humeur></app-humeur>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row avatar">
|
||||
<div class="col" *ngFor="let membreData of listMembres">
|
||||
<app-card-avatar [membre]="membreData"> </app-card-avatar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-footer></app-footer>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,50 @@
|
|||
.titre{
|
||||
display: inline-flex;
|
||||
margin-left: 20px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.meteo {
|
||||
display: flex;
|
||||
margin-left: 300px;
|
||||
margin-left: 500px;
|
||||
margin-top: -60px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
padding: 20px;
|
||||
|
||||
}
|
||||
|
||||
button{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.calendrier{
|
||||
align-content: flex-end;
|
||||
}
|
||||
|
||||
#boxFour{
|
||||
height: 150px;
|
||||
margin-top: -99px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
#boxThree{
|
||||
margin-top: -85px;
|
||||
height: 150px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
#boxTwo{
|
||||
margin-top: 50px;
|
||||
margin-left: 150px;
|
||||
height: 50%;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.avatar{
|
||||
margin-top: -50px;
|
||||
justify-content: space-between;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { MembreService } from 'src/app/services/membre.service';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-dashboard',
|
||||
|
|
@ -7,9 +11,27 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class PageDashboardComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
conectedUser: any;
|
||||
listMembres: any[];
|
||||
|
||||
constructor(private membreService: MembreService,
|
||||
private http: HttpClient,
|
||||
private router: Router,
|
||||
private tokenService: TokenService) {
|
||||
this.listMembres = [];
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.membreService.getMembreId(this.tokenService.getCurrentMembreId()).subscribe((result) => {
|
||||
this.conectedUser = result ;
|
||||
console.log(result);
|
||||
})
|
||||
|
||||
this.membreService.getMembresByTeamId()?.subscribe((membres: any[]) => {
|
||||
console.log(membres);
|
||||
this.listMembres = membres;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class=" col compte text-center">
|
||||
<div class="col compte text-center">
|
||||
<h1>Supprimer ce membre</h1>
|
||||
<main class="contenu-compte">
|
||||
|
||||
</main>
|
||||
<main class="contenu-compte"></main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,10 +9,22 @@
|
|||
<label for="floatingInput">Adresse email</label>
|
||||
</div>
|
||||
|
||||
<button class="w-100 btn btn-lg btn-success" type="submit" [disabled]="forgotForm.invalid" routerLink="../reinitialisation-password"
|
||||
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button>
|
||||
<!-- <button class="w-100 btn btn-lg btn-success" type="submit" [disabled]="forgotForm.invalid" routerLink="../reinitialisation-password"
|
||||
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button> -->
|
||||
|
||||
<button
|
||||
class="w-100 btn btn-lg btn-outline-success"
|
||||
type="submit"
|
||||
[disabled]="forgotForm.invalid">
|
||||
Ré-initialiser mon mot de passe
|
||||
</button>
|
||||
</form>
|
||||
<br/> <br/>
|
||||
<div *ngIf="isShow">
|
||||
<div class="alert alert-{{alert.type}}" role="alert">
|
||||
{{alert.content}}
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div *ngIf="errorForm">
|
||||
<p class="text-danger">Il manque des informations dans le formulaire...</p>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import {
|
|||
FormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import { Membre } from 'src/app/models/membre';
|
||||
import { MailService } from 'src/app/services/mail.service';
|
||||
import { Mail } from 'src/app/models/mail';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-forgot-password',
|
||||
|
|
@ -14,18 +17,76 @@ import {
|
|||
styleUrls: ['./page-forgot-password.component.scss']
|
||||
})
|
||||
export class PageForgotPasswordComponent implements OnInit {
|
||||
constructor(private authService: AuthService, private router: Router) {
|
||||
|
||||
alert : any;
|
||||
isShow : boolean;
|
||||
|
||||
constructor(private authService: AuthService, private router: Router, private mailService: MailService,) {
|
||||
this.alert = "";
|
||||
this.isShow = false;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
public onSubmit(submittedForm: any): void {
|
||||
console.log(submittedForm.form.value);
|
||||
const membre: Membre = {
|
||||
nom: "",
|
||||
prenom: "",
|
||||
dateNaissance: new Date(),
|
||||
email: submittedForm.form.value.email,
|
||||
password: "",
|
||||
roleList: ["ROLE_PARENT"],
|
||||
couleur: "",
|
||||
passwordConfirm: ""
|
||||
};
|
||||
|
||||
console.log(membre);
|
||||
// this.authService.forgotPassword(membre).subscribe((resp) => {
|
||||
// console.log('----'+resp)
|
||||
// });
|
||||
|
||||
this.authService.forgotPassword(membre).subscribe(
|
||||
{
|
||||
next: result => {
|
||||
this.alert={"type":"success", "content":"Un mail à été envoyé !"};
|
||||
this.isShow = true;
|
||||
const mail: Mail = {
|
||||
recipient: submittedForm.form.value.email,
|
||||
subject: "Votre mot de passe Organizee",
|
||||
//message: 'Votre mot de passe'
|
||||
message: `
|
||||
Bonjour!\n
|
||||
Vous avez fait une demande de ré-initialisation de mot de passe. \n
|
||||
Cliquez sur le lien pour définir un nouveau mot de passe: \n
|
||||
Lien : http://192.168.1.16:4200/reinitialisation-password/${result}`
|
||||
};
|
||||
this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
|
||||
console.log("Mail envoyé");
|
||||
})
|
||||
},
|
||||
error: err => {
|
||||
this.alert={"type":"danger", "content":"Le mail a merdé, ou il n'y a personne ds la bdd !"};
|
||||
this.isShow = true;
|
||||
},
|
||||
complete: () => console.log('DONE!')
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// service resetpassword
|
||||
// creer un random et le mettre dans password
|
||||
//service envoi de mail // envoyer un lien avec ce random
|
||||
// nouveau formulaire de reset password
|
||||
// update du password
|
||||
|
||||
|
||||
|
||||
// const email = submittedForm.form.value['email'];
|
||||
// console.log(email);
|
||||
window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
||||
//window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
||||
// this.router.navigate(['reinitialisation-password']);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
<body>
|
||||
|
||||
<h2>Mon humeur :</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<p><img src="{{monHumeurLien}}" *ngIf="monHumeurLien" ></p>
|
||||
|
||||
<p>Je modifie mon avatar :</p>
|
||||
|
||||
|
||||
<div class="humeur" *ngFor="let humor of tabHumeur; let i=index">
|
||||
<img src="{{humor.lien}}" alt="{{humor.title}}" (click)="onChoixHumeur(i)">
|
||||
</div>
|
||||
|
||||
|
||||
<div >
|
||||
|
||||
|
||||
</div> </body>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
|
||||
|
||||
p>img {
|
||||
width: 85px;
|
||||
height: 85px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.humeur {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: grey;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-humeur',
|
||||
templateUrl: './page-humeur.component.html',
|
||||
styleUrls: ['./page-humeur.component.scss']
|
||||
})
|
||||
|
||||
export class PageHumeurComponent implements OnInit {
|
||||
|
||||
monHumeurLien! : string[];
|
||||
monHumeurTitle! : string[] ;
|
||||
|
||||
|
||||
tabHumeur= [
|
||||
{ title : "Je vais bien", lien : "assets/images/emoticon-heureux.png"},
|
||||
{ title : "Je pleure", lien : "assets/images/emoticon-pleurer.png"},
|
||||
{ title : "Je suis fatigué", lien : "assets/images/emoticon-fatigue.png"},
|
||||
{ title : "Je suis en colère", lien : "assets/images/emoticon-insulter.png"},
|
||||
{ title : "Je suis malade", lien : "assets/images/emoticon-vomir.png"} ]
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void { }
|
||||
|
||||
onChoixHumeur(numero: number){
|
||||
this.monHumeurTitle= [this.tabHumeur[numero].title];
|
||||
this.monHumeurLien= [this.tabHumeur[numero].lien];
|
||||
|
||||
console.log("humeur titre est : ", this.monHumeurTitle);
|
||||
console.log("humeur lien est : ", this.monHumeurLien);
|
||||
console.log("index humeur est : ", numero );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,29 +1,13 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
<app-side-bar class="sidebarMenu"></app-side-bar>
|
||||
</div>
|
||||
<div class=" col compte text-center">
|
||||
<h1>Menu de la semaine</h1>
|
||||
<main class="contenu-compte">
|
||||
<div class="col menu text-center">
|
||||
<h2>Menu de la semaine</h2>
|
||||
<main class="contenu-menu">
|
||||
<app-card-menu></app-card-menu>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<div>
|
||||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<app-header></app-header>
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
|
||||
<div class="modifContact-form text-center">
|
||||
<h1>Modifier ce contact</h1>
|
||||
<h3>Modifier ce contact</h3>
|
||||
<main class="form-modifContact">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm">
|
||||
|
||||
|
|
@ -84,4 +85,5 @@
|
|||
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -23,3 +23,4 @@ describe('PageNotFoundComponent', () => {
|
|||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,41 +1,61 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
|
||||
<div class=" col compte text-center py-3 border">
|
||||
<div>
|
||||
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">Tous les contacts
|
||||
</button>
|
||||
<button routerLink="/ajouter-contact" class="btn btn-sm btn-rounded btn-secondary m-3">
|
||||
Ajouter un contact
|
||||
</button>
|
||||
<div class="col compte text-center py-3 border">
|
||||
<div>
|
||||
<button
|
||||
*ngIf="parent"
|
||||
routerLink="/ajouter-contact"
|
||||
class="btn btn-sm btn-rounded btn-secondary m-3"
|
||||
>
|
||||
Ajouter un contact
|
||||
</button>
|
||||
|
||||
<div class="input-group mb-3 d-flex justify-content-center">
|
||||
<input type="text" class="form-control" placeholder="Rechercher un contact"
|
||||
aria-label="Rechercher un contact" aria-describedby="basic-addon2" #word
|
||||
(keyup)="onSearchChange(word.value)">
|
||||
<div class="input-group mb-3 d-flex justify-content-center">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
placeholder="Rechercher un contact"
|
||||
aria-label="Rechercher un contact"
|
||||
aria-describedby="basic-addon2"
|
||||
#word
|
||||
(keyup)="onSearchChange(word.value)"
|
||||
/>
|
||||
|
||||
<div class="input-group-append"></div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Liste des Contacts</h4>
|
||||
</div>
|
||||
<div class="row justify-content-evenly">
|
||||
<div class="col-4">
|
||||
<div class="row my-3 d-flex justify-content-center flex-row" *ngFor="let personne of listContact"
|
||||
(click)="onClick(personne)">
|
||||
<div class="couleur col-4" [style.background-color]="personne.couleur"></div>
|
||||
<span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4" *ngIf="openDetails">
|
||||
<app-fiche-contact [personne]="openDetails" (clickDelete)="onClickDelete($event)">
|
||||
</app-fiche-contact>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-append"></div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Liste des Contacts</h4>
|
||||
</div>
|
||||
<div class="row justify-content-evenly">
|
||||
<div class="col-4">
|
||||
<div
|
||||
class="row my-3 d-flex justify-content-center flex-row"
|
||||
*ngFor="let personne of listContact"
|
||||
(click)="onClick(personne)"
|
||||
>
|
||||
<div
|
||||
class="couleur col-4"
|
||||
[style.background-color]="personne.couleur"
|
||||
></div>
|
||||
<span class="fiche-contact col-7"
|
||||
>{{ personne.prenom }} {{ personne.nom }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4" *ngIf="openDetails">
|
||||
<app-fiche-contact
|
||||
[personne]="openDetails"
|
||||
(clickDelete)="onClickDelete($event)"
|
||||
>
|
||||
</app-fiche-contact>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
|||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Contact } from 'src/app/models/contact';
|
||||
import { RepertoireService } from 'src/app/services/repertoire.service';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-repertoire',
|
||||
|
|
@ -15,18 +16,27 @@ export class PageRepertoireComponent implements OnInit {
|
|||
public personneid: any;
|
||||
keyword: any;
|
||||
openDetails: any;
|
||||
parent: boolean;
|
||||
|
||||
constructor(
|
||||
private repertoireService: RepertoireService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute
|
||||
private route: ActivatedRoute,
|
||||
private tokenService: TokenService
|
||||
) {
|
||||
this.listContact = [];
|
||||
this.listFull = [];
|
||||
this.listContactInfo = '';
|
||||
this.parent = false;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const roleUser = this.tokenService.getRole();
|
||||
|
||||
if(roleUser == "ROLE_PARENT"){
|
||||
this.parent = true;
|
||||
}
|
||||
|
||||
//récupère tout les contact et leurs info
|
||||
this.repertoireService.getContact().subscribe((listContact: any[]) => {
|
||||
console.log(listContact);
|
||||
|
|
@ -69,5 +79,6 @@ export class PageRepertoireComponent implements OnInit {
|
|||
}
|
||||
this.router.navigate(['repertoire/']);
|
||||
});
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,45 @@
|
|||
<app-header></app-header>
|
||||
<div class="reset-form text-center">
|
||||
<main class="form-reset">
|
||||
<form (ngSubmit)="onSubmit(resetForm)" #resetForm="ngForm">
|
||||
<form (ngSubmit)="onSubmit()" [formGroup]="resetForm">
|
||||
<h3>Entrez ici votre email et votre nouveau mot de passe</h3>
|
||||
<div class="form-floating">
|
||||
<input type="email" class="form-control" id="floatingEmail" placeholder="" name="email" ngModel required
|
||||
[ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['email'] != '' ,
|
||||
'is-invalid': resetForm.form.touched && resetForm.form.value['email'] == ''}">
|
||||
<label for="floatingEmail">Email</label>
|
||||
<input
|
||||
type="password"
|
||||
class="form-control"
|
||||
id="floatingPassword"
|
||||
placeholder=""
|
||||
name="password"
|
||||
formControlName="passwordFc"
|
||||
[ngClass]="{
|
||||
'is-valid':
|
||||
resetForm.controls['passwordFc'].touched &&
|
||||
resetForm.controls['passwordFc'].valid,
|
||||
'is-invalid':
|
||||
resetForm.controls['passwordFc'].touched &&
|
||||
!resetForm.controls['passwordFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingPassword">MOT DE PASSE</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
|
||||
required [ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['password'] != '' ,
|
||||
'is-invalid': resetForm.form.touched && resetForm.form.value['password'] == ''}">
|
||||
<label for="floatingPassword">Mot de passe</label>
|
||||
<input
|
||||
type="password"
|
||||
class="form-control"
|
||||
id="floatingpasswordConfirm"
|
||||
placeholder=""
|
||||
name="passwordConfirm"
|
||||
formControlName="passwordConfirmFc"
|
||||
[ngClass]="{
|
||||
'is-valid':
|
||||
resetForm.controls['passwordConfirmFc'].touched &&
|
||||
resetForm.controls['passwordConfirmFc'].valid,
|
||||
'is-invalid':
|
||||
resetForm.controls['passwordConfirmFc'].touched &&
|
||||
!resetForm.controls['passwordConfirmFc'].valid
|
||||
}"
|
||||
/>
|
||||
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
|
||||
</div>
|
||||
<button class="w-100 btn btn-outline-success" type="submit" [disabled]="resetForm.invalid">Enregistrer</button>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Membre } from 'src/app/models/membre';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
|
||||
|
||||
|
|
@ -9,20 +11,80 @@ import { AuthService } from 'src/app/services/auth.service';
|
|||
styleUrls: ['./page-reset-password.component.scss']
|
||||
})
|
||||
export class PageResetPasswordComponent implements OnInit {
|
||||
public resetForm: FormGroup;
|
||||
uuid:string;
|
||||
constructor(private authService: AuthService, private router: Router,private fb: FormBuilder, private activatedRoute: ActivatedRoute) {
|
||||
this.resetForm = new FormGroup({});
|
||||
this.uuid = this.activatedRoute.snapshot.params['uuid'];
|
||||
}
|
||||
|
||||
constructor(private authService: AuthService, private router: Router,) { }
|
||||
ngOnInit(): void {
|
||||
this.resetForm = this.fb.group(
|
||||
{
|
||||
passwordFc: new FormControl('', [
|
||||
Validators.minLength(8),
|
||||
Validators.required,
|
||||
]),
|
||||
passwordConfirmFc: new FormControl('', [
|
||||
Validators.minLength(8),
|
||||
Validators.required,
|
||||
]),
|
||||
},
|
||||
{
|
||||
validator: this.ConfirmedValidator('passwordFc', 'passwordConfirmFc'),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit(): void { }
|
||||
// public onSubmit(submittedForm: any): void {
|
||||
// console.log(submittedForm.form.value);
|
||||
// const password = submittedForm.form.value['password'];
|
||||
// console.log(email);
|
||||
// this.authService.resetPassword(email, password).subscribe((resp: any) => {
|
||||
// window.alert("Votre mot de passe est bien ré-initialisé !")
|
||||
// this.router.navigate(['accueil']);
|
||||
|
||||
public onSubmit(submittedForm: any): void {
|
||||
console.log(submittedForm.form.value);
|
||||
const password = submittedForm.form.value['password'];
|
||||
const email = submittedForm.form.value['email'];
|
||||
console.log(email);
|
||||
this.authService.resetPassword(email, password).subscribe((resp: any) => {
|
||||
window.alert("Votre mot de passe est bien ré-initialisé !")
|
||||
this.router.navigate(['accueil']);
|
||||
// });
|
||||
// }
|
||||
|
||||
});
|
||||
public onSubmit(): void {
|
||||
console.log('value : ', this.resetForm.value);
|
||||
console.log('form : ', this.resetForm);
|
||||
const passwordValue = this.resetForm.value['passwordFc'];
|
||||
const passwordConfirmValue = this.resetForm.value['passwordConfirmFc'];
|
||||
|
||||
const membre: Membre = {
|
||||
nom: "",
|
||||
prenom: "",
|
||||
dateNaissance: new Date(),
|
||||
email: "",
|
||||
password: passwordValue,
|
||||
roleList: ["ROLE_PARENT"],
|
||||
couleur: "",
|
||||
passwordConfirm: ""
|
||||
};
|
||||
|
||||
|
||||
this.authService.resetPassword(membre,this.uuid).subscribe((resp) => {
|
||||
this.router.navigate(['accueil']);
|
||||
});
|
||||
}
|
||||
|
||||
ConfirmedValidator(controlName: string, matchingControlName: string) {
|
||||
return (formGroup: FormGroup) => {
|
||||
const control = formGroup.controls[controlName];
|
||||
const matchingControl = formGroup.controls[matchingControlName];
|
||||
if (
|
||||
matchingControl.errors &&
|
||||
!matchingControl.errors['confirmedValidator']
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (control.value !== matchingControl.value) {
|
||||
matchingControl.setErrors({ confirmedValidator: true });
|
||||
} else {
|
||||
matchingControl.setErrors(null);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
31
src/app/pages/page-support/page-support.component.html
Normal file
31
src/app/pages/page-support/page-support.component.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!-- <div>
|
||||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div>
|
||||
<h2>Demande support</h2>
|
||||
<form action="/demande_support" method="post">
|
||||
|
||||
<label for="name">Nom :</label>
|
||||
<div>
|
||||
<input type="text" id="name" value="Votre nom" name="user_name">
|
||||
</div>
|
||||
|
||||
<label for="mail">E-mail :</label>
|
||||
<div>
|
||||
<input type="email" id="mail" name="user_mail" value="Votre adresse mail">
|
||||
</div>
|
||||
<label for="msg">Message :</label>
|
||||
<div>
|
||||
|
||||
<textarea id="msg" name="user_message">Formulez votre demande ici</textarea>
|
||||
</div>
|
||||
<div class="button">
|
||||
|
||||
<button class="btn btn-primary">Envoyez votre message</button>
|
||||
<button type="button" class="btn btn-danger">Effacer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
39
src/app/pages/page-support/page-support.component.scss
Normal file
39
src/app/pages/page-support/page-support.component.scss
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
form {
|
||||
background-color: rgb(184, 202, 235);
|
||||
width: 600px;
|
||||
border: 3px solid blue;
|
||||
margin: 0 auto;
|
||||
border-radius: 1em;
|
||||
padding:3em;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
width: 500px;
|
||||
color :rgb(153, 171, 208)
|
||||
}
|
||||
|
||||
button {
|
||||
margin-left: .9em;
|
||||
}
|
||||
|
||||
h2{
|
||||
text-align: center;
|
||||
color : blue;
|
||||
}
|
||||
|
||||
label {
|
||||
color : rgb(65, 47, 221);
|
||||
text-align: left;
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: 8em;
|
||||
color :rgb(153, 171, 208)
|
||||
}
|
||||
|
||||
.button {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PageHumeurComponent } from './page-humeur.component';
|
||||
import { PageSupportComponent } from './page-support.component';
|
||||
|
||||
describe('PageHumeurComponent', () => {
|
||||
let component: PageHumeurComponent;
|
||||
let fixture: ComponentFixture<PageHumeurComponent>;
|
||||
describe('PageSupportComponent', () => {
|
||||
let component: PageSupportComponent;
|
||||
let fixture: ComponentFixture<PageSupportComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PageHumeurComponent ]
|
||||
declarations: [ PageSupportComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PageHumeurComponent);
|
||||
fixture = TestBed.createComponent(PageSupportComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
19
src/app/pages/page-support/page-support.component.ts
Normal file
19
src/app/pages/page-support/page-support.component.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
//DRIVEN FORM
|
||||
@Component({
|
||||
selector: 'app-page-support',
|
||||
templateUrl: './page-support.component.html',
|
||||
styleUrls: ['./page-support.component.scss']
|
||||
})
|
||||
export class PageSupportComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
|
||||
<div class="d-flex align-items-stretch">
|
||||
<div class="row">
|
||||
<div class="col" *ngFor="let todos of result">
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class=" col compte text-center">
|
||||
<div class="col compte text-center">
|
||||
<h1>Modifier votre compte</h1>
|
||||
<main class="contenu-compte">
|
||||
|
||||
</main>
|
||||
<main class="contenu-compte"></main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<app-header></app-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-auto">
|
||||
<app-side-bar></app-side-bar>
|
||||
</div>
|
||||
<div class=" col compte text-center">
|
||||
<div class="col compte text-center">
|
||||
<h1>Modifier ce membre</h1>
|
||||
<main class="contenu-compte">
|
||||
|
||||
</main>
|
||||
<main class="contenu-compte"></main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue