Merge branch 'dev' of https://github.com/AlineRinquin/organizee-front into sana
This commit is contained in:
		
						commit
						2dd153198e
					
				
					 31 changed files with 252 additions and 213 deletions
				
			
		| 
						 | 
				
			
			@ -23,7 +23,6 @@ import { MeteoComponent } from './components/meteo/meteo.component';
 | 
			
		|||
import { CalendrierComponent } from './components/calendrier/calendrier.component';
 | 
			
		||||
import { CardMemberComponent } from './components/card-member/card-member.component';
 | 
			
		||||
import { ToDoListComponent } from './components/to-do-list/to-do-list.component';
 | 
			
		||||
import { TacheComponent } from './components/tache/tache.component';
 | 
			
		||||
import { CardMenuComponent } from './components/card-menu/card-menu.component';
 | 
			
		||||
import { FicheContactComponent } from './components/fiche-contact/fiche-contact.component';
 | 
			
		||||
import { CreneauComponent } from './components/creneau/creneau.component';
 | 
			
		||||
| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +67,6 @@ registerLocaleData(localeFr)
 | 
			
		|||
    CalendrierComponent,
 | 
			
		||||
    CardMemberComponent,
 | 
			
		||||
    ToDoListComponent,
 | 
			
		||||
    TacheComponent,
 | 
			
		||||
    CardMenuComponent,
 | 
			
		||||
    FicheContactComponent,
 | 
			
		||||
    CreneauComponent,
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +77,8 @@ registerLocaleData(localeFr)
 | 
			
		|||
    DeconnexionComponent,
 | 
			
		||||
    HumeurComponent,
 | 
			
		||||
    AlertComponent,
 | 
			
		||||
    PageAjoutEvenementsComponent
 | 
			
		||||
    PageAjoutEvenementsComponent, 
 | 
			
		||||
    PageSupportComponent
 | 
			
		||||
  ],
 | 
			
		||||
  imports: [
 | 
			
		||||
    BrowserModule,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,7 @@ export class FicheContactComponent implements OnInit {
 | 
			
		|||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // supprime le contact
 | 
			
		||||
  onClickDelete(numPerson: number){
 | 
			
		||||
    window.alert("Le contact à bien été supprimé!")
 | 
			
		||||
    this.clickDelete.emit(numPerson);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,5 +8,6 @@
 | 
			
		|||
<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>
 | 
			
		||||
| 
						 | 
				
			
			@ -7,4 +7,9 @@ font-size: smaller;
 | 
			
		|||
 | 
			
		||||
.footer {
 | 
			
		||||
    margin-top: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h3{
 | 
			
		||||
    color : blue;
 | 
			
		||||
    font-size : 16px;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,18 +1,19 @@
 | 
			
		|||
<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>
 | 
			
		||||
    <a class="navbar-brand" routerLink="/accueil">
 | 
			
		||||
      <img id="img" src="../../../assets/images/logo-organizee.png" />
 | 
			
		||||
      Organizee
 | 
			
		||||
    </a>
 | 
			
		||||
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
 | 
			
		||||
      <span class="navbar-toggler-icon"></span>
 | 
			
		||||
    </button>
 | 
			
		||||
    <div class="collapse navbar-collapse" id="navbarText">
 | 
			
		||||
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
 | 
			
		||||
        <li class="nav-item"></li>
 | 
			
		||||
      </ul>
 | 
			
		||||
      <span class="navbar-text">
 | 
			
		||||
        <app-deconnexion *ngIf="isLogged"></app-deconnexion>
 | 
			
		||||
      </span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <a class="navbar-brand" href="#">Organizee</a>
 | 
			
		||||
  </div>
 | 
			
		||||
  <app-deconnexion *ngIf="isLogged"></app-deconnexion>
 | 
			
		||||
</nav>
 | 
			
		||||
</nav>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +1,8 @@
 | 
			
		|||
#img {
 | 
			
		||||
  height:95px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-brand {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  margin-right: 70%;
 | 
			
		||||
  font-family: Arial, Helvetica, sans-serif;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  font-size: 3rem;
 | 
			
		||||
  color: #5d5fef;
 | 
			
		||||
| 
						 | 
				
			
			@ -24,13 +25,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: #87AFC7;
 | 
			
		||||
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= [this.tabHumeur[result.smiley].lien];
 | 
			
		||||
     //  console.log("resultat smiley ", result.smiley);
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
onChoixHumeur(numero: number){
 | 
			
		||||
 this.monHumeurTitle= [this.tabHumeur[numero].title];
 | 
			
		||||
 this.monHumeurLien= [this.tabHumeur[numero].lien];
 | 
			
		||||
 | 
			
		||||
 this.membreService.updateHumeur(numero)?.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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
<nav class="wrapper  md-auto position-fixed ">
 | 
			
		||||
<nav class="wrapper  md-auto position-fixed" [ngStyle]="{'background-color':backgroundColor}">
 | 
			
		||||
  <ul class="nav flex-column" id="sticky-sidebar">
 | 
			
		||||
    <li class="nav-item" ngbNavItem="maTeam" >
 | 
			
		||||
      <a routerLink="/compte" routerLinkActive="active-custom" class="nav-link">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  width: auto;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  background-color: #c3c3e7;
 | 
			
		||||
  //background-color: #c3c3e7;
 | 
			
		||||
}
 | 
			
		||||
.nav{
 | 
			
		||||
  margin-top: 20px;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { Component, Input, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-side-bar',
 | 
			
		||||
| 
						 | 
				
			
			@ -6,10 +6,14 @@ import { Component, OnInit } from '@angular/core';
 | 
			
		|||
  styleUrls: ['./side-bar.component.scss']
 | 
			
		||||
})
 | 
			
		||||
export class SideBarComponent implements OnInit {
 | 
			
		||||
  @Input() backgroundColor!: string;
 | 
			
		||||
  //@Input() backgroundColor = '#c3c3e7';
 | 
			
		||||
 | 
			
		||||
  constructor() {}
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
<p>tache works!</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,25 +0,0 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { TacheComponent } from './tache.component';
 | 
			
		||||
 | 
			
		||||
describe('TacheComponent', () => {
 | 
			
		||||
  let component: TacheComponent;
 | 
			
		||||
  let fixture: ComponentFixture<TacheComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ TacheComponent ]
 | 
			
		||||
    })
 | 
			
		||||
    .compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(TacheComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -1,15 +0,0 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-tache',
 | 
			
		||||
  templateUrl: './tache.component.html',
 | 
			
		||||
  styleUrls: ['./tache.component.scss']
 | 
			
		||||
})
 | 
			
		||||
export class TacheComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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,20 +34,24 @@ 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
 | 
			
		||||
  //supprimer la todoList en fonction de son id
 | 
			
		||||
  deleteTodo(id: number): void {
 | 
			
		||||
    window.alert('La to-do-List a bien été supprimé!');
 | 
			
		||||
    this.TodoService.deleteTodoById(id).subscribe((resp) => {
 | 
			
		||||
      window.location.reload();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  //ajouter tache
 | 
			
		||||
 | 
			
		||||
  //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);
 | 
			
		||||
    //permet de construire l'objet à passer en base
 | 
			
		||||
    const tache: Tache = {
 | 
			
		||||
      id: 0,
 | 
			
		||||
      texte: this.todoTitle,
 | 
			
		||||
| 
						 | 
				
			
			@ -58,25 +59,39 @@ export class ToDoListComponent implements OnInit {
 | 
			
		|||
      editing: false,
 | 
			
		||||
    };
 | 
			
		||||
    console.log(this.tache);
 | 
			
		||||
    this.TodoService.addTache(tache, idTodoList).subscribe((resp) => {
 | 
			
		||||
      window.location.reload();
 | 
			
		||||
    });
 | 
			
		||||
    if (this.todoTitle != '') {
 | 
			
		||||
      this.TodoService.addTache(tache, idTodoList).subscribe((resp) => {
 | 
			
		||||
        window.location.reload();
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      window.alert('Il faut saisir du texte'); // sinon msg d'erreur
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //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 par l'input
 | 
			
		||||
  //modifier la tâche par l'input
 | 
			
		||||
  modifier(tache: Tache): void {
 | 
			
		||||
    this.beforeEditCache = tache.texte;
 | 
			
		||||
    tache.editing = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // ajouter la modification dans la liste
 | 
			
		||||
  // modifier une tâche validation de l'input + update check
 | 
			
		||||
  doneEdit(tache: Tache): void {
 | 
			
		||||
    if (tache.texte.trim().length === 0) {
 | 
			
		||||
      tache.texte = this.beforeEditCache;
 | 
			
		||||
| 
						 | 
				
			
			@ -89,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) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -107,23 +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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //Effacer la to do list
 | 
			
		||||
 | 
			
		||||
  effacerList(): void {
 | 
			
		||||
    //this.todo = [];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,4 +5,5 @@ export interface ToDoList {
 | 
			
		|||
  nom: string;
 | 
			
		||||
  taches: Tache[];
 | 
			
		||||
  id: number;
 | 
			
		||||
  team? : Team;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#5a1e63'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="ajoutContact-form text-center">
 | 
			
		||||
    <h3>Ajouter un contact</h3>
 | 
			
		||||
| 
						 | 
				
			
			@ -87,53 +87,6 @@
 | 
			
		|||
          <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 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"
 | 
			
		||||
| 
						 | 
				
			
			@ -144,4 +97,5 @@
 | 
			
		|||
      </form>
 | 
			
		||||
    </main>
 | 
			
		||||
  </div>
 | 
			
		||||
  <app-footer></app-footer>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,7 +63,7 @@ export class PageAjoutContactComponent implements OnInit {
 | 
			
		|||
      email: emailValue,
 | 
			
		||||
      dateNaissance: dateNaissanceValue,
 | 
			
		||||
      adresse: adresseValue,
 | 
			
		||||
      team: { id: teamId }, // changer l'id quand la personne est logé => recuperer l'id de la team du membre
 | 
			
		||||
      team: { id: teamId }, 
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    if (contact.nom !== '') {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,26 +6,56 @@
 | 
			
		|||
  </div>
 | 
			
		||||
  <div class="col-md-4 offset-md-4 text-center">
 | 
			
		||||
    <h2>Ajouter un évènement à l'agenda</h2>
 | 
			
		||||
    <div class="text-center col-md-6 offset-md-3">
 | 
			
		||||
        <main class="form-signup">
 | 
			
		||||
    <div class="text-center col-md-7 offset-md-3">
 | 
			
		||||
        <main class="form-ajout-evenement">
 | 
			
		||||
            <form  (ngSubmit)="onSubmit()" [formGroup]="eventForm">
 | 
			
		||||
                <div class="form-floating">
 | 
			
		||||
                    <input type="datetime-local" 
 | 
			
		||||
                            class="form-control" 
 | 
			
		||||
                            id="floatingInputDebut" 
 | 
			
		||||
                            placeholder="" 
 | 
			
		||||
                            name="start" 
 | 
			
		||||
                            formControlName="startFc">
 | 
			
		||||
                    <label for="floatingInputfirstName">Début</label>
 | 
			
		||||
                <div class="row g-2">
 | 
			
		||||
                  <div class="col-md">
 | 
			
		||||
                    <div class="form-floating">
 | 
			
		||||
                      <input type="date" 
 | 
			
		||||
                              class="form-control" 
 | 
			
		||||
                              id="floatingInputDebut" 
 | 
			
		||||
                              placeholder="" 
 | 
			
		||||
                              name="startDate" 
 | 
			
		||||
                              formControlName="startDateFc">
 | 
			
		||||
                      <label for="floatingInputfirstName">Date de début</label>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="col-md">
 | 
			
		||||
                    <div class="form-floating">
 | 
			
		||||
                      <input type="time" 
 | 
			
		||||
                              class="form-control" 
 | 
			
		||||
                              id="floatingInputDebut" 
 | 
			
		||||
                              placeholder="" 
 | 
			
		||||
                              name="startHour" 
 | 
			
		||||
                              formControlName="startHourFc">
 | 
			
		||||
                      <label for="floatingInputfirstName">Heure de début</label>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="form-floating">
 | 
			
		||||
                    <input type="datetime-local" 
 | 
			
		||||
                            class="form-control" 
 | 
			
		||||
                            id="floatingInputFin" 
 | 
			
		||||
                            placeholder="" 
 | 
			
		||||
                            name="end" 
 | 
			
		||||
                            formControlName="endFc">
 | 
			
		||||
                    <label for="floatingInputlastName">Fin</label>
 | 
			
		||||
                <div class="row g-2">
 | 
			
		||||
                  <div class="col-md">
 | 
			
		||||
                    <div class="form-floating">
 | 
			
		||||
                      <input type="date" 
 | 
			
		||||
                              class="form-control" 
 | 
			
		||||
                              id="floatingInputFin" 
 | 
			
		||||
                              placeholder="" 
 | 
			
		||||
                              name="endDate" 
 | 
			
		||||
                              formControlName="endDateFc">
 | 
			
		||||
                      <label for="floatingInputlastName">Date de fin</label>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="col-md">
 | 
			
		||||
                    <div class="form-floating">
 | 
			
		||||
                      <input type="time" 
 | 
			
		||||
                              class="form-control" 
 | 
			
		||||
                              id="floatingInputFin" 
 | 
			
		||||
                              placeholder="" 
 | 
			
		||||
                              name="endHour" 
 | 
			
		||||
                              formControlName="endHourFc">
 | 
			
		||||
                      <label for="floatingInputlastName">Heure de fin</label>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="form-floating">
 | 
			
		||||
                    <input type="text" 
 | 
			
		||||
| 
						 | 
				
			
			@ -36,10 +66,10 @@
 | 
			
		|||
                            formControlName="textFc">
 | 
			
		||||
                    <label for="floatingInputlastName">Libelle</label>
 | 
			
		||||
                </div>    
 | 
			
		||||
                <button class="w-100 btn btn-lg btn-primary" 
 | 
			
		||||
                <button class="btn btn-lg btn-primary" 
 | 
			
		||||
                        type="submit" 
 | 
			
		||||
                        [disabled]="eventForm.invalid">Validation</button>
 | 
			
		||||
    
 | 
			
		||||
                        [disabled]="eventForm.invalid">Ajouter</button>
 | 
			
		||||
                <a routerLink="../agenda" class="btn btn-lg btn-primary">Annuler</a>
 | 
			
		||||
            </form>
 | 
			
		||||
        </main>
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,20 +27,24 @@ export class PageAjoutEvenementsComponent implements OnInit {
 | 
			
		|||
    this.teamId = this.tokenService.getCurrentTeamId();
 | 
			
		||||
    
 | 
			
		||||
    this.eventForm = new FormGroup({
 | 
			
		||||
      startFc : new FormControl(''),
 | 
			
		||||
      endFc : new FormControl(''),
 | 
			
		||||
      startDateFc : new FormControl(''),
 | 
			
		||||
      startHourFc : new FormControl(''),
 | 
			
		||||
      endDateFc : new FormControl(''),
 | 
			
		||||
      endHourFc : new FormControl(''),
 | 
			
		||||
      textFc : new FormControl('', [ Validators.required])
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public onSubmit(): void {
 | 
			
		||||
    const startValue = this.eventForm.value['startFc'];
 | 
			
		||||
    const endValue = this.eventForm.value['endFc'];
 | 
			
		||||
    const startDateValue = this.eventForm.value['startDateFc'];
 | 
			
		||||
    const startHourValue = this.eventForm.value['startHourFc'];
 | 
			
		||||
    const endDateValue = this.eventForm.value['endDateFc'];
 | 
			
		||||
    const endHourValue = this.eventForm.value['endHourFc'];
 | 
			
		||||
    const textValue = this.eventForm.value['textFc'];
 | 
			
		||||
 | 
			
		||||
    const event = {
 | 
			
		||||
      start: startValue,
 | 
			
		||||
      end: endValue,
 | 
			
		||||
      start: startDateValue+'T'+startHourValue+':00',
 | 
			
		||||
      end: endDateValue+'T'+endHourValue+':00',
 | 
			
		||||
      text: textValue,
 | 
			
		||||
      id:"",
 | 
			
		||||
      membre: {id:this.userId},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<div class="row">
 | 
			
		||||
    <div class="col-md-auto">
 | 
			
		||||
        <app-side-bar></app-side-bar>
 | 
			
		||||
        <app-side-bar [backgroundColor]="'#5a1e63'"></app-side-bar>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
<div class="modifContact-form text-center">
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +11,8 @@
 | 
			
		|||
            
 | 
			
		||||
            <div class="form-floating">
 | 
			
		||||
            <input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
 | 
			
		||||
            formControlName="couleurFc" value= "{{ listContactInfo.couleur }}">
 | 
			
		||||
            formControlName="couleurFc" value= "{{ listContactInfo.couleur }}"
 | 
			
		||||
            [(ngModel)]="listContactInfo.couleur">
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-floating">
 | 
			
		||||
| 
						 | 
				
			
			@ -83,9 +84,10 @@
 | 
			
		|||
 | 
			
		||||
            <button class="w-100 btn btn-lg btn-secondary" 
 | 
			
		||||
                    type="submit" 
 | 
			
		||||
                    [disabled]="modifContactForm.invalid">Valider</button>
 | 
			
		||||
                    >Valider</button>
 | 
			
		||||
 | 
			
		||||
        </form>
 | 
			
		||||
    </main>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
</div> 
 | 
			
		||||
| 
						 | 
				
			
			@ -2,10 +2,10 @@
 | 
			
		|||
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#5a1e63'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="col compte text-center py-3 border">
 | 
			
		||||
  <div class="col compte text-center py-3">
 | 
			
		||||
    <div>
 | 
			
		||||
      <button
 | 
			
		||||
        *ngIf="parent" 
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@
 | 
			
		|||
      <div class="row justify-content-evenly">
 | 
			
		||||
        <div class="col-4">
 | 
			
		||||
          <div
 | 
			
		||||
            class="row my-3 d-flex justify-content-center flex-row"
 | 
			
		||||
            class="row my-3 d-flex justify-content-center flex-row pointer"
 | 
			
		||||
            *ngFor="let personne of listContact"
 | 
			
		||||
            (click)="onClick(personne)"
 | 
			
		||||
          >
 | 
			
		||||
| 
						 | 
				
			
			@ -58,4 +58,6 @@
 | 
			
		|||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <app-footer></app-footer>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,4 +31,8 @@
 | 
			
		|||
.h4 {
 | 
			
		||||
  color: black;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.pointer{
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -28,4 +28,5 @@
 | 
			
		|||
            <button type="button" class="btn btn-danger">Effacer</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
<app-header></app-header>
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="col-md-auto">
 | 
			
		||||
    <app-side-bar></app-side-bar>
 | 
			
		||||
    <app-side-bar [backgroundColor]="'#4E9E7B'"></app-side-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col menu text-center">
 | 
			
		||||
    <h2>To-Do-List</h2>
 | 
			
		||||
| 
						 | 
				
			
			@ -25,3 +25,5 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<app-footer></app-footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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',
 | 
			
		||||
| 
						 | 
				
			
			@ -21,6 +21,7 @@ export class PageToDoListComponent implements OnInit {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    //récupère les todoLists existantes en fonctoin de l'id de la team en utilisant le service
 | 
			
		||||
    this.TodoService.getToDoListByTeamId()?.subscribe((listTodos: any) => {
 | 
			
		||||
      console.log(listTodos);
 | 
			
		||||
      this.listTodos = listTodos;
 | 
			
		||||
| 
						 | 
				
			
			@ -28,23 +29,21 @@ export class PageToDoListComponent implements OnInit {
 | 
			
		|||
      this.idTodo = 0;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  //Ajouter une todo List
 | 
			
		||||
 | 
			
		||||
  //Ajouter une todo List si l'input contient un texte
 | 
			
		||||
  addTodoByTeamId() {
 | 
			
		||||
    const todoList: ToDoList = {
 | 
			
		||||
      nom: this.todoListTitle,
 | 
			
		||||
      taches: [],
 | 
			
		||||
      id: 0,
 | 
			
		||||
    };
 | 
			
		||||
    this.TodoService.addTodoByTeamId(todoList)?.subscribe((resp) => {
 | 
			
		||||
      console.log(todoList);
 | 
			
		||||
      window.location.reload();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  deleteTodo(id: number): void {
 | 
			
		||||
    window.alert('La to-do-List a bien été supprimé!');
 | 
			
		||||
    this.TodoService.deleteTodoById(id).subscribe((resp) => {
 | 
			
		||||
      window.location.reload();
 | 
			
		||||
    });
 | 
			
		||||
    if (this.todoListTitle != '') {
 | 
			
		||||
      this.TodoService.addTodoByTeamId(todoList)?.subscribe((resp) => {
 | 
			
		||||
        console.log(todoList);
 | 
			
		||||
        window.location.reload(); //rafraîchit l'aperçu
 | 
			
		||||
      });
 | 
			
		||||
    }else{
 | 
			
		||||
    window.alert('Il faut saisir du texte'); // sinon msg d'erreur
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,4 +57,16 @@ export class MembreService {
 | 
			
		|||
      this.router.navigate(['accueil']);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
updateHumeur(numero : number) : 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']);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,37 +18,46 @@ export class TodoService {
 | 
			
		|||
    this.apiUrl = environment.apiUrl;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //recupère les todolistexistantes en BDD par le tokenService en fonction de l'iD de la team
 | 
			
		||||
  getToDoListByTeamId(): Observable<any> | void {
 | 
			
		||||
    const teamId = this.tokenService.getCurrentTeamId();
 | 
			
		||||
    return this.http.get(`${this.apiUrl}/todolist/team/${teamId}`);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //supprime les taches par l'id dela tache dans la todoList
 | 
			
		||||
  deleteTacheById(idTache: any): Observable<any> {
 | 
			
		||||
    return this.http.delete(`${this.apiUrl}/taches/delete/${idTache}`, {
 | 
			
		||||
      responseType: 'text',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //ajoute une tache avec auto-incrémentation de l'id dans la todolist
 | 
			
		||||
  addTache(newtache: Tache, idTodoList: number): Observable<any> {
 | 
			
		||||
    // console.log(newtache);
 | 
			
		||||
    return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // modifie une tâche par son id
 | 
			
		||||
  updateTache(tache: Tache): Observable<any> {
 | 
			
		||||
    console.log(tache);
 | 
			
		||||
    // console.log(tache);
 | 
			
		||||
    return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //ajoute ne todoList sur une team (par son id) via le token
 | 
			
		||||
  addTodoByTeamId(newtodoList: TodoList): Observable<any> {
 | 
			
		||||
    const teamId = this.tokenService.getCurrentTeamId();
 | 
			
		||||
    console.log(newtodoList + 'newtodoList');
 | 
			
		||||
    return this.http.post(`${this.apiUrl}/todolist/add/${teamId}`, newtodoList);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //suprime une todoList en fonction de son id
 | 
			
		||||
  deleteTodoById(idTodo: any): Observable<any> {
 | 
			
		||||
    return this.http.delete(`${this.apiUrl}/todolist/delete/${idTodo}`, {
 | 
			
		||||
      responseType: 'text',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //modfie une todoList par son id
 | 
			
		||||
  updateTodo(todoList: TodoList): Observable<any> {
 | 
			
		||||
    console.log(todoList);
 | 
			
		||||
    return this.http.put(`${this.apiUrl}/todolist/update/666`, todoList);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue