Merge pull request #99 from AlineRinquin/dev
Dev verssion au 11/03/22 verssion 1.2
This commit is contained in:
		
						commit
						9b67d21485
					
				
					 58 changed files with 540 additions and 359 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,6 @@ import { PageAccueilComponent } from './pages/page-accueil/page-accueil.componen
 | 
			
		|||
import { PageAddMemberComponent } from './pages/page-add-member/page-add-member.component';
 | 
			
		||||
import { PageAgendaComponent } from './pages/page-agenda/page-agenda.component';
 | 
			
		||||
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
 | 
			
		||||
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
 | 
			
		||||
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
 | 
			
		||||
import { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component';
 | 
			
		||||
import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component';
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +29,7 @@ const routes: Routes = [
 | 
			
		|||
  { path: 'ajout-membre', canActivate: [AuthGuard], component: PageAddMemberComponent },
 | 
			
		||||
  { path: 'agenda', canActivate: [AuthGuard], component: PageAgendaComponent },
 | 
			
		||||
  { path: 'tableau-de-bord', canActivate: [AuthGuard], component: PageDashboardComponent },
 | 
			
		||||
  { path: 'supprimer-membre', canActivate: [AuthGuard], component: PageDeleteMemberComponent },
 | 
			
		||||
  { path: 'supprimer-membre/:id', canActivate: [AuthGuard], component: PageDeleteMemberComponent },
 | 
			
		||||
  { path: 'password-oublie', component: PageForgotPasswordComponent },
 | 
			
		||||
  { path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent },
 | 
			
		||||
  { path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent },
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +39,6 @@ const routes: Routes = [
 | 
			
		|||
  { path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent },
 | 
			
		||||
  { path: 'modifier-membre/:id', canActivate: [AuthGuard], component: PageUpdateMemberComponent },
 | 
			
		||||
  { path: 'ajouter-contact', canActivate: [AuthGuard], component: PageAjoutContactComponent },
 | 
			
		||||
  { path: 'creation-team', canActivate: [AuthGuard], component: PageCreationTeamComponent },
 | 
			
		||||
  { path: 'footer', component: FooterComponent},
 | 
			
		||||
  { path: 'ajout-evenement', canActivate: [AuthGuard], component: PageAjoutEvenementsComponent },
 | 
			
		||||
  { path: '**', component: PageNotFoundComponent },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 | 
			
		|||
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
 | 
			
		||||
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
 | 
			
		||||
import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component';
 | 
			
		||||
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
 | 
			
		||||
import { AutofocusFixModule  } from 'ngx-autofocus-fix';
 | 
			
		||||
import { FooterComponent } from './components/footer/footer.component';
 | 
			
		||||
import { DayPilot, DayPilotModule } from "@daypilot/daypilot-lite-angular";
 | 
			
		||||
| 
						 | 
				
			
			@ -41,6 +40,7 @@ import { HumeurComponent } from './components/humeur/humeur.component';
 | 
			
		|||
import { DeconnexionComponent } from './components/deconnexion/deconnexion.component';
 | 
			
		||||
import { AlertComponent } from './components/alert/alert.component';
 | 
			
		||||
import { PageAjoutEvenementsComponent } from './pages/page-ajout-evenements/page-ajout-evenements.component';
 | 
			
		||||
import { PageSupportComponent } from './pages/page-support/page-support.component';
 | 
			
		||||
registerLocaleData(localeFr)
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
| 
						 | 
				
			
			@ -72,13 +72,13 @@ registerLocaleData(localeFr)
 | 
			
		|||
    CreneauComponent,
 | 
			
		||||
    PageAjoutContactComponent,
 | 
			
		||||
    PageModifierContactComponent,
 | 
			
		||||
    PageCreationTeamComponent,
 | 
			
		||||
    FooterComponent,
 | 
			
		||||
    CardAvatarComponent,
 | 
			
		||||
    DeconnexionComponent,
 | 
			
		||||
    HumeurComponent,
 | 
			
		||||
    AlertComponent,
 | 
			
		||||
    PageAjoutEvenementsComponent
 | 
			
		||||
    PageAjoutEvenementsComponent, 
 | 
			
		||||
    PageSupportComponent
 | 
			
		||||
  ],
 | 
			
		||||
  imports: [
 | 
			
		||||
    BrowserModule,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
<div class="alert alert-{{alert.type}} alert-dismissible fade show" role="alert" style="position:absolute;z-index:9999;top:10px;right:50%;transform: translateX(50%);width:600px; text-align:center;">
 | 
			
		||||
<div class="alert alert-{{alert.type}} alert-dismissible fade show" role="alert" style="position:fixed;z-index:9999;top:10px;right:50%;transform: translateX(50%);width:600px; text-align:center;">
 | 
			
		||||
    {{alert.content}}
 | 
			
		||||
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" (click)="onClickCloseAlert()"></button>
 | 
			
		||||
  </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -8,11 +8,13 @@
 | 
			
		|||
              <h3 class="mt-2 mb-0">{{membre.prenom }}  {{membre.nom }}</h3>
 | 
			
		||||
              <div class="buttons text-center"><button button type="button" class="btn btn-outline-primary px-4"
 | 
			
		||||
                        routerLink="../modifier-membre/{{membre.id}}"
 | 
			
		||||
                        routerLinkActive="active-custom">
 | 
			
		||||
                        routerLinkActive="active-custom"
 | 
			
		||||
                        [hidden]="parent == false">
 | 
			
		||||
                        Modifier
 | 
			
		||||
                </button><button button type="button" class="btn btn-primary px-4"
 | 
			
		||||
                        routerLink="../supprimer-membre"
 | 
			
		||||
                        routerLinkActive="active-custom">
 | 
			
		||||
                        routerLink="../supprimer-membre/{{membre.id}}"
 | 
			
		||||
                        routerLinkActive="active-custom"
 | 
			
		||||
                        [hidden]="parent == false">
 | 
			
		||||
                        Supprimer
 | 
			
		||||
                </button>
 | 
			
		||||
              </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,7 @@
 | 
			
		|||
.mt-5 {
 | 
			
		||||
  margin-top: 0rem !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#couleur{
 | 
			
		||||
  width: 100px;
 | 
			
		||||
  height: 100px;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
import { Component, Input, OnInit } from '@angular/core';
 | 
			
		||||
import { TokenService } from 'src/app/services/token.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-card-member',
 | 
			
		||||
| 
						 | 
				
			
			@ -7,10 +8,24 @@ import { Component, Input, OnInit } from '@angular/core';
 | 
			
		|||
})
 | 
			
		||||
export class CardMemberComponent implements OnInit {
 | 
			
		||||
  @Input() membre: any;
 | 
			
		||||
  parent: boolean;
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
  constructor(private tokenService: TokenService) {
 | 
			
		||||
    this.parent = false;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
  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)**/
 | 
			
		||||
    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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,5 @@
 | 
			
		|||
  type="button"
 | 
			
		||||
  class="btn btn-outline-primary btn-circle btn-xl"
 | 
			
		||||
  (click)="onClickDeco()"
 | 
			
		||||
>
 | 
			
		||||
  Se déconnecter
 | 
			
		||||
> Déconnexion
 | 
			
		||||
</button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,25 @@
 | 
			
		|||
.btn-circle.btn-xl {
 | 
			
		||||
  width: 80px;
 | 
			
		||||
  height: 80px;
 | 
			
		||||
  padding: 10px 16px;
 | 
			
		||||
  border-radius: 40px;
 | 
			
		||||
  font-size: 10px;
 | 
			
		||||
  width: auto;
 | 
			
		||||
  height: auto;
 | 
			
		||||
  padding: 10px;
 | 
			
		||||
  border-radius: 15px;
 | 
			
		||||
  background-color: white;
 | 
			
		||||
  font-size: 12px;
 | 
			
		||||
  color: black;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  float: right;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn-circle.btn-xl:hover {
 | 
			
		||||
  width: auto;
 | 
			
		||||
  height: auto;
 | 
			
		||||
  padding: 10px;
 | 
			
		||||
  border-radius: 15px;
 | 
			
		||||
  background-color: #5d5fef;
 | 
			
		||||
  font-size: 12px;
 | 
			
		||||
  color: white;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin-right: 20px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +1,12 @@
 | 
			
		|||
<div class="footer text-center" >
 | 
			
		||||
<h3>Plan du site</h3>
 | 
			
		||||
<div class="liens">
 | 
			
		||||
<a routerLink="../accueil" routerLinkActive="active-custom" class="nav-link">Page d'accueil</a> 
 | 
			
		||||
<a routerLink="../tableau-de-bord" routerLinkActive="active-custom" class="nav-link">Tableau de bord</a>
 | 
			
		||||
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a>
 | 
			
		||||
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</a>
 | 
			
		||||
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">To-Do-List</a>
 | 
			
		||||
<a routerLink="../agenda" routerLinkActive="active-custom" class="nav-link">Agenda</a>
 | 
			
		||||
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a>
 | 
			
		||||
<a routerLink="../page-support" routerLinkActive="active-custom" class="nav-link">Nous contacter</a>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,10 +1,23 @@
 | 
			
		|||
.liens {
 | 
			
		||||
display: flex;
 | 
			
		||||
justify-content: center;
 | 
			
		||||
color : blue;
 | 
			
		||||
font-size: smaller;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a{
 | 
			
		||||
  color: rgb(54, 54, 54);
 | 
			
		||||
  font-size: smaller;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.footer {
 | 
			
		||||
    margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
    margin-top: 40px;
 | 
			
		||||
    margin-bottom: 0px;
 | 
			
		||||
    padding-top: 10px;
 | 
			
		||||
    padding-bottom: 10px;
 | 
			
		||||
    background-color: #f1f1f1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h3{
 | 
			
		||||
    color :rgb(54, 54, 54);
 | 
			
		||||
    font-size : 16px;
 | 
			
		||||
    font-weight: bold;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,18 +1,11 @@
 | 
			
		|||
<nav
 | 
			
		||||
  class="navbar sticky-top navbar-expand-lg navbar-light bg-light shadow py-0"
 | 
			
		||||
>
 | 
			
		||||
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top shadow">
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
 | 
			
		||||
      <div class="navbar-nav">
 | 
			
		||||
        <img
 | 
			
		||||
          id="img"
 | 
			
		||||
          routerLink="accueil"
 | 
			
		||||
          routerLinkActive="active-custom"
 | 
			
		||||
          src="../../../assets/images/logo-organizee.png"
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <a class="navbar-brand" href="#">Organizee</a>
 | 
			
		||||
    <a class="navbar-brand" routerLink="/accueil">
 | 
			
		||||
      <img id="img" src="../../../assets/images/logo-organizee.png" />
 | 
			
		||||
      Organizee
 | 
			
		||||
    </a>
 | 
			
		||||
  </div>
 | 
			
		||||
  <app-deconnexion *ngIf="isLogged"></app-deconnexion>
 | 
			
		||||
  <div id="navbarText">
 | 
			
		||||
    <app-deconnexion *ngIf="isLogged" ></app-deconnexion>
 | 
			
		||||
</div>
 | 
			
		||||
</nav>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,16 @@
 | 
			
		|||
#img {
 | 
			
		||||
  height:45px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar{
 | 
			
		||||
  height: auto;
 | 
			
		||||
  padding-left: 20px;
 | 
			
		||||
  padding-right: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-brand {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  margin-right: 70%;
 | 
			
		||||
  font-family: Arial, Helvetica, sans-serif;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  font-size: 3rem;
 | 
			
		||||
  font-size: 2rem;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -24,13 +31,6 @@ a:active {
 | 
			
		|||
  color: #5d5fef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-nav {
 | 
			
		||||
  height: 6rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#img {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  max-width: 5%;
 | 
			
		||||
  margin-left: 5%;
 | 
			
		||||
  margin-top: 10px;
 | 
			
		||||
.container-fluid{
 | 
			
		||||
  width:90%;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,12 @@
 | 
			
		|||
<div>
 | 
			
		||||
 | 
			
		||||
    <h2>Mon humeur :</h2>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
  <app-alert
 | 
			
		||||
  *ngIf="isShow"
 | 
			
		||||
  [alert]="alert"
 | 
			
		||||
  (eventClose)="onClickCloseAlert()"
 | 
			
		||||
></app-alert>
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			@ -19,4 +24,5 @@
 | 
			
		|||
    <div >
 | 
			
		||||
        
 | 
			
		||||
    
 | 
			
		||||
    </div> </div>
 | 
			
		||||
    </div> </div>
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			@ -6,6 +6,7 @@ p>img {
 | 
			
		|||
img {
 | 
			
		||||
	width: 50px;
 | 
			
		||||
	height: 50px;
 | 
			
		||||
	margin: 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.humeur {
 | 
			
		||||
| 
						 | 
				
			
			@ -13,6 +14,7 @@ display: inline;
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
div {
 | 
			
		||||
	background-color: #87AFC7;
 | 
			
		||||
width: 400px;
 | 
			
		||||
background-color:rgb(120, 121, 241);
 | 
			
		||||
text-align: center;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,6 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { MembreService } from 'src/app/services/membre.service';
 | 
			
		||||
import { TokenService } from 'src/app/services/token.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-humeur',
 | 
			
		||||
| 
						 | 
				
			
			@ -6,10 +8,10 @@ import { Component, OnInit } from '@angular/core';
 | 
			
		|||
  styleUrls: ['./humeur.component.scss']
 | 
			
		||||
})
 | 
			
		||||
export class HumeurComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  monHumeurLien! : string[];
 | 
			
		||||
 monHumeurTitle! : string[] ;
 | 
			
		||||
monHumeurLien! : string[];
 | 
			
		||||
monHumeurTitle! : string[] ;
 | 
			
		||||
isShow: boolean;
 | 
			
		||||
alert: any;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  tabHumeur= [
 | 
			
		||||
| 
						 | 
				
			
			@ -19,18 +21,48 @@ export class HumeurComponent implements OnInit {
 | 
			
		|||
      { title : "Je suis en colère", lien : "assets/images/emoticon-insulter.png"},
 | 
			
		||||
      { title : "Je suis en joie", lien : "assets/images/emoticon-feter.png"}  ]
 | 
			
		||||
 | 
			
		||||
  constructor() {    }
 | 
			
		||||
  constructor(private membreService: MembreService, private tokenService: TokenService) { 
 | 
			
		||||
    this.isShow= false;
 | 
			
		||||
    this.alert="";
 | 
			
		||||
    
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void { }
 | 
			
		||||
  ngOnInit(): void { 
 | 
			
		||||
    const userId = this.tokenService.getCurrentMembreId();
 | 
			
		||||
    this.membreService.getMembreId(userId).subscribe({
 | 
			
		||||
      next: result => {
 | 
			
		||||
    //this.monHumeurTitle= [this.tabHumeur[result.smiley].title];
 | 
			
		||||
    this.monHumeurLien= result.smiley;
 | 
			
		||||
     //  console.log("resultat smiley ", result.smiley);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
onChoixHumeur(numero: number){
 | 
			
		||||
onChoixHumeur(numero: any){
 | 
			
		||||
 this.monHumeurTitle= [this.tabHumeur[numero].title];
 | 
			
		||||
 this.monHumeurLien= [this.tabHumeur[numero].lien];
 | 
			
		||||
 | 
			
		||||
 this.membreService.updateHumeur(this.tabHumeur[numero].lien)?.subscribe(
 | 
			
		||||
  {
 | 
			
		||||
    next: result => {
 | 
			
		||||
      this.alert={"type":"success", "content":"L'humeur a bien été modifiée"};
 | 
			
		||||
      this.isShow = true;
 | 
			
		||||
    },
 | 
			
		||||
    error: err => {
 | 
			
		||||
      this.alert={"type":"danger", "content":"Problème lors de la modification de l'humeur"};
 | 
			
		||||
      this.isShow = true;
 | 
			
		||||
    },
 | 
			
		||||
    complete: () => console.log('DONE!')
 | 
			
		||||
  }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
console.log("humeur titre est : ", this.monHumeurTitle);
 | 
			
		||||
console.log("humeur lien est : ", this.monHumeurLien);
 | 
			
		||||
console.log("index humeur est : ", numero );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
console.log("index humeur est : ", numero);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
onClickCloseAlert(){
 | 
			
		||||
this.isShow=!this.isShow;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -5,7 +5,8 @@
 | 
			
		|||
  width: auto;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  //background-color: #c3c3e7;
 | 
			
		||||
  padding-left: 10px;
 | 
			
		||||
  padding-right: 10px;
 | 
			
		||||
}
 | 
			
		||||
.nav{
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
| 
						 | 
				
			
			@ -19,5 +20,9 @@ li {
 | 
			
		|||
 | 
			
		||||
a{
 | 
			
		||||
  color: black;
 | 
			
		||||
  background-color: white;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  padding: none;
 | 
			
		||||
  margin-bottom: 10px;
 | 
			
		||||
  border-radius: 15px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
.deleteTache {
 | 
			
		||||
  width: 75%;
 | 
			
		||||
  width: 10%;
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
  margin-left: 14px;
 | 
			
		||||
  &:hover {
 | 
			
		||||
| 
						 | 
				
			
			@ -77,7 +77,7 @@
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
.modifier-element {
 | 
			
		||||
  font-size: 24px;
 | 
			
		||||
  font-size: 18px;
 | 
			
		||||
  color: white;
 | 
			
		||||
  margin-left: 12px;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,6 @@ import { Router } from '@angular/router';
 | 
			
		|||
import { Tache } from 'src/app/models/tache';
 | 
			
		||||
import { ToDoList } from 'src/app/models/to-do-list';
 | 
			
		||||
import { TodoService } from 'src/app/services/todo.service';
 | 
			
		||||
import { TodoList } from 'src/app/todo-list';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-to-do-list',
 | 
			
		||||
| 
						 | 
				
			
			@ -13,7 +12,6 @@ import { TodoList } from 'src/app/todo-list';
 | 
			
		|||
export class ToDoListComponent implements OnInit {
 | 
			
		||||
  @Input() todo!: ToDoList;
 | 
			
		||||
  public beforeEditCache: string;
 | 
			
		||||
  //public todos: ToDoList[];
 | 
			
		||||
  public todoTitle: string;
 | 
			
		||||
  public idTodo: number;
 | 
			
		||||
  public filter: string;
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +22,6 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
 | 
			
		||||
  constructor(private TodoService: TodoService, private router: Router) {
 | 
			
		||||
    this.beforeEditCache = '';
 | 
			
		||||
    //this.todos = [];
 | 
			
		||||
    this.todoTitle = '';
 | 
			
		||||
    this.idTodo = 0;
 | 
			
		||||
    this.filter = '';
 | 
			
		||||
| 
						 | 
				
			
			@ -37,8 +34,10 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
    this.beforeEditCache = '';
 | 
			
		||||
    this.casesRestantes = true;
 | 
			
		||||
    this.filter = 'tous';
 | 
			
		||||
    this.idTodo = 4;
 | 
			
		||||
    this.todoTitle = '';
 | 
			
		||||
    if (this.toDoRest() === 0) {
 | 
			
		||||
      this.masterSelected = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  //supprimer la todoList en fonction de son id
 | 
			
		||||
  deleteTodo(id: number): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -51,12 +50,13 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
  //ajouter tache par l'id de son parent todoList
 | 
			
		||||
  addTache(idTodoList: number) {
 | 
			
		||||
    //idTodoList id que la todoList que l'on récupère
 | 
			
		||||
    console.log(idTodoList);
 | 
			
		||||
    //console.log(idTodoList);
 | 
			
		||||
    //permet de construire l'objet à passer en base
 | 
			
		||||
    const tache: Tache = {
 | 
			
		||||
      id: 0,
 | 
			
		||||
      texte: this.todoTitle,
 | 
			
		||||
      etat: false,
 | 
			
		||||
      editing: false,
 | 
			
		||||
      editing: false, //flag permettant de passer le texte en input pour update
 | 
			
		||||
    };
 | 
			
		||||
    console.log(this.tache);
 | 
			
		||||
    if (this.todoTitle != '') {
 | 
			
		||||
| 
						 | 
				
			
			@ -70,9 +70,19 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
 | 
			
		||||
  //modifier le titre de la to-do-list
 | 
			
		||||
  updateTodo(todoList: ToDoList): void {
 | 
			
		||||
    this.TodoService.updateTodo(todoList)?.subscribe((resp) => {
 | 
			
		||||
      window.location.reload();
 | 
			
		||||
    });
 | 
			
		||||
    let nouvelleTodolist = {
 | 
			
		||||
      id: todoList.id,
 | 
			
		||||
      nom: todoList.nom,
 | 
			
		||||
      team: todoList.team,
 | 
			
		||||
    };
 | 
			
		||||
    console.log(todoList.team);
 | 
			
		||||
    if (nouvelleTodolist.nom != '') {
 | 
			
		||||
      this.TodoService.updateTodo(nouvelleTodolist)?.subscribe((resp) => {
 | 
			
		||||
        window.location.reload();
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      window.alert('Il faut saisir du texte'); // sinon msg d'erreur}
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //modifier la tâche par l'input
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +91,7 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
    tache.editing = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // modifier une tâche validation de l'input
 | 
			
		||||
  // modifier une tâche validation de l'input + update check
 | 
			
		||||
  doneEdit(tache: Tache): void {
 | 
			
		||||
    if (tache.texte.trim().length === 0) {
 | 
			
		||||
      tache.texte = this.beforeEditCache;
 | 
			
		||||
| 
						 | 
				
			
			@ -94,12 +104,14 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // annuler la modification
 | 
			
		||||
  // annuler la modification de la tâche
 | 
			
		||||
  cancelEdit(tache: Tache): void {
 | 
			
		||||
    tache.texte = this.beforeEditCache;
 | 
			
		||||
    tache.editing = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  //supprimer la tache
 | 
			
		||||
  deleteTache(id: number) {
 | 
			
		||||
    this.TodoService.deleteTacheById(id).subscribe((resp) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -112,17 +124,20 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
    return this.todo.taches.filter((tache: Tache) => !tache.etat).length;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //Cocher toutes les tâches de la liste
 | 
			
		||||
  //Vérifie si toutes les tâches de la liste sont cochées
 | 
			
		||||
  listComplete(): boolean {
 | 
			
		||||
    return this.todo.taches.filter((tache: Tache) => tache).length > 0;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //cocher toutes les cases de la todoList
 | 
			
		||||
  //cocher/décoche les éléments à partir de la case checkAll
 | 
			
		||||
  cocherAllTodoList(): void {
 | 
			
		||||
    for (var i = 0; i < this.todo.taches.length; i++) {
 | 
			
		||||
      this.todo.taches[i].etat = this.masterSelected;
 | 
			
		||||
      this.TodoService.updateTache(this.todo.taches[i]).subscribe((resp) => {
 | 
			
		||||
        console.log(this.todo.taches[i]);
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    this.cocherAllTodoList();
 | 
			
		||||
    //this.cocherAllTodoList();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  casesQuiRestes(): boolean {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
import { Team } from "./team";
 | 
			
		||||
 | 
			
		||||
export interface Membre {
 | 
			
		||||
  id: string;
 | 
			
		||||
  nom: string;
 | 
			
		||||
| 
						 | 
				
			
			@ -7,6 +9,6 @@ export interface Membre {
 | 
			
		|||
  dateNaissance: Date;
 | 
			
		||||
  couleur: string;
 | 
			
		||||
  passwordConfirm: string;
 | 
			
		||||
 // smiley: string;
 | 
			
		||||
  roleList: string[];
 | 
			
		||||
  team?: Team;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,5 +6,7 @@ export interface Tache {
 | 
			
		|||
  id : number,
 | 
			
		||||
  texte: string,
 | 
			
		||||
  etat : boolean,
 | 
			
		||||
  editing : boolean
 | 
			
		||||
  editing : boolean// editing n'existe pas dans la BDD,
 | 
			
		||||
  //c'est juste un état dont on a besoin dans le front pour pouvoir transformer les tâches et
 | 
			
		||||
  // le titre des todo en input
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
export interface Team {
 | 
			
		||||
  id: string;
 | 
			
		||||
  nom : string;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,4 +5,5 @@ export interface ToDoList {
 | 
			
		|||
  nom: string;
 | 
			
		||||
  taches: Tache[];
 | 
			
		||||
  id: number;
 | 
			
		||||
  team? : Team;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,10 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#7879F1'"></app-side-bar>
 | 
			
		||||
<div class="container-fluid">
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col-9 offset-2" id="main">
 | 
			
		||||
      <h1 class="col-md-auto">{{ currentTeam.nom }}</h1>
 | 
			
		||||
      <div>
 | 
			
		||||
      <h2 class="col-md-auto titre">{{ currentTeam.nom }}</h2>
 | 
			
		||||
      <div class="contenu">
 | 
			
		||||
        <!-- Pour récupérer le membre connecté-->
 | 
			
		||||
        <div class="d-flex justify-content-center">
 | 
			
		||||
          <app-card-member [membre]="currentUser"> </app-card-member>
 | 
			
		||||
| 
						 | 
				
			
			@ -16,6 +16,7 @@
 | 
			
		|||
            class="btn btn-primary btn-lg"
 | 
			
		||||
            routerLink="../ajout-membre"
 | 
			
		||||
            routerLinkActive="active-custom"
 | 
			
		||||
            [hidden]="parent == false"
 | 
			
		||||
          >
 | 
			
		||||
            Ajouter un membre
 | 
			
		||||
          </button>
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +24,7 @@
 | 
			
		|||
      </div>
 | 
			
		||||
      <div class="row">
 | 
			
		||||
        <!-- Pour exclure le membre connecté de la liste car il est récupéré plus haut-->
 | 
			
		||||
        <!-- ng-container pour gérer l'espace vide que laissé le membre exclu à cause du dom -->
 | 
			
		||||
        <!-- ng-container pour gérer l'espace vide que laisse le membre exclu à cause du dom -->
 | 
			
		||||
        <!-- cf. : https://angular.io/guide/built-in-directives#hosting-a-directive-without-a-dom-element-->
 | 
			
		||||
        <ng-container *ngFor="let membreData of listMembres">
 | 
			
		||||
          <!-- Condition dans ngIf mais une div à la place du ng-container pour le style-->
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,14 @@ button{
 | 
			
		|||
  margin-bottom: 5px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.titre{
 | 
			
		||||
  display: inline-flex;
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main{
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +20,7 @@ ng-container{
 | 
			
		|||
 | 
			
		||||
#bouton-ajout {
 | 
			
		||||
  margin-top: 5px;
 | 
			
		||||
  margin-bottom: 20px;
 | 
			
		||||
  border: 1px solid #7879F1 !important;
 | 
			
		||||
  background-color: #7879F1;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,4 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { MembreService } from 'src/app/services/membre.service';
 | 
			
		||||
import { TeamService } from 'src/app/services/team.service';
 | 
			
		||||
import { TokenService } from 'src/app/services/token.service';
 | 
			
		||||
| 
						 | 
				
			
			@ -15,12 +14,13 @@ export class PageAccountComponent implements OnInit {
 | 
			
		|||
  public listMembres: any[];
 | 
			
		||||
  currentUser: any;
 | 
			
		||||
  currentTeam: any;
 | 
			
		||||
  parent: boolean;
 | 
			
		||||
 | 
			
		||||
  constructor(private membreService: MembreService,
 | 
			
		||||
    private teamService: TeamService,
 | 
			
		||||
    private tokenService: TokenService,
 | 
			
		||||
    private router: Router) {
 | 
			
		||||
    private tokenService: TokenService) {
 | 
			
		||||
    this.listMembres = [];
 | 
			
		||||
    this.parent = false;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -36,5 +36,16 @@ export class PageAccountComponent implements OnInit {
 | 
			
		|||
    this.membreService.getMembresByTeamId()?.subscribe((membres: any[]) => {
 | 
			
		||||
      this.listMembres = membres;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    /** 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)**/
 | 
			
		||||
    const userRole = this.tokenService.getRole();
 | 
			
		||||
    if(userRole == "ROLE_PARENT"){
 | 
			
		||||
      this.parent = true;
 | 
			
		||||
    }
 | 
			
		||||
    else if(userRole== "ROLE_ENFANT"){
 | 
			
		||||
      this.parent = false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,11 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top shadow">
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
    <a class="navbar-brand" routerLink="/accueil">
 | 
			
		||||
      <img id="img" src="../../../assets/images/logo-organizee.png" />
 | 
			
		||||
      Organizee
 | 
			
		||||
    </a>
 | 
			
		||||
  </div>
 | 
			
		||||
</nav>
 | 
			
		||||
<body>
 | 
			
		||||
  <div class="container">
 | 
			
		||||
<div class="bienvenue">
 | 
			
		||||
| 
						 | 
				
			
			@ -16,9 +23,9 @@ lu, nous sommes là pour vous aider !</p>
 | 
			
		|||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="pub">
 | 
			
		||||
  <img src="../../../assets/images/menu.png" />
 | 
			
		||||
  <img src="../../../assets/images/repertoire.png" />
 | 
			
		||||
  <img src="../../../assets/images/todo.png" />
 | 
			
		||||
  <img class="imgAcc" src="../../../assets/images/menu.png" />
 | 
			
		||||
  <img class="imgAcc" src="../../../assets/images/repertoire.png" />
 | 
			
		||||
  <img class="imgAcc" src="../../../assets/images/todo.png" />
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,43 @@
 | 
			
		|||
/** Header accueil **/
 | 
			
		||||
 | 
			
		||||
#img {
 | 
			
		||||
  height:45px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar{
 | 
			
		||||
  height: auto;
 | 
			
		||||
  padding-left: 20px;
 | 
			
		||||
  padding-right: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-brand {
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  font-size: 2rem;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a:visited {
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a:focus {
 | 
			
		||||
  border-bottom: 1px solid;
 | 
			
		||||
  background: #a5a6f6;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a:hover {
 | 
			
		||||
  color: #7879f1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a:active {
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.container-fluid{
 | 
			
		||||
  width:90%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Contenu de la page **/
 | 
			
		||||
.container {
 | 
			
		||||
  display: flex;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +80,7 @@ p {
 | 
			
		|||
  justify-content: space-between;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
img {
 | 
			
		||||
.imgAcc {
 | 
			
		||||
  border: 1px solid #d3d3d3;
 | 
			
		||||
  border-radius: 10px;
 | 
			
		||||
  box-shadow: 6px 6px #d3d3d3;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#7879F1'"></app-side-bar>
 | 
			
		||||
<div class="container-fluid">
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col-9 offset-2" id="main">
 | 
			
		||||
| 
						 | 
				
			
			@ -161,3 +161,4 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
}
 | 
			
		||||
 h1{
 | 
			
		||||
   color: rgba(0, 0, 0, 0.658);
 | 
			
		||||
   font-size: 34px;
 | 
			
		||||
   font-size: 28px;
 | 
			
		||||
   margin-top: 20px;
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -89,11 +89,13 @@ export class PageAddMemberComponent implements OnInit {
 | 
			
		|||
 | 
			
		||||
    const mail: Mail = {
 | 
			
		||||
      recipient: emailValue,
 | 
			
		||||
      subject: "Votre mot de passe Organizee",
 | 
			
		||||
      //message: 'Votre mot de passe'
 | 
			
		||||
      subject: "Votre mot de passe provisoire Organizee",
 | 
			
		||||
      message: `Bonjour ${firstNameValue}!\n Voici vos identifiants de connexion : \n
 | 
			
		||||
      Identifiant : ${emailValue}
 | 
			
		||||
      Mot de passe : ${passwordValue}`
 | 
			
		||||
      Mot de passe provisoire : ${passwordValue}
 | 
			
		||||
      Veuillez modifier votre mot de passe dès la première connexion :
 | 
			
		||||
      http://localhost:4200/password-oublie
 | 
			
		||||
      `
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +1,3 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
 | 
			
		||||
<app-alert
 | 
			
		||||
  *ngIf="isShow"
 | 
			
		||||
  [alert]="alert"
 | 
			
		||||
  (eventClose)="onClickCloseAlert()"
 | 
			
		||||
></app-alert>
 | 
			
		||||
 | 
			
		||||
<!-- <div
 | 
			
		||||
  class="alert alert-{{ alert.type }}"
 | 
			
		||||
  role="alert"
 | 
			
		||||
| 
						 | 
				
			
			@ -25,13 +16,16 @@
 | 
			
		|||
    <span aria-hidden="true">×</span>
 | 
			
		||||
  </button>
 | 
			
		||||
</div> -->
 | 
			
		||||
 | 
			
		||||
<app-header></app-header>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#F178B6'"></app-side-bar>
 | 
			
		||||
<h2 class="titre">Agenda</h2>
 | 
			
		||||
<app-alert
 | 
			
		||||
  *ngIf="isShow"
 | 
			
		||||
  [alert]="alert"
 | 
			
		||||
  (eventClose)="onClickCloseAlert()"
 | 
			
		||||
></app-alert>
 | 
			
		||||
<div style="display: flex">
 | 
			
		||||
  <div style="width: 150px">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div style="width: 100%">
 | 
			
		||||
  <div style="width: 100%" id="daypilot">
 | 
			
		||||
    <div class="wrap">
 | 
			
		||||
      <div class="left">
 | 
			
		||||
        <daypilot-navigator
 | 
			
		||||
| 
						 | 
				
			
			@ -90,3 +84,4 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,18 @@
 | 
			
		|||
.titre{
 | 
			
		||||
  color : rgb(241,120,182);
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
  margin-left: 240px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
.wrap {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  margin: 10px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#daypilot{
 | 
			
		||||
  margin-left: 180px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.left {
 | 
			
		||||
  margin-right: 10px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -41,3 +51,10 @@
 | 
			
		|||
.fullscreen {
 | 
			
		||||
  position: absolute; top:90px; left: 0px; right: 0px; bottom: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn {
 | 
			
		||||
  background-color: rgb(241,120,182);
 | 
			
		||||
  color : white;
 | 
			
		||||
  border-radius: 12px;
 | 
			
		||||
  border-color: white;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar class="sidebarMenu"></app-side-bar>
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#F178B6'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col-md-4 offset-md-4 text-center">
 | 
			
		||||
    <h2>Ajouter un évènement à l'agenda</h2>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,40 +0,0 @@
 | 
			
		|||
<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>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,41 +0,0 @@
 | 
			
		|||
.team-form{
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
  align-content: center;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
button{
 | 
			
		||||
  margin-top: 10px;
 | 
			
		||||
}
 | 
			
		||||
.login-form {
 | 
			
		||||
  height: 100vh;
 | 
			
		||||
  padding-top: 40px;
 | 
			
		||||
  background-color: #f5f5f5;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.form-team {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  max-width: 500px;
 | 
			
		||||
  padding: 15px;
 | 
			
		||||
  margin: auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.form-team .checkbox {
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.form-team .form-floating:focus-within {
 | 
			
		||||
  z-index: 2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.form-team input[type="email"] {
 | 
			
		||||
  margin-bottom: -1px;
 | 
			
		||||
  border-bottom-right-radius: 0;
 | 
			
		||||
  border-bottom-left-radius: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.form-team input[type="password"] {
 | 
			
		||||
  margin-bottom: 10px;
 | 
			
		||||
  border-top-left-radius: 0;
 | 
			
		||||
  border-top-right-radius: 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,25 +0,0 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { PageCreationTeamComponent } from './page-creation-team.component';
 | 
			
		||||
 | 
			
		||||
describe('PageCreationTeamComponent', () => {
 | 
			
		||||
  let component: PageCreationTeamComponent;
 | 
			
		||||
  let fixture: ComponentFixture<PageCreationTeamComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ PageCreationTeamComponent ]
 | 
			
		||||
    })
 | 
			
		||||
    .compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(PageCreationTeamComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -1,71 +0,0 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import {
 | 
			
		||||
  FormBuilder,
 | 
			
		||||
  FormControl,
 | 
			
		||||
  FormGroup,
 | 
			
		||||
  Validators,
 | 
			
		||||
} 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({
 | 
			
		||||
  selector: 'app-page-creation-team',
 | 
			
		||||
  templateUrl: './page-creation-team.component.html',
 | 
			
		||||
  styleUrls: ['./page-creation-team.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class PageCreationTeamComponent implements OnInit {
 | 
			
		||||
  public teamForm: FormGroup;
 | 
			
		||||
  constructor(
 | 
			
		||||
    private teamService: TeamService,
 | 
			
		||||
    private membreService: MembreService,
 | 
			
		||||
    private router: Router,
 | 
			
		||||
    private fb: FormBuilder
 | 
			
		||||
  ) {
 | 
			
		||||
    this.teamForm = new FormGroup({});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    // *********************************penser a changer group car déprécié********************************
 | 
			
		||||
    this.teamForm = new FormGroup({
 | 
			
		||||
      nameFc : new FormControl('', [Validators.required])
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public onSubmit(): void {
 | 
			
		||||
    console.log('value : ', this.teamForm.value);
 | 
			
		||||
    console.log('form : ', this.teamForm);
 | 
			
		||||
    const nameValue = this.teamForm.value['nameFc'];
 | 
			
		||||
 | 
			
		||||
    const team: Team = {
 | 
			
		||||
      nom : nameValue,
 | 
			
		||||
    };
 | 
			
		||||
    if (team.nom !== '' ) {
 | 
			
		||||
      this.teamService.addTeam(team).subscribe((resp) => {
 | 
			
		||||
        this.router.navigate(['compte']);
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      // affichage erreur
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1,11 +1,10 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
 | 
			
		||||
<app-side-bar [backgroundColor]="'#7879F1'"></app-side-bar>
 | 
			
		||||
<div class="container">
 | 
			
		||||
  <div class="row p-1 col-12 ">
 | 
			
		||||
 | 
			
		||||
    <h2 class="titre">Dashboard</h2>
 | 
			
		||||
    <div class="row ">
 | 
			
		||||
      <h3 class="titre">Bienvenue {{ conectedUser.prenom }}!!</h3>
 | 
			
		||||
      <h3 >Bienvenue {{ conectedUser.prenom }} !</h3>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="row col-12">
 | 
			
		||||
| 
						 | 
				
			
			@ -14,7 +13,7 @@
 | 
			
		|||
        <div class="d-flex justify-content-center w-100 my-2" id="boxThree">
 | 
			
		||||
          <app-meteo></app-meteo>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="d-flex justify-content-center w-100 my-2"> 
 | 
			
		||||
        <div class="d-flex justify-content-center w-100 my-2">
 | 
			
		||||
          <app-humeur></app-humeur>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,15 @@
 | 
			
		|||
  display: inline-flex;
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h3{
 | 
			
		||||
  display: inline-flex;
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  font-size: 25px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.meteo {
 | 
			
		||||
| 
						 | 
				
			
			@ -11,9 +19,10 @@
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
.container {
 | 
			
		||||
margin-left:200px;
 | 
			
		||||
  margin-left:200px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.avatar{
 | 
			
		||||
  margin:O;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,10 +2,33 @@
 | 
			
		|||
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#7879F1'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col compte text-center">
 | 
			
		||||
    <h1>Supprimer ce membre</h1>
 | 
			
		||||
    <main class="contenu-compte"></main>
 | 
			
		||||
  <div class="col text-center">
 | 
			
		||||
    <main class="contenu">
 | 
			
		||||
      <p class="d-flex justify-content-center">Êtes-vous sur de vouloir Supprimer ce compte ?</p>
 | 
			
		||||
      <div class="d-flex justify-content-center">
 | 
			
		||||
        <button
 | 
			
		||||
            id = "bouton-ajout"
 | 
			
		||||
            type="button"
 | 
			
		||||
            class="btn btn-primary btn-lg bouton-non"
 | 
			
		||||
            routerLink="/compte"
 | 
			
		||||
            routerLinkActive="active-custom"
 | 
			
		||||
            [hidden]="parent == false"
 | 
			
		||||
          >Non, je ne souhaite pas supprimer ce compte
 | 
			
		||||
        </button>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="d-flex justify-content-center">
 | 
			
		||||
        <button
 | 
			
		||||
            id = "bouton-ajout"
 | 
			
		||||
            type="button"
 | 
			
		||||
            class="btn btn-primary btn-lg bouton-oui"
 | 
			
		||||
            (click)="onClickDelete()"
 | 
			
		||||
            [hidden]="parent == false"
 | 
			
		||||
          >Oui, je souhaite supprimer ce compte
 | 
			
		||||
        </button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </main>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
.contenu{
 | 
			
		||||
  padding-top: 100px;
 | 
			
		||||
  padding-bottom: 100px;
 | 
			
		||||
}
 | 
			
		||||
p{
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
button{
 | 
			
		||||
  margin-top: 10px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bouton-non {
 | 
			
		||||
  margin-top: 5px;
 | 
			
		||||
  margin-right: 5px;
 | 
			
		||||
  border: 1px solid #7879F1 !important;
 | 
			
		||||
  background-color: #7879F1;
 | 
			
		||||
  height: 40px;
 | 
			
		||||
  width: 450px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bouton-non:hover {
 | 
			
		||||
  margin-top: 5px;
 | 
			
		||||
  margin-right: 5px;
 | 
			
		||||
  border: 1px solid #68d182 !important;
 | 
			
		||||
  background-color: #68d182;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  height: 40px;
 | 
			
		||||
  width: 450px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bouton-oui {
 | 
			
		||||
  margin-top: 5px;
 | 
			
		||||
  border: 1px solid #7879F1 !important;
 | 
			
		||||
  background-color: #7879F1;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  height: 40px;
 | 
			
		||||
  width: 450px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bouton-oui:hover {
 | 
			
		||||
  margin-top: 5px;
 | 
			
		||||
  border: 1px solid #bd4646 !important;
 | 
			
		||||
  background-color: #bd4646;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  height: 40px;
 | 
			
		||||
  width: 450px;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,7 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { Component,OnInit} from '@angular/core';
 | 
			
		||||
import { ActivatedRoute, Router } from '@angular/router';
 | 
			
		||||
import { MembreService } from 'src/app/services/membre.service';
 | 
			
		||||
import { TokenService } from 'src/app/services/token.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-page-delete-member',
 | 
			
		||||
| 
						 | 
				
			
			@ -6,10 +9,47 @@ import { Component, OnInit } from '@angular/core';
 | 
			
		|||
  styleUrls: ['./page-delete-member.component.scss']
 | 
			
		||||
})
 | 
			
		||||
export class PageDeleteMemberComponent implements OnInit {
 | 
			
		||||
  public membreId: any;
 | 
			
		||||
  public membreInfos: any;
 | 
			
		||||
  parent: boolean;
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
  constructor(private membreService: MembreService,
 | 
			
		||||
    private tokenService: TokenService,
 | 
			
		||||
    private router: Router,
 | 
			
		||||
    private route: ActivatedRoute) {
 | 
			
		||||
      this.membreInfos = '';
 | 
			
		||||
      this.parent = false;
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    /** Pour récuperer l'id du membre à modifier **/
 | 
			
		||||
    this.membreId = this.route.snapshot.paramMap.get('id');
 | 
			
		||||
 | 
			
		||||
     /** Appel Api **/
 | 
			
		||||
     this.membreService
 | 
			
		||||
     .getMembreId(this.membreId)
 | 
			
		||||
     .subscribe((membreInfos: any) => {
 | 
			
		||||
       this.membreInfos = membreInfos;
 | 
			
		||||
     });
 | 
			
		||||
 | 
			
		||||
     /** 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)**/
 | 
			
		||||
    const userRole = this.tokenService.getRole();
 | 
			
		||||
    if(userRole == "ROLE_PARENT"){
 | 
			
		||||
      this.parent = true;
 | 
			
		||||
    }
 | 
			
		||||
    else if(userRole== "ROLE_ENFANT"){
 | 
			
		||||
      this.parent = false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /********************** Suppresion d'un membre au click ********************/
 | 
			
		||||
  onClickDelete(): void {
 | 
			
		||||
    console.log("coucou");
 | 
			
		||||
    this.membreService.deleteMembre(this.membreInfos).subscribe((resp) => {
 | 
			
		||||
      this.router.navigate(['compte']);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,8 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
 | 
			
		||||
<app-side-bar [backgroundColor]="'#F7C02B'"></app-side-bar>
 | 
			
		||||
<h2 class="titre">Menu de la semaine</h2>
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar class="sidebarMenu"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col menu text-center">
 | 
			
		||||
    <h2>Menu de la semaine</h2>
 | 
			
		||||
    <main class="contenu-menu">
 | 
			
		||||
      <app-card-menu></app-card-menu>
 | 
			
		||||
    </main>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1,6 @@
 | 
			
		|||
 | 
			
		||||
.titre{
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
  margin-left: 240px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#c3c3e7'"></app-side-bar>
 | 
			
		||||
<div>
 | 
			
		||||
 | 
			
		||||
  <div class="ctn-link min-vh-100">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,11 +4,11 @@
 | 
			
		|||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#5a1e63'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <h2 class="titre">Répertoire</h2>
 | 
			
		||||
  <div class="col compte text-center py-3">
 | 
			
		||||
    <div>
 | 
			
		||||
      <button
 | 
			
		||||
        *ngIf="parent" 
 | 
			
		||||
        *ngIf="parent"
 | 
			
		||||
        routerLink="/ajouter-contact"
 | 
			
		||||
        class="btn btn-sm btn-rounded btn-secondary m-3"
 | 
			
		||||
      >
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,11 @@
 | 
			
		|||
.titre{
 | 
			
		||||
  display: inline-flex;
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
  margin-left: 240px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
.btn-secondary {
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  background-color: #5a1e63 !important;
 | 
			
		||||
| 
						 | 
				
			
			@ -35,4 +43,4 @@
 | 
			
		|||
 | 
			
		||||
.pointer{
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,9 @@ import {
 | 
			
		|||
  FormGroup,
 | 
			
		||||
  Validators,
 | 
			
		||||
} from '@angular/forms';
 | 
			
		||||
import { Router, RouterLink } from '@angular/router';
 | 
			
		||||
import { Router} from '@angular/router';
 | 
			
		||||
import { Team } from 'src/app/models/team';
 | 
			
		||||
import { TeamService } from 'src/app/services/team.service';
 | 
			
		||||
import { Membre } from '../../models/membre';
 | 
			
		||||
import { AuthService } from '../../services/auth.service';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,6 +21,7 @@ export class PageSignupComponent implements OnInit {
 | 
			
		|||
 | 
			
		||||
  constructor(
 | 
			
		||||
    private authService: AuthService,
 | 
			
		||||
    private teamService: TeamService,
 | 
			
		||||
    private router: Router,
 | 
			
		||||
    private fb: FormBuilder
 | 
			
		||||
  ) {
 | 
			
		||||
| 
						 | 
				
			
			@ -29,6 +32,7 @@ export class PageSignupComponent implements OnInit {
 | 
			
		|||
    // *********************************pensser a changer group car déprécié********************************
 | 
			
		||||
    this.signupForm = this.fb.group(
 | 
			
		||||
      {
 | 
			
		||||
        teamNameFc: new FormControl('', [Validators.required]),
 | 
			
		||||
        firstNameFc: new FormControl('', [Validators.required]),
 | 
			
		||||
        lastNameFc: new FormControl('', [Validators.required]),
 | 
			
		||||
        dateNaissanceFc: new FormControl('', [Validators.required]),
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +59,7 @@ export class PageSignupComponent implements OnInit {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  public onSubmit(): void {
 | 
			
		||||
    const teamNameValue = this.signupForm.value['teamNameFc'];
 | 
			
		||||
    const idValue = this.signupForm.value[''];
 | 
			
		||||
    const prenomValue = this.signupForm.value['firstNameFc'];
 | 
			
		||||
    const nomValue = this.signupForm.value['lastNameFc'];
 | 
			
		||||
| 
						 | 
				
			
			@ -65,21 +70,35 @@ export class PageSignupComponent implements OnInit {
 | 
			
		|||
    const couleurValue = this.signupForm.value['couleurFc'];
 | 
			
		||||
    const roleValue = ['ROLE_PARENT'];
 | 
			
		||||
 | 
			
		||||
    const membre: Membre = {
 | 
			
		||||
      id: idValue,
 | 
			
		||||
      nom: nomValue,
 | 
			
		||||
      prenom: prenomValue,
 | 
			
		||||
      email: emailValue,
 | 
			
		||||
      password: passwordValue,
 | 
			
		||||
      couleur: couleurValue,
 | 
			
		||||
      dateNaissance: dateNaissanceValue,
 | 
			
		||||
      passwordConfirm: passwordConfirmValue,
 | 
			
		||||
      roleList: roleValue,
 | 
			
		||||
    const team: Team = {
 | 
			
		||||
      id : "",
 | 
			
		||||
      nom : teamNameValue,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    if (membre.email !== '' && membre.password !== '') {
 | 
			
		||||
      this.authService.signup(membre).subscribe((resp) => {
 | 
			
		||||
        this.router.navigate(['accueil']);
 | 
			
		||||
    if (emailValue !== '' && passwordValue !== '' && team.nom!== '') {
 | 
			
		||||
        //création Team
 | 
			
		||||
      this.teamService.addTeam(team).subscribe((respTeam) => {
 | 
			
		||||
        //récupération de l'id auto-généré (respTeam.id) dans l'id team (team.id)
 | 
			
		||||
        team.id = respTeam.id;
 | 
			
		||||
         //création objet membre avec l'objet team crée
 | 
			
		||||
        const membre: Membre = {
 | 
			
		||||
          id: idValue,
 | 
			
		||||
          nom: nomValue,
 | 
			
		||||
          prenom: prenomValue,
 | 
			
		||||
          email: emailValue,
 | 
			
		||||
          password: passwordValue,
 | 
			
		||||
          couleur: couleurValue,
 | 
			
		||||
          dateNaissance: dateNaissanceValue,
 | 
			
		||||
          passwordConfirm: passwordConfirmValue,
 | 
			
		||||
          team: team,
 | 
			
		||||
          roleList: roleValue,
 | 
			
		||||
        };
 | 
			
		||||
        //création du membre en bdd avec l'objet membre
 | 
			
		||||
        this.authService.signup(membre).subscribe((respMembre) => {
 | 
			
		||||
          this.router.navigate(['accueil']);
 | 
			
		||||
          return respMembre
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      // affichage erreur
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,4 +28,5 @@
 | 
			
		|||
            <button type="button" class="btn btn-danger">Effacer</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,10 +1,8 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#4E9E7B'"></app-side-bar>
 | 
			
		||||
<h2 class="titre">To-Do-List</h2>
 | 
			
		||||
<div class="row ">
 | 
			
		||||
  <div class="col menu text-center">
 | 
			
		||||
    <h2>To-Do-List</h2>
 | 
			
		||||
    <div class="d-flex align-items-stretch"></div>
 | 
			
		||||
    <input
 | 
			
		||||
      type="text"
 | 
			
		||||
| 
						 | 
				
			
			@ -13,7 +11,6 @@
 | 
			
		|||
      [(ngModel)]="todoListTitle"
 | 
			
		||||
      (keyup.enter)="addTodoByTeamId()"
 | 
			
		||||
    />
 | 
			
		||||
 | 
			
		||||
    <div class="d-flex align-items-stretch">
 | 
			
		||||
      <div class="custom-main container p-3">
 | 
			
		||||
        <div class="row">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,20 @@
 | 
			
		|||
.titre{
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
  font-size: 30px;
 | 
			
		||||
  margin-left: 240px;
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn {
 | 
			
		||||
  margin-top: 1%;
 | 
			
		||||
  margin-bottom: 1%;
 | 
			
		||||
  color: black;
 | 
			
		||||
  box-shadow: 5px 5px 5px gray;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.row{
 | 
			
		||||
  margin-left: 20px;
 | 
			
		||||
  justify-content: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { ToDoList } from 'src/app/models/to-do-list';
 | 
			
		||||
import { TodoService } from 'src/app/services/todo.service';
 | 
			
		||||
import { Team } from 'src/app/models/team';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-page-to-do-list',
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ export class PageToDoListComponent implements OnInit {
 | 
			
		|||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //Ajouter une todo List si l'input n'est pas vide
 | 
			
		||||
  //Ajouter une todo List si l'input contient un texte
 | 
			
		||||
  addTodoByTeamId() {
 | 
			
		||||
    const todoList: ToDoList = {
 | 
			
		||||
      nom: this.todoListTitle,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<app-side-bar></app-side-bar>
 | 
			
		||||
<app-side-bar [backgroundColor]="'#7879F1'"></app-side-bar>
 | 
			
		||||
<div class="container-fluid">
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col-9 offset-2" id="main">
 | 
			
		||||
| 
						 | 
				
			
			@ -80,8 +80,7 @@
 | 
			
		|||
              placeholder=""
 | 
			
		||||
              name="Role"
 | 
			
		||||
              formControlName="roleFc"
 | 
			
		||||
              value="{{membreInfos.roleList}}"
 | 
			
		||||
              [(ngModel)]="membreInfos.roleList"
 | 
			
		||||
              value=""
 | 
			
		||||
            >
 | 
			
		||||
              <option value="ROLE_PARENT">Adulte</option>
 | 
			
		||||
              <option value="ROLE_ENFANT">Enfant</option>
 | 
			
		||||
| 
						 | 
				
			
			@ -110,3 +109,4 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,7 @@ export class PageUpdateMemberComponent implements OnInit {
 | 
			
		|||
    this.updateMembreForm = new FormGroup({});
 | 
			
		||||
    this.membreData = this.initForm();
 | 
			
		||||
    this.membreInfos = '';
 | 
			
		||||
   }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    /** Pour récuperer l'id du membre à modifier **/
 | 
			
		||||
| 
						 | 
				
			
			@ -100,10 +100,8 @@ export class PageUpdateMemberComponent implements OnInit {
 | 
			
		|||
      roleList: [roleValue]
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    console.log(membre);
 | 
			
		||||
 | 
			
		||||
    this.membreService.updateMembre(membre)?.subscribe((resp) => {
 | 
			
		||||
      //this.router.navigate(['compte']);
 | 
			
		||||
      this.router.navigate(['compte']);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,9 +22,7 @@ export class AuthService {
 | 
			
		|||
  //methode pour s'inscrire - on passe l'objet en entier
 | 
			
		||||
  signup(membre: Membre): Observable<any> {
 | 
			
		||||
    console.log(membre);
 | 
			
		||||
 | 
			
		||||
    return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
//methode pour se connecter - on passe id et pwd
 | 
			
		||||
| 
						 | 
				
			
			@ -60,8 +58,6 @@ export class AuthService {
 | 
			
		|||
    return this.http.post(`${this.apiUrl}/teams/add`, team);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  addMember(membre: Membre): Observable<any> {
 | 
			
		||||
    console.log(membre);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,8 +45,8 @@ export class MembreService {
 | 
			
		|||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  deleteMembre(membre: Membre): Observable<any> {
 | 
			
		||||
    return this.http.delete(`${this.apiUrl}/membres/delete/1`);
 | 
			
		||||
  deleteMembre(membre: Membre): Observable<any>{
 | 
			
		||||
    return this.http.delete(`${this.apiUrl}/membres/delete/${membre.id}`, {responseType: "text"});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateMembre(membre: Membre): Observable<any> | void {
 | 
			
		||||
| 
						 | 
				
			
			@ -57,4 +57,16 @@ export class MembreService {
 | 
			
		|||
      this.router.navigate(['accueil']);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
updateHumeur(numero : any) : Observable<any> | void {
 | 
			
		||||
  const userId = this.tokenService.getCurrentMembreId();
 | 
			
		||||
  if (userId){
 | 
			
		||||
  return this.http.put(`${this.apiUrl}/membres/update/smiley/${userId}`, numero);
 | 
			
		||||
}else {
 | 
			
		||||
    this.router.navigate(['accueil']);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,8 +32,6 @@ export class TeamService {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  addTeam(team: Team): Observable<any> {
 | 
			
		||||
    console.log(team);
 | 
			
		||||
 | 
			
		||||
    return this.http.post(`${this.apiUrl}/teams/add`, team);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,8 @@ export const environment = {
 | 
			
		|||
  production: false,
 | 
			
		||||
  apiUrl: 'http://localhost:8088',
 | 
			
		||||
  tokenKey: 'TOKEN-ORGANIZEE',
 | 
			
		||||
  debug: true,
 | 
			
		||||
  // pour afficher des infos en mode debug
 | 
			
		||||
  debug: false,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue