From 7955ccad42d73f512429d49c3598bb9f3cf9aacb Mon Sep 17 00:00:00 2001 From: HarmandI Date: Sat, 5 Mar 2022 09:21:00 +0100 Subject: [PATCH 01/11] correction bug list et tache vides --- src/app/app.module.ts | 2 -- src/app/components/tache/tache.component.html | 1 - src/app/components/tache/tache.component.scss | 0 .../components/tache/tache.component.spec.ts | 25 ------------------- src/app/components/tache/tache.component.ts | 15 ----------- .../to-do-list/to-do-list.component.ts | 25 +++++++++---------- .../page-to-do-list.component.html | 2 ++ .../page-to-do-list.component.ts | 23 ++++++++--------- src/app/services/todo.service.ts | 11 +++++++- 9 files changed, 35 insertions(+), 69 deletions(-) delete mode 100644 src/app/components/tache/tache.component.html delete mode 100644 src/app/components/tache/tache.component.scss delete mode 100644 src/app/components/tache/tache.component.spec.ts delete mode 100644 src/app/components/tache/tache.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6fe94e6..31e7e57 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -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'; @@ -68,7 +67,6 @@ registerLocaleData(localeFr) CalendrierComponent, CardMemberComponent, ToDoListComponent, - TacheComponent, CardMenuComponent, FicheContactComponent, CreneauComponent, diff --git a/src/app/components/tache/tache.component.html b/src/app/components/tache/tache.component.html deleted file mode 100644 index 191d8ea..0000000 --- a/src/app/components/tache/tache.component.html +++ /dev/null @@ -1 +0,0 @@ -

tache works!

diff --git a/src/app/components/tache/tache.component.scss b/src/app/components/tache/tache.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/components/tache/tache.component.spec.ts b/src/app/components/tache/tache.component.spec.ts deleted file mode 100644 index 44bc16a..0000000 --- a/src/app/components/tache/tache.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TacheComponent } from './tache.component'; - -describe('TacheComponent', () => { - let component: TacheComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TacheComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TacheComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/tache/tache.component.ts b/src/app/components/tache/tache.component.ts deleted file mode 100644 index 5b7b6c5..0000000 --- a/src/app/components/tache/tache.component.ts +++ /dev/null @@ -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 { - } - -} diff --git a/src/app/components/to-do-list/to-do-list.component.ts b/src/app/components/to-do-list/to-do-list.component.ts index f5dd560..09d58aa 100644 --- a/src/app/components/to-do-list/to-do-list.component.ts +++ b/src/app/components/to-do-list/to-do-list.component.ts @@ -40,14 +40,15 @@ export class ToDoListComponent implements OnInit { this.idTodo = 4; this.todoTitle = ''; } - //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); @@ -58,9 +59,13 @@ 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 @@ -70,13 +75,13 @@ export class ToDoListComponent implements OnInit { }); } - //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 doneEdit(tache: Tache): void { if (tache.texte.trim().length === 0) { tache.texte = this.beforeEditCache; @@ -112,12 +117,6 @@ export class ToDoListComponent implements OnInit { 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 cocherAllTodoList(): void { for (var i = 0; i < this.todo.taches.length; i++) { diff --git a/src/app/pages/page-to-do-list/page-to-do-list.component.html b/src/app/pages/page-to-do-list/page-to-do-list.component.html index 69b5838..143367f 100644 --- a/src/app/pages/page-to-do-list/page-to-do-list.component.html +++ b/src/app/pages/page-to-do-list/page-to-do-list.component.html @@ -25,3 +25,5 @@ + + diff --git a/src/app/pages/page-to-do-list/page-to-do-list.component.ts b/src/app/pages/page-to-do-list/page-to-do-list.component.ts index b9732e8..a850dda 100644 --- a/src/app/pages/page-to-do-list/page-to-do-list.component.ts +++ b/src/app/pages/page-to-do-list/page-to-do-list.component.ts @@ -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 n'est pas vide 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 + } } } diff --git a/src/app/services/todo.service.ts b/src/app/services/todo.service.ts index 6528ebb..31e14f1 100644 --- a/src/app/services/todo.service.ts +++ b/src/app/services/todo.service.ts @@ -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 | 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 { 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 { // console.log(newtache); return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache); } + // modifie une tâche par son id updateTache(tache: Tache): Observable { - 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 { 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 { return this.http.delete(`${this.apiUrl}/todolist/delete/${idTodo}`, { responseType: 'text', }); } + + //modfie une todoList par son id updateTodo(todoList: TodoList): Observable { console.log(todoList); return this.http.put(`${this.apiUrl}/todolist/update/666`, todoList); From 1d9bf75e59923e5e36deefc3c10419c02fd364b3 Mon Sep 17 00:00:00 2001 From: Hedi Date: Sat, 5 Mar 2022 10:45:23 +0100 Subject: [PATCH 02/11] fix formulaire --- .../page-ajout-evenements.component.html | 72 +++++++++++++------ .../page-ajout-evenements.component.ts | 16 +++-- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html index a65589c..4c68aa6 100644 --- a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html @@ -6,26 +6,56 @@

Ajouter un évènement à l'agenda

-
-
+
+
-
- - +
+
+
+ + +
+
+
+
+ + +
+
-
- - +
+
+
+ + +
+
+
+
+ + +
+
- - + [disabled]="eventForm.invalid">Ajouter + Annuler
diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts index 68d53a1..3d06070 100644 --- a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts @@ -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}, From c65fb9d8c2328d5c4e01681e0fb3945cedd32791 Mon Sep 17 00:00:00 2001 From: Hedi Date: Sat, 5 Mar 2022 12:19:40 +0100 Subject: [PATCH 03/11] side-bar : personnalisation de la couleur --- src/app/components/side-bar/side-bar.component.html | 2 +- src/app/components/side-bar/side-bar.component.scss | 2 +- src/app/components/side-bar/side-bar.component.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/components/side-bar/side-bar.component.html b/src/app/components/side-bar/side-bar.component.html index 6e3baaf..150764a 100644 --- a/src/app/components/side-bar/side-bar.component.html +++ b/src/app/components/side-bar/side-bar.component.html @@ -1,4 +1,4 @@ -
From 2e8d6ed18a70f7d09af5fadb13ec5f0bc0e267ee Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Sat, 5 Mar 2022 13:32:15 +0100 Subject: [PATCH 05/11] bakground color side bar essai alert pas fini cursor pointer --- .../fiche-contact/fiche-contact.component.ts | 7 ++- .../page-ajout-contact.component.html | 49 +------------------ .../page-modifier-contact.component.html | 2 +- .../page-repertoire.component.html | 10 +++- .../page-repertoire.component.scss | 4 ++ .../page-repertoire.component.ts | 17 ++++++- 6 files changed, 35 insertions(+), 54 deletions(-) diff --git a/src/app/components/fiche-contact/fiche-contact.component.ts b/src/app/components/fiche-contact/fiche-contact.component.ts index 2d99fde..6082f9f 100644 --- a/src/app/components/fiche-contact/fiche-contact.component.ts +++ b/src/app/components/fiche-contact/fiche-contact.component.ts @@ -10,10 +10,14 @@ export class FicheContactComponent implements OnInit { @Input() personne: any; @Output() clickDelete = new EventEmitter(); parent: boolean; + isShow: boolean; + alert:any; constructor(private tokenService: TokenService) { this.parent = false; + this.isShow = false; + this.alert = ""; } ngOnInit(): void { @@ -26,7 +30,8 @@ export class FicheContactComponent implements OnInit { // supprime le contact onClickDelete(numPerson: number){ - window.alert("Le contact à bien été supprimé!") + this.alert={"type":"succes", "content":"le contact a été supprimé mother fucker!!!!!!!!!"}; + this.isShow = true; this.clickDelete.emit(numPerson); } } diff --git a/src/app/pages/page-ajout-contact/page-ajout-contact.component.html b/src/app/pages/page-ajout-contact/page-ajout-contact.component.html index dc09392..731c7ca 100644 --- a/src/app/pages/page-ajout-contact/page-ajout-contact.component.html +++ b/src/app/pages/page-ajout-contact/page-ajout-contact.component.html @@ -1,7 +1,7 @@
- +

Ajouter un contact

@@ -87,53 +87,6 @@
-
- - -
-
- - -
- -
- - -
- -
- - -
-
+
\ No newline at end of file diff --git a/src/app/pages/page-repertoire/page-repertoire.component.html b/src/app/pages/page-repertoire/page-repertoire.component.html index 757632b..6f48ea9 100644 --- a/src/app/pages/page-repertoire/page-repertoire.component.html +++ b/src/app/pages/page-repertoire/page-repertoire.component.html @@ -5,13 +5,7 @@
- - -
+
+ +
diff --git a/src/app/pages/page-repertoire/page-repertoire.component.ts b/src/app/pages/page-repertoire/page-repertoire.component.ts index a472bf7..c387247 100644 --- a/src/app/pages/page-repertoire/page-repertoire.component.ts +++ b/src/app/pages/page-repertoire/page-repertoire.component.ts @@ -17,9 +17,6 @@ export class PageRepertoireComponent implements OnInit { keyword: any; openDetails: any; parent: boolean; - isShow: boolean; - alert:any; - constructor( private repertoireService: RepertoireService, @@ -31,8 +28,6 @@ export class PageRepertoireComponent implements OnInit { this.listFull = []; this.listContactInfo = ''; this.parent = false; - this.isShow = false; - this.alert = ""; } ngOnInit(): void { @@ -50,7 +45,7 @@ export class PageRepertoireComponent implements OnInit { }); } - // Méthode pour récuper ce qui est saisi dans l'input pour effectuer une recherche + // Méthode pour récuper ce qui est saisi dans l'input onSearchChange(prenom: string): void { this.keyword = prenom; if (prenom == '') { @@ -78,20 +73,12 @@ export class PageRepertoireComponent implements OnInit { onClickDelete(contactId: number){ this.repertoireService.deleteContact(contactId).subscribe((resp) => { if(contactId) { - this.alert={"type":"succes", "content":"le contact a été supprimé mother fucker!!!!!!!!!"}; - this.isShow = true; this.listContact.forEach(contactId => console.log(contactId)) }else{ - this.alert={"type":"danger", "content":"le contact n'a pas été supprimé"}; - this.isShow = true; + window.alert("Le contact ne peut pas être supprimé!") } this.router.navigate(['repertoire/']); }); window.location.reload(); } - - // methode pour fermer l'alert de message - onClickCloseAlert(){ - this.isShow = ! this.isShow; - } } From bb34a0cc7a555c2fd63aeb91448acb1402e848e4 Mon Sep 17 00:00:00 2001 From: cecilesimplon93 Date: Sat, 5 Mar 2022 19:53:33 +0100 Subject: [PATCH 07/11] finalisation du footer --- src/app/app.module.ts | 4 +++- src/app/components/footer/footer.component.html | 3 ++- src/app/components/footer/footer.component.scss | 5 +++++ src/app/components/humeur/humeur.component.html | 3 ++- src/app/pages/page-support/page-support.component.html | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 31e7e57..d40293d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -41,6 +41,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({ @@ -78,7 +79,8 @@ registerLocaleData(localeFr) DeconnexionComponent, HumeurComponent, AlertComponent, - PageAjoutEvenementsComponent + PageAjoutEvenementsComponent, + PageSupportComponent ], imports: [ BrowserModule, diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index 805a5ca..9cd0f94 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -8,5 +8,6 @@
To-Do-List Agenda Menus +Nous contacter + - \ No newline at end of file diff --git a/src/app/components/footer/footer.component.scss b/src/app/components/footer/footer.component.scss index 90d7840..82b82c8 100644 --- a/src/app/components/footer/footer.component.scss +++ b/src/app/components/footer/footer.component.scss @@ -7,4 +7,9 @@ font-size: smaller; .footer { margin-top: 20px; +} + +h3{ + color : blue; + font-size : 16px; } \ No newline at end of file diff --git a/src/app/components/humeur/humeur.component.html b/src/app/components/humeur/humeur.component.html index 02088d8..94fb3fe 100644 --- a/src/app/components/humeur/humeur.component.html +++ b/src/app/components/humeur/humeur.component.html @@ -19,4 +19,5 @@
-
\ No newline at end of file + + \ No newline at end of file diff --git a/src/app/pages/page-support/page-support.component.html b/src/app/pages/page-support/page-support.component.html index 7c20ea7..adbbb66 100644 --- a/src/app/pages/page-support/page-support.component.html +++ b/src/app/pages/page-support/page-support.component.html @@ -28,4 +28,5 @@ - \ No newline at end of file + + \ No newline at end of file From cca4e96f2bbe2cae193ba1f44581df615681669e Mon Sep 17 00:00:00 2001 From: HarmandI Date: Sat, 5 Mar 2022 20:22:10 +0100 Subject: [PATCH 08/11] bug : enregistre en base cocher toutes les taches --- .../to-do-list/to-do-list.component.ts | 20 +++++++++++-------- .../page-to-do-list.component.html | 2 +- .../page-to-do-list.component.ts | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/app/components/to-do-list/to-do-list.component.ts b/src/app/components/to-do-list/to-do-list.component.ts index 09d58aa..0892eb3 100644 --- a/src/app/components/to-do-list/to-do-list.component.ts +++ b/src/app/components/to-do-list/to-do-list.component.ts @@ -3,7 +3,7 @@ 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 +13,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 +23,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 +35,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 { @@ -81,7 +81,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; @@ -112,17 +112,21 @@ 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 { diff --git a/src/app/pages/page-to-do-list/page-to-do-list.component.html b/src/app/pages/page-to-do-list/page-to-do-list.component.html index 143367f..ea853ba 100644 --- a/src/app/pages/page-to-do-list/page-to-do-list.component.html +++ b/src/app/pages/page-to-do-list/page-to-do-list.component.html @@ -1,7 +1,7 @@
- +