From 86bdf56cb65e79623dc08d56699d2933a886eb97 Mon Sep 17 00:00:00 2001 From: Hedi Date: Tue, 1 Mar 2022 19:07:37 +0100 Subject: [PATCH 01/22] missing role --- src/app/pages/page-agenda/page-agenda.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/pages/page-agenda/page-agenda.component.ts b/src/app/pages/page-agenda/page-agenda.component.ts index d9d86a2..0b23896 100644 --- a/src/app/pages/page-agenda/page-agenda.component.ts +++ b/src/app/pages/page-agenda/page-agenda.component.ts @@ -58,6 +58,7 @@ export class PageAgendaComponent implements AfterViewInit { ngOnInit(): void { this.userId = this.tokenService.getCurrentMembreId(); this.teamId = this.tokenService.getCurrentTeamId(); + this.role = this.tokenService.getRole(); } // petite triche pour eviter la repetition du nom dans le RDV From fa3265f53354b500ea24b84b114dccb277c74808 Mon Sep 17 00:00:00 2001 From: Hedi Date: Tue, 1 Mar 2022 21:16:33 +0100 Subject: [PATCH 02/22] component alert pour afficher une alert avec un message --- src/app/components/signin/signin.component.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/components/signin/signin.component.html b/src/app/components/signin/signin.component.html index 5cb3e7a..7c782da 100644 --- a/src/app/components/signin/signin.component.html +++ b/src/app/components/signin/signin.component.html @@ -27,7 +27,9 @@ + +
@@ -20,8 +21,11 @@
- + + + +
diff --git a/src/app/pages/page-add-member/page-add-member.component.html b/src/app/pages/page-add-member/page-add-member.component.html index c7d87a6..5731f66 100644 --- a/src/app/pages/page-add-member/page-add-member.component.html +++ b/src/app/pages/page-add-member/page-add-member.component.html @@ -1,12 +1,12 @@ - +
-
+

Ajouter un nouveau membre à {{currentTeam.nom}}

-
+
+
- +
- +
-
+
Date de naissance
@@ -92,20 +93,7 @@ !addMemberForm.controls['emailFc'].valid }" /> - -
-
- - +
- +
Confirmez le mot de passe
+
+ + +
+ +
+
diff --git a/src/app/pages/page-update-member/page-update-member.component.scss b/src/app/pages/page-update-member/page-update-member.component.scss index e69de29..b66b171 100644 --- a/src/app/pages/page-update-member/page-update-member.component.scss +++ b/src/app/pages/page-update-member/page-update-member.component.scss @@ -0,0 +1,80 @@ +.login-form { + height: 100vh; + padding-top: 40px; + background-color: #f5f5f5; +} + h1{ + color: rgba(0, 0, 0, 0.658); + font-size: 34px; + margin-top: 20px; + } + +.form-updateMember { + width: 100%; + max-width: 330px; + padding: 15px; + margin-top: 50px; + margin-left: auto; + margin-right: auto; + border: solid 1px; + border-radius: 10px; + background-color: #fcddec; + border-color: #ef5da8; +} + +.form-updateMember .checkbox { + font-weight: 400; +} + +.form-updateMember .form-floating:focus-within { + z-index: 2; +} + +.form-updateMember input[type="email"] { + margin-bottom: 10px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-updateMember input[type="color"] { + border: none; + margin-bottom: 10px; + margin-top: -70px; + margin-left: 100px; + border-radius: 50%; + width: 100px; + height: 100px; +} + +.form-updateMember input[type="color"]::-webkit-color-swatch { + border: none; + margin-top: -15px; + border-radius: 80%; + width: 80px; + height: 80px; +} + +.form-updateMember input[type="text"] { + margin-bottom: 10px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-updateMember input[type="date"] { + margin-bottom: 10px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-updateMember input[type="password"] { + margin-bottom: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.btn-outline-success { + margin-top: 10px; + background-color: #ffff; + color: #ef5da8 !important; + border-color: #ef5da8 !important; +} diff --git a/src/app/pages/page-update-member/page-update-member.component.ts b/src/app/pages/page-update-member/page-update-member.component.ts index be0f66e..555f450 100644 --- a/src/app/pages/page-update-member/page-update-member.component.ts +++ b/src/app/pages/page-update-member/page-update-member.component.ts @@ -1,4 +1,8 @@ import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Membre } from 'src/app/models/membre'; +import { MembreService } from 'src/app/services/membre.service'; @Component({ selector: 'app-page-update-member', @@ -6,10 +10,117 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./page-update-member.component.scss'] }) export class PageUpdateMemberComponent implements OnInit { + public updateMembreForm: FormGroup; + public membreData: FormGroup; + public membreInfos: any; + public membreId: any; - constructor() { } + + constructor(private membreService: MembreService, + private router: Router, + private fb: FormBuilder, + private route: ActivatedRoute) { + this.updateMembreForm = new FormGroup({}); + this.membreData = this.initForm(); + this.membreInfos = ''; + } 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; + }); + + /** group est déprécié mais pas d'autres solutions sinon revoir la fonction confirmeValidator **/ + this.updateMembreForm = this.fb.group( + { + firstNameFc: new FormControl('', [Validators.required]), + lastNameFc: new FormControl('', [Validators.required]), + dateNaissanceFc: new FormControl('', [Validators.required]), + roleFc: new FormControl('', []), + couleurFc: new FormControl('', []), + emailFc: new FormControl('', [ + Validators.email, + Validators.required, + Validators.pattern(/^([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/gim), + ]), + passwordFc: new FormControl('', [ + Validators.minLength(8), + ]), + passwordConfirmFc: new FormControl('', [ + Validators.minLength(8), + ]), + }, + { + validator: this.ConfirmedValidator('passwordFc', 'passwordConfirmFc'), + } + )}; + + /** Méthode qui initialise les champs du formulaire avec les infos de la BDD **/ + private initForm(membre?: Membre): FormGroup { + return this.fb.group({ + nom:[membre ? membre.nom : ''], + prenom: [membre ? membre.prenom : ''], + email: [membre ? membre.email : ''], + password: [membre ? membre.password : ''], + couleur: [membre ? membre.couleur : ''], + dateNaissance: [membre ? membre.dateNaissance : ''], + passwordConfirm: [membre ? membre.passwordConfirm : ''], + roleList: [membre ? membre.roleList : ['']], + }); } + /** Méthode qui envoie les champs modifiés pour mise à jour **/ + public onSubmit(): void { + const firstNameValue = this.updateMembreForm.value['firstNameFc']; + const lastNameValue = this.updateMembreForm.value['lastNameFc']; + const emailValue = this.updateMembreForm.value['emailFc']; + const passwordValue = this.updateMembreForm.value['passwordFc']; + const dateNaissanceValue = this.updateMembreForm.value['dateNaissanceFc']; + const couleurValue = this.updateMembreForm.value['couleurFc']; + const passwordConfirmValue = this.updateMembreForm.value['passwordConfirmFc']; + const roleValue = this.updateMembreForm.value['roleFc']; + + const membre: Membre = { + id: this.membreId, + nom: lastNameValue, + prenom: firstNameValue, + email: emailValue, + password: passwordValue, + dateNaissance: dateNaissanceValue, + couleur: couleurValue, + passwordConfirm: passwordConfirmValue, + roleList: [roleValue] + }; + + this.membreService.updateMembre(membre).subscribe((resp) => { + this.router.navigate(['compte']); + }); + } + + + + /** Méthode pour compare le mot de passe et la confirmation de mot de passe **/ + 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); + } + }; + } } diff --git a/src/app/services/membre.service.ts b/src/app/services/membre.service.ts index 98d19a0..d721522 100644 --- a/src/app/services/membre.service.ts +++ b/src/app/services/membre.service.ts @@ -48,7 +48,7 @@ export class MembreService { deleteMembre(membre: Membre): Observable { return this.http.delete(`${this.apiUrl}/membres/delete/1`); } - + //modifier pour récupérer id et pas mettre un id par défaut updateMembre(membre: Membre): Observable { return this.http.put(`${this.apiUrl}/membres/update/1`, membre); } From 52286c1b7fd7a80132060edc1855f733469a58ab Mon Sep 17 00:00:00 2001 From: Hedi MJID Date: Fri, 4 Mar 2022 14:31:50 +0100 Subject: [PATCH 10/22] calendrier : ajout de commentaires --- .../page-agenda/page-agenda.component.ts | 69 +++++++------------ 1 file changed, 25 insertions(+), 44 deletions(-) diff --git a/src/app/pages/page-agenda/page-agenda.component.ts b/src/app/pages/page-agenda/page-agenda.component.ts index 0b23896..12fd5cc 100644 --- a/src/app/pages/page-agenda/page-agenda.component.ts +++ b/src/app/pages/page-agenda/page-agenda.component.ts @@ -23,7 +23,7 @@ export class PageAgendaComponent implements AfterViewInit { constructor(private evenementService:EvenementService, private tokenService: TokenService) { this.isShow = false; this.alert = ""; - this.debug = environment.debug; + this.debug = environment.debug; // Pour afficher ou pas les infos du token } get date(): DayPilot.Date { @@ -34,6 +34,7 @@ export class PageAgendaComponent implements AfterViewInit { this.config.startDate = value; } + // config pour les option d'affichage du mini calendrier de navigation navigatorConfig: DayPilot.NavigatorConfig = { showMonths: 1, skipMonths: 1, @@ -45,10 +46,11 @@ export class PageAgendaComponent implements AfterViewInit { titleHeight: 30 }; + // intialisation de events, pour accueillir les evenements events: DayPilot.EventData[] = []; + // methode pour fermer l'alert de message onClickCloseAlert(){ - console.log('fermeture'); this.isShow = ! this.isShow; } @@ -62,12 +64,15 @@ export class PageAgendaComponent implements AfterViewInit { } // petite triche pour eviter la repetition du nom dans le RDV + // on split sur un retour chariot pour ne conserver que la premiere partie + // qui est le titre de l'evenement rdvSplit(rdv:any){ let titleRDV = rdv.split('\r'); console.log(titleRDV[0]); return titleRDV[0]; } + // config des options du calendrier config: DayPilot.CalendarConfig = { startDate: DayPilot.Date.today(), locale: "fr-fr", @@ -126,18 +131,7 @@ export class PageAgendaComponent implements AfterViewInit { Object.assign(event, {id: ""}); Object.assign(event, {membre: {id:this.userId}}); Object.assign(event, {team: {id:this.teamId}}); - console.log("Event added: " + event); - // let data = dp.events; - // Object.keys(data).map(function(key, index) { - // data[key] = { - // barColor:data[key].membre.couleur, - // //backColor:data[key].membre.couleur, - // "id": data[key].id, - // "start": data[key].start, - // "end": data[key].end, - // "text": data[key].text - // }; - // }); + //console.log("Event added: " + event); this.evenementService.addEvenements(event).subscribe({ next: result => { this.viewChange(); @@ -211,6 +205,7 @@ export class PageAgendaComponent implements AfterViewInit { } } + // petite fonction pour eclaircir la couleur du membre a l'affichage de son evenement adjust(color:string, amount:number) { return '#' + color.replace(/^#/, '').replace(/../g, color => ('0' + Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)); @@ -220,37 +215,23 @@ export class PageAgendaComponent implements AfterViewInit { var from = this.calendar.control.visibleStart(); var to = this.calendar.control.visibleEnd(); - console.log("viewChange(): " + from + " " + to); - - // this.ds.getEvents(from, to).subscribe(result => { - //this.events = this.evenements; - this.evenementService.getEvenementsByIdTeam(this.teamId).subscribe((data: any) => { - // this.events = [{ - // "id": data[0].id, - // "start": data[0].eventDebut, - // "end": data[0].eventFin, - // "text": data[0].libelle, - // barColor: data[0].membre.couleur, - // //cssClass: "toto" - // }]; - Object.keys(data).map((key, index) => { - data[key] = { - barColor:data[key].membre.couleur, - backColor: this.adjust(data[key].membre.couleur, 90), - id: data[key].id, - start: data[key].start, - end: data[key].end, - text: data[key].text.toUpperCase()+'\r('+data[key].membre.prenom+')', - tags : { - membre: data[key].membre.id - } - }; - }); - this.events = data; - console.log(data); - console.log(this.events); + // Récuperation des evenements d'une team + this.evenementService.getEvenementsByIdTeam(this.teamId).subscribe((data: any) => { + Object.keys(data).map((key, index) => { + data[key] = { + barColor:data[key].membre.couleur, + backColor: this.adjust(data[key].membre.couleur, 90), + id: data[key].id, + start: data[key].start, + end: data[key].end, + text: data[key].text.toUpperCase()+'\r('+data[key].membre.prenom+')', + tags : {membre: data[key].membre.id} + }; }); - // }); + this.events = data; + console.log(data); + console.log(this.events); + }); } navigatePrevious(event: MouseEvent): void { From 284c9c2b9731b7e49ca24f3b61750d31c1281c25 Mon Sep 17 00:00:00 2001 From: Hedi MJID Date: Fri, 4 Mar 2022 14:44:31 +0100 Subject: [PATCH 11/22] calendrier : ajout de commentaires --- src/environments/environment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 63d46e1..bd6eab6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiUrl: 'http://localhost:8080', + apiUrl: 'http://localhost:8088', tokenKey: 'TOKEN-ORGANIZEE', debug: true, }; From 799c29e08f327b2b936423dfd97286a7d0f7039d Mon Sep 17 00:00:00 2001 From: Blandine Bajard <83599148+BlandineBajard@users.noreply.github.com> Date: Fri, 4 Mar 2022 15:40:26 +0100 Subject: [PATCH 12/22] menu update fixed --- src/app/components/card-menu/card-menu.component.html | 3 +++ .../page-forgot-password/page-forgot-password.component.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/card-menu/card-menu.component.html b/src/app/components/card-menu/card-menu.component.html index 5c4b597..b0990b1 100644 --- a/src/app/components/card-menu/card-menu.component.html +++ b/src/app/components/card-menu/card-menu.component.html @@ -99,6 +99,7 @@ class="form-control" formControlName="dateMenuFc" value="{{ menu.dateMenu }}" + [(ngModel)]="menu.dateMenu" placeholder="Date" name="date" /> @@ -107,6 +108,7 @@ class="form-control" formControlName="repasMidiFc" value="{{ menu.repasMidi }}" + [(ngModel)]="menu.repasMidi" placeholder="Repas du midi" name="repasMidi" /> @@ -115,6 +117,7 @@ class="form-control" formControlName="repasSoirFc" value="{{ menu.repasSoir }}" + [(ngModel)]="menu.repasSoir" placeholder="Repas du soir" name="repasSoir" /> diff --git a/src/app/pages/page-forgot-password/page-forgot-password.component.ts b/src/app/pages/page-forgot-password/page-forgot-password.component.ts index e10943a..5f60b51 100644 --- a/src/app/pages/page-forgot-password/page-forgot-password.component.ts +++ b/src/app/pages/page-forgot-password/page-forgot-password.component.ts @@ -63,7 +63,7 @@ export class PageForgotPasswordComponent implements OnInit { }) }, error: err => { - this.alert={"type":"danger", "content":"Le mail a merdé, ou il n'y a personne ds la bdd !"}; + this.alert={"type":"danger", "content":"Votre email est erroné"}; this.isShow = true; }, complete: () => console.log('DONE!') From 1191176e251f76d9d9c1104c8e9d69c64aa6785c Mon Sep 17 00:00:00 2001 From: Sana EL HIRI Date: Fri, 4 Mar 2022 15:50:51 +0100 Subject: [PATCH 13/22] =?UTF-8?q?avanc=C3=A9es=20=C3=A0=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../side-bar/side-bar.component.html | 10 +++++----- .../page-update-member.component.html | 20 +++++++++++++++++-- .../page-update-member.component.ts | 8 ++++++-- src/app/services/membre.service.ts | 13 ++++++++---- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/app/components/side-bar/side-bar.component.html b/src/app/components/side-bar/side-bar.component.html index 40e86e3..6e3baaf 100644 --- a/src/app/components/side-bar/side-bar.component.html +++ b/src/app/components/side-bar/side-bar.component.html @@ -1,12 +1,12 @@
@@ -27,6 +28,7 @@ name="lastName" formControlName="lastNameFc" value="{{membreInfos.nom}}" + [(ngModel)]="membreInfos.nom" />
@@ -39,6 +41,7 @@ name="firstName" formControlName="firstNameFc" value="{{membreInfos.prenom}}" + [(ngModel)]="membreInfos.prenom" />
@@ -51,6 +54,7 @@ name="dateNaissance" formControlName="dateNaissanceFc" value="{{membreInfos.dateNaissance}}" + [(ngModel)]="membreInfos.dateNaissance" /> @@ -76,17 +81,28 @@ name="Role" formControlName="roleFc" value="{{membreInfos.roleList}}" + [(ngModel)]="membreInfos.roleList" > - +
+ +
diff --git a/src/app/pages/page-update-member/page-update-member.component.ts b/src/app/pages/page-update-member/page-update-member.component.ts index 555f450..e97f81a 100644 --- a/src/app/pages/page-update-member/page-update-member.component.ts +++ b/src/app/pages/page-update-member/page-update-member.component.ts @@ -63,6 +63,7 @@ export class PageUpdateMemberComponent implements OnInit { /** Méthode qui initialise les champs du formulaire avec les infos de la BDD **/ private initForm(membre?: Membre): FormGroup { + return this.fb.group({ nom:[membre ? membre.nom : ''], prenom: [membre ? membre.prenom : ''], @@ -75,6 +76,7 @@ export class PageUpdateMemberComponent implements OnInit { }); } + /** Méthode qui envoie les champs modifiés pour mise à jour **/ public onSubmit(): void { const firstNameValue = this.updateMembreForm.value['firstNameFc']; @@ -98,8 +100,10 @@ export class PageUpdateMemberComponent implements OnInit { roleList: [roleValue] }; - this.membreService.updateMembre(membre).subscribe((resp) => { - this.router.navigate(['compte']); + console.log(membre); + + this.membreService.updateMembre(membre)?.subscribe((resp) => { + //this.router.navigate(['compte']); }); } diff --git a/src/app/services/membre.service.ts b/src/app/services/membre.service.ts index d721522..38d2567 100644 --- a/src/app/services/membre.service.ts +++ b/src/app/services/membre.service.ts @@ -48,8 +48,13 @@ export class MembreService { deleteMembre(membre: Membre): Observable { return this.http.delete(`${this.apiUrl}/membres/delete/1`); } - //modifier pour récupérer id et pas mettre un id par défaut - updateMembre(membre: Membre): Observable { - return this.http.put(`${this.apiUrl}/membres/update/1`, membre); - } + + updateMembre(membre: Membre): Observable | void { + const teamId = this.tokenService.getCurrentTeamId(); + if (teamId){ + return this.http.put(`${this.apiUrl}/membres/update/${teamId}/${membre.id}`, membre); + }else { + this.router.navigate(['accueil']); + } +} } From 48dedea6652a1f927de9ec8772c8a2c48cb737b0 Mon Sep 17 00:00:00 2001 From: Hedi MJID Date: Fri, 4 Mar 2022 15:54:34 +0100 Subject: [PATCH 14/22] calendrier : ajout du formulaire d'ajout de evenement --- src/app/app-routing.module.ts | 2 + src/app/app.module.ts | 4 +- .../page-agenda/page-agenda.component.html | 2 +- .../page-ajout-evenements.component.html | 48 +++++++++++++ .../page-ajout-evenements.component.scss | 0 .../page-ajout-evenements.component.spec.ts | 25 +++++++ .../page-ajout-evenements.component.ts | 67 +++++++++++++++++++ 7 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html create mode 100644 src/app/pages/page-ajout-evenements/page-ajout-evenements.component.scss create mode 100644 src/app/pages/page-ajout-evenements/page-ajout-evenements.component.spec.ts create mode 100644 src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d43e8ef..0b80815 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -22,6 +22,7 @@ import { PageUpdateMemberComponent } from './pages/page-update-member/page-updat import { PageSupportComponent } from './pages/page-support/page-support.component'; import { FooterComponent } from './components/footer/footer.component'; import { AuthGuard } from './auth.guard'; +import { PageAjoutEvenementsComponent } from './pages/page-ajout-evenements/page-ajout-evenements.component'; const routes: Routes = [ { path: '', redirectTo: 'accueil', pathMatch: 'full' }, @@ -45,6 +46,7 @@ const routes: Routes = [ { 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 }, ]; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2ea2f43..960f483 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -44,6 +44,7 @@ import { CardAvatarComponent } from './components/card-avatar/card-avatar.compon 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'; registerLocaleData(localeFr) @NgModule({ @@ -84,7 +85,8 @@ registerLocaleData(localeFr) CardAvatarComponent, DeconnexionComponent, HumeurComponent, - AlertComponent + AlertComponent, + PageAjoutEvenementsComponent ], imports: [ BrowserModule, diff --git a/src/app/pages/page-agenda/page-agenda.component.html b/src/app/pages/page-agenda/page-agenda.component.html index f71faf6..bd42f5a 100644 --- a/src/app/pages/page-agenda/page-agenda.component.html +++ b/src/app/pages/page-agenda/page-agenda.component.html @@ -66,7 +66,7 @@ Ajouter un évènement + +
+
+ +
+
+

Ajouter un évènement à l'agenda

+
+
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
+
+
+ \ No newline at end of file diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.scss b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.spec.ts b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.spec.ts new file mode 100644 index 0000000..e28926a --- /dev/null +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageAjoutEvenementsComponent } from './page-ajout-evenements.component'; + +describe('PageAjoutEvenementsComponent', () => { + let component: PageAjoutEvenementsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PageAjoutEvenementsComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PageAjoutEvenementsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 0000000..68d53a1 --- /dev/null +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts @@ -0,0 +1,67 @@ +import { Component, OnInit } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; +import { EvenementService } from 'src/app/services/evenement.service'; +import { TokenService } from 'src/app/services/token.service'; + +@Component({ + selector: 'app-page-ajout-evenements', + templateUrl: './page-ajout-evenements.component.html', + styleUrls: ['./page-ajout-evenements.component.scss'] +}) +export class PageAjoutEvenementsComponent implements OnInit { + public eventForm: FormGroup; + public userId : any; + public teamId : any; + public isShow: boolean; + public alert:any; + + constructor(private evenementService:EvenementService, private tokenService: TokenService, private router: Router,) { + this.eventForm = new FormGroup({}); + this.isShow = false; + this.alert = ""; + } + + ngOnInit(): void { + this.userId = this.tokenService.getCurrentMembreId(); + this.teamId = this.tokenService.getCurrentTeamId(); + + this.eventForm = new FormGroup({ + startFc : new FormControl(''), + endFc : new FormControl(''), + textFc : new FormControl('', [ Validators.required]) + }) + } + + public onSubmit(): void { + const startValue = this.eventForm.value['startFc']; + const endValue = this.eventForm.value['endFc']; + const textValue = this.eventForm.value['textFc']; + + const event = { + start: startValue, + end: endValue, + text: textValue, + id:"", + membre: {id:this.userId}, + team: {id:this.teamId} + } + + this.evenementService.addEvenements(event).subscribe({ + next: result => { + this.alert={"type":"success", "content":"L'évènement à été correctement ajouté au calendrier"}; + this.isShow = true; + }, + error: err => { + this.alert={"type":"danger", "content":"Problème lors de l'ajout de l'évenment"}; + this.isShow = true; + }, + complete: () => { + console.log('DONE!'); + this.router.navigate(['agenda']); + } + }); + + } + +} From 6a2ddf7fad6947c5f467ff24abf8d7391fb4944d Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Fri, 4 Mar 2022 16:17:28 +0100 Subject: [PATCH 15/22] dasboard css et update contact ngmodel --- .../card-avatar/card-avatar.component.html | 23 ++++++----- .../card-avatar/card-avatar.component.scss | 18 ++++----- .../page-dashboard.component.html | 39 +++++++++++-------- .../page-dashboard.component.scss | 35 +---------------- .../page-modifier-contact.component.html | 24 ++++++------ 5 files changed, 56 insertions(+), 83 deletions(-) diff --git a/src/app/components/card-avatar/card-avatar.component.html b/src/app/components/card-avatar/card-avatar.component.html index 4591621..d6969cb 100644 --- a/src/app/components/card-avatar/card-avatar.component.html +++ b/src/app/components/card-avatar/card-avatar.component.html @@ -1,13 +1,12 @@ -
-
-
-
- -
-
-

{{membre.prenom }} {{membre.nom }}

-
-
-
+
+ +
+
+
-
+ +
+
{{membre.prenom }} {{membre.nom }}
+
+ +
\ No newline at end of file diff --git a/src/app/components/card-avatar/card-avatar.component.scss b/src/app/components/card-avatar/card-avatar.component.scss index 91c7e56..86d9570 100644 --- a/src/app/components/card-avatar/card-avatar.component.scss +++ b/src/app/components/card-avatar/card-avatar.component.scss @@ -3,18 +3,14 @@ height: 60px; margin: 0 auto; background: black; - } -.card { - min-height: 8px; - border: none; - overflow: hidden; - border-radius: 8px; - justify-content: center; +.card-title{ + text-align: center; } - -h3 { - font-size: small; -} +.avatar{ + width: 150px; + height: 170px; + border-radius: 20px; +} \ No newline at end of file diff --git a/src/app/pages/page-dashboard/page-dashboard.component.html b/src/app/pages/page-dashboard/page-dashboard.component.html index 95545c6..6d627bb 100644 --- a/src/app/pages/page-dashboard/page-dashboard.component.html +++ b/src/app/pages/page-dashboard/page-dashboard.component.html @@ -2,30 +2,37 @@
-
-

Bienvenue {{ conectedUser.prenom }}!!

-
-
-
- -
-
- A venir +
+ +
+

Bienvenue {{ conectedUser.prenom }}!!

-
-
-
+
+ +
+
+ +
+
+ +
+ A venir +
+
-
-
- +
+
    +
  • + +
  • +
-
+
diff --git a/src/app/pages/page-dashboard/page-dashboard.component.scss b/src/app/pages/page-dashboard/page-dashboard.component.scss index d2d8bff..ba266b3 100644 --- a/src/app/pages/page-dashboard/page-dashboard.component.scss +++ b/src/app/pages/page-dashboard/page-dashboard.component.scss @@ -11,40 +11,9 @@ } .container { - display: flex; - padding: 20px; - -} - -button{ - margin-bottom: 5px; -} - -.calendrier{ - align-content: flex-end; -} - -#boxFour{ - height: 150px; - margin-top: -99px; - width: fit-content; -} - -#boxThree{ - margin-top: -85px; - height: 150px; - width: fit-content; -} - -#boxTwo{ - margin-top: 50px; - margin-left: 150px; - height: 50%; - width: fit-content; +margin-left:200px; } .avatar{ - margin-top: -50px; - justify-content: space-between; - margin: 0; + margin:O; } \ No newline at end of file diff --git a/src/app/pages/page-modifier-contact/page-modifier-contact.component.html b/src/app/pages/page-modifier-contact/page-modifier-contact.component.html index f518f82..9a52750 100644 --- a/src/app/pages/page-modifier-contact/page-modifier-contact.component.html +++ b/src/app/pages/page-modifier-contact/page-modifier-contact.component.html @@ -20,10 +20,10 @@ id="floatingInputlastName" placeholder="" name="lastName" - formControlName="lastNameFc" value= "{{ listContactInfo.nom }}"> + formControlName="lastNameFc" value= "{{ listContactInfo.nom }}" + [(ngModel)]="listContactInfo.nom"> -
+ formControlName="firstNameFc" value= "{{ listContactInfo.prenom }}" + [(ngModel)]="listContactInfo.prenom"> -
+ formControlName="telephoneFc" value= "{{ listContactInfo.telephone }}" + [(ngModel)]="listContactInfo.telephone"> -
+ formControlName="emailFc" value= "{{ listContactInfo.email }}" + [(ngModel)]="listContactInfo.email">
-
+ formControlName="dateNaissanceFc" + value= "{{ listContactInfo.dateNaissance }}" + [(ngModel)]="listContactInfo.dateNaissance">
-
+ formControlName="adresseFc" value= "{{ listContactInfo.adresse }}" + [(ngModel)]="listContactInfo.adresse">
From 42eff07067894aeafd4570a213a2168fad699035 Mon Sep 17 00:00:00 2001 From: Blandine Bajard <83599148+BlandineBajard@users.noreply.github.com> Date: Fri, 4 Mar 2022 16:39:56 +0100 Subject: [PATCH 16/22] menache --- src/app/app-routing.module.ts | 4 --- src/app/app.module.ts | 6 ----- .../pagination/pagination.component.html | 1 - .../pagination/pagination.component.scss | 0 .../pagination/pagination.component.spec.ts | 25 ------------------- .../pagination/pagination.component.ts | 15 ----------- .../page-account/page-account.component.html | 9 ++++--- .../page-agenda/page-agenda.component.html | 12 ++++++--- .../page-delete-account.component.html | 12 --------- .../page-delete-account.component.scss | 0 .../page-delete-account.component.spec.ts | 25 ------------------- .../page-delete-account.component.ts | 15 ----------- .../page-update-account.component.html | 11 -------- .../page-update-account.component.scss | 0 .../page-update-account.component.spec.ts | 25 ------------------- .../page-update-account.component.ts | 15 ----------- 16 files changed, 14 insertions(+), 161 deletions(-) delete mode 100644 src/app/components/pagination/pagination.component.html delete mode 100644 src/app/components/pagination/pagination.component.scss delete mode 100644 src/app/components/pagination/pagination.component.spec.ts delete mode 100644 src/app/components/pagination/pagination.component.ts delete mode 100644 src/app/pages/page-delete-account/page-delete-account.component.html delete mode 100644 src/app/pages/page-delete-account/page-delete-account.component.scss delete mode 100644 src/app/pages/page-delete-account/page-delete-account.component.spec.ts delete mode 100644 src/app/pages/page-delete-account/page-delete-account.component.ts delete mode 100644 src/app/pages/page-update-account/page-update-account.component.html delete mode 100644 src/app/pages/page-update-account/page-update-account.component.scss delete mode 100644 src/app/pages/page-update-account/page-update-account.component.spec.ts delete mode 100644 src/app/pages/page-update-account/page-update-account.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 85355fe..b4b104e 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,7 +7,6 @@ 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 { PageDeleteAccountComponent } from './pages/page-delete-account/page-delete-account.component'; import { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component'; import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component'; import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component'; @@ -17,7 +16,6 @@ import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component'; import { PageSignupComponent } from './pages/page-signup/page-signup.component'; import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component'; -import { PageUpdateAccountComponent } from './pages/page-update-account/page-update-account.component'; import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component'; import { PageSupportComponent } from './pages/page-support/page-support.component'; import { FooterComponent } from './components/footer/footer.component'; @@ -33,7 +31,6 @@ const routes: Routes = [ { path: 'agenda', canActivate: [AuthGuard], component: PageAgendaComponent }, { path: 'tableau-de-bord', canActivate: [AuthGuard], component: PageDashboardComponent }, { path: 'supprimer-membre', canActivate: [AuthGuard], component: PageDeleteMemberComponent }, - { path: 'supprimer-compte', canActivate: [AuthGuard], component: PageDeleteAccountComponent }, { path: 'password-oublie', component: PageForgotPasswordComponent }, { path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent }, { path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent }, @@ -42,7 +39,6 @@ const routes: Routes = [ { path: 'page-support', component: PageSupportComponent}, { path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent }, { path: 'modifier-membre/:id', canActivate: [AuthGuard], component: PageUpdateMemberComponent }, - { path: 'modifier-compte', canActivate: [AuthGuard], component: PageUpdateAccountComponent }, { path: 'ajouter-contact', canActivate: [AuthGuard], component: PageAjoutContactComponent }, { path: 'creation-team', canActivate: [AuthGuard], component: PageCreationTeamComponent }, { path: 'footer', component: FooterComponent}, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 960f483..6fe94e6 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,7 +26,6 @@ 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 { PaginationComponent } from './components/pagination/pagination.component'; import { CreneauComponent } from './components/creneau/creneau.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; @@ -35,8 +34,6 @@ import { PageModifierContactComponent } from './pages/page-modifier-contact/page 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 { PageDeleteAccountComponent } from './pages/page-delete-account/page-delete-account.component'; -import { PageUpdateAccountComponent } from './pages/page-update-account/page-update-account.component'; import { DayPilot, DayPilotModule } from "@daypilot/daypilot-lite-angular"; import { registerLocaleData } from '@angular/common'; import localeFr from '@angular/common/locales/fr'; @@ -74,14 +71,11 @@ registerLocaleData(localeFr) TacheComponent, CardMenuComponent, FicheContactComponent, - PaginationComponent, CreneauComponent, PageAjoutContactComponent, PageModifierContactComponent, PageCreationTeamComponent, FooterComponent, - PageDeleteAccountComponent, - PageUpdateAccountComponent, CardAvatarComponent, DeconnexionComponent, HumeurComponent, diff --git a/src/app/components/pagination/pagination.component.html b/src/app/components/pagination/pagination.component.html deleted file mode 100644 index 59b8a74..0000000 --- a/src/app/components/pagination/pagination.component.html +++ /dev/null @@ -1 +0,0 @@ -

pagination works!

diff --git a/src/app/components/pagination/pagination.component.scss b/src/app/components/pagination/pagination.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/components/pagination/pagination.component.spec.ts b/src/app/components/pagination/pagination.component.spec.ts deleted file mode 100644 index 258ba5c..0000000 --- a/src/app/components/pagination/pagination.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PaginationComponent } from './pagination.component'; - -describe('PaginationComponent', () => { - let component: PaginationComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PaginationComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(PaginationComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/pagination/pagination.component.ts b/src/app/components/pagination/pagination.component.ts deleted file mode 100644 index 35d2bcb..0000000 --- a/src/app/components/pagination/pagination.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-pagination', - templateUrl: './pagination.component.html', - styleUrls: ['./pagination.component.scss'] -}) -export class PaginationComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/pages/page-account/page-account.component.html b/src/app/pages/page-account/page-account.component.html index 14bd38e..0c04504 100644 --- a/src/app/pages/page-account/page-account.component.html +++ b/src/app/pages/page-account/page-account.component.html @@ -3,7 +3,7 @@
-

{{currentTeam.nom}}

+

{{ currentTeam.nom }}

@@ -11,12 +11,13 @@
@@ -26,7 +27,7 @@ -
+
diff --git a/src/app/pages/page-agenda/page-agenda.component.html b/src/app/pages/page-agenda/page-agenda.component.html index bd42f5a..3c9228b 100644 --- a/src/app/pages/page-agenda/page-agenda.component.html +++ b/src/app/pages/page-agenda/page-agenda.component.html @@ -1,7 +1,11 @@ - + - team : {{ teamId }} - user: {{ userId }} - role: {{ role }} + team : {{ teamId }} - user: {{ userId }} - role: {{ role }} -
-
- -
-
-

Supprimer votre compte

-
- -
-
-
diff --git a/src/app/pages/page-delete-account/page-delete-account.component.scss b/src/app/pages/page-delete-account/page-delete-account.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/page-delete-account/page-delete-account.component.spec.ts b/src/app/pages/page-delete-account/page-delete-account.component.spec.ts deleted file mode 100644 index 1515cf6..0000000 --- a/src/app/pages/page-delete-account/page-delete-account.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PageDeleteAccountComponent } from './page-delete-account.component'; - -describe('PageDeleteAccountComponent', () => { - let component: PageDeleteAccountComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PageDeleteAccountComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(PageDeleteAccountComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/page-delete-account/page-delete-account.component.ts b/src/app/pages/page-delete-account/page-delete-account.component.ts deleted file mode 100644 index 0388cf0..0000000 --- a/src/app/pages/page-delete-account/page-delete-account.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-page-delete-account', - templateUrl: './page-delete-account.component.html', - styleUrls: ['./page-delete-account.component.scss'] -}) -export class PageDeleteAccountComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/pages/page-update-account/page-update-account.component.html b/src/app/pages/page-update-account/page-update-account.component.html deleted file mode 100644 index 2c307c2..0000000 --- a/src/app/pages/page-update-account/page-update-account.component.html +++ /dev/null @@ -1,11 +0,0 @@ - - -
-
- -
-
-

Modifier votre compte

-
-
-
diff --git a/src/app/pages/page-update-account/page-update-account.component.scss b/src/app/pages/page-update-account/page-update-account.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/page-update-account/page-update-account.component.spec.ts b/src/app/pages/page-update-account/page-update-account.component.spec.ts deleted file mode 100644 index d65402a..0000000 --- a/src/app/pages/page-update-account/page-update-account.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PageUpdateAccountComponent } from './page-update-account.component'; - -describe('PageUpdateAccountComponent', () => { - let component: PageUpdateAccountComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PageUpdateAccountComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(PageUpdateAccountComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/page-update-account/page-update-account.component.ts b/src/app/pages/page-update-account/page-update-account.component.ts deleted file mode 100644 index 4fcb39b..0000000 --- a/src/app/pages/page-update-account/page-update-account.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-page-update-account', - templateUrl: './page-update-account.component.html', - styleUrls: ['./page-update-account.component.scss'] -}) -export class PageUpdateAccountComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} From 7955ccad42d73f512429d49c3598bb9f3cf9aacb Mon Sep 17 00:00:00 2001 From: HarmandI Date: Sat, 5 Mar 2022 09:21:00 +0100 Subject: [PATCH 17/22] 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 18/22] 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 19/22] 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 21/22] 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; - } }