Merge branch 'dev' into cecile

This commit is contained in:
AlineRinquin 2022-02-18 10:39:22 +01:00 committed by GitHub
commit 6504d28c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 3557 additions and 2862 deletions

4500
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@
"@angular/router": "~13.0.0", "@angular/router": "~13.0.0",
"@ng-bootstrap/ng-bootstrap": "^12.0.0", "@ng-bootstrap/ng-bootstrap": "^12.0.0",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"bootstrap-icons": "^1.8.1",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"ngx-autofocus-fix": "^1.0.4", "ngx-autofocus-fix": "^1.0.4",
"rxjs": "~7.4.0", "rxjs": "~7.4.0",

View File

@ -7,6 +7,7 @@ import { PageAgendaComponent } from './pages/page-agenda/page-agenda.component';
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component'; import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component'; import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.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 { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component';
import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component'; import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component';
import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component'; import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component';
@ -17,6 +18,7 @@ import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire
import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component'; import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component';
import { PageSignupComponent } from './pages/page-signup/page-signup.component'; import { PageSignupComponent } from './pages/page-signup/page-signup.component';
import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.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 { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component';
import { FooterComponent } from './components/footer/footer.component'; import { FooterComponent } from './components/footer/footer.component';
@ -29,6 +31,7 @@ const routes: Routes = [
{ path: 'agenda', component: PageAgendaComponent }, { path: 'agenda', component: PageAgendaComponent },
{ path: 'tableau-de-bord', component: PageDashboardComponent }, { path: 'tableau-de-bord', component: PageDashboardComponent },
{ path: 'supprimer-membre', component: PageDeleteMemberComponent }, { path: 'supprimer-membre', component: PageDeleteMemberComponent },
{ path: 'supprimer-compte', component: PageDeleteAccountComponent },
{ path: 'password-oublie', component: PageForgotPasswordComponent }, { path: 'password-oublie', component: PageForgotPasswordComponent },
{ path: 'menu', component: PageMenuSemaineComponent }, { path: 'menu', component: PageMenuSemaineComponent },
{ path: 'repertoire', component: PageRepertoireComponent }, { path: 'repertoire', component: PageRepertoireComponent },
@ -36,6 +39,7 @@ const routes: Routes = [
{ path: 'creation-compte', component: PageSignupComponent }, { path: 'creation-compte', component: PageSignupComponent },
{ path: 'to-do-list', component: PageToDoListComponent }, { path: 'to-do-list', component: PageToDoListComponent },
{ path: 'modifier-membre', component: PageUpdateMemberComponent }, { path: 'modifier-membre', component: PageUpdateMemberComponent },
{ path: 'modifier-compte', component: PageUpdateAccountComponent },
{ path: 'ajouter-contact', component: PageAjoutContactComponent }, { path: 'ajouter-contact', component: PageAjoutContactComponent },
{ path: 'creation-team', component: PageCreationTeamComponent }, { path: 'creation-team', component: PageCreationTeamComponent },
{ path: 'humeur', component: PageHumeurComponent }, { path: 'humeur', component: PageHumeurComponent },

View File

@ -22,7 +22,6 @@ import { SigninComponent } from './components/signin/signin.component';
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component'; import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
import { MeteoComponent } from './components/meteo/meteo.component'; import { MeteoComponent } from './components/meteo/meteo.component';
import { CalendrierComponent } from './components/calendrier/calendrier.component'; import { CalendrierComponent } from './components/calendrier/calendrier.component';
import { AvatarComponent } from './components/avatar/avatar.component';
import { CardMemberComponent } from './components/card-member/card-member.component'; import { CardMemberComponent } from './components/card-member/card-member.component';
import { ToDoListComponent } from './components/to-do-list/to-do-list.component'; import { ToDoListComponent } from './components/to-do-list/to-do-list.component';
import { TacheComponent } from './components/tache/tache.component'; import { TacheComponent } from './components/tache/tache.component';
@ -31,13 +30,16 @@ import { FicheContactComponent } from './components/fiche-contact/fiche-contact.
import { PaginationComponent } from './components/pagination/pagination.component'; import { PaginationComponent } from './components/pagination/pagination.component';
import { CreneauComponent } from './components/creneau/creneau.component'; import { CreneauComponent } from './components/creneau/creneau.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component'; import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component'; import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component';
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component'; import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
import { AutofocusFixModule } from 'ngx-autofocus-fix'; import { AutofocusFixModule } from 'ngx-autofocus-fix';
import { PageHumeurComponent } from './pages/page-humeur/page-humeur.component'; import { PageHumeurComponent } from './pages/page-humeur/page-humeur.component';
import { FooterComponent } from './components/footer/footer.component'; 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 { EmoticonComponent } from './emoticon/emoticon.component';
@ -64,7 +66,6 @@ import { FooterComponent } from './components/footer/footer.component';
MeteoComponent, MeteoComponent,
PageHumeurComponent, PageHumeurComponent,
CalendrierComponent, CalendrierComponent,
AvatarComponent,
CardMemberComponent, CardMemberComponent,
ToDoListComponent, ToDoListComponent,
TacheComponent, TacheComponent,
@ -77,6 +78,9 @@ import { FooterComponent } from './components/footer/footer.component';
PageCreationTeamComponent, PageCreationTeamComponent,
PageHumeurComponent, PageHumeurComponent,
FooterComponent, FooterComponent,
PageDeleteAccountComponent,
PageUpdateAccountComponent,
EmoticonComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -86,7 +90,9 @@ import { FooterComponent } from './components/footer/footer.component';
FormsModule, FormsModule,
// AutofocusFixModule.forRoot(), // AutofocusFixModule.forRoot(),
], ],
providers: [], providers: [
],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })
export class AppModule {} export class AppModule {}

View File

@ -1 +0,0 @@
<p>avatar works!</p>

View File

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-avatar',
templateUrl: './avatar.component.html',
styleUrls: ['./avatar.component.scss']
})
export class AvatarComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@ -1 +1,23 @@
<p>card-member works!</p> <div class="container mt-5 membre">
<div class="row d-flex justify-content-center">
<div class="col-md-auto">
<div class="card p-3 py-4 align-items">
<!-- récuperer couleur du back-->
<div class="text-center"><div class="rounded-circle"id="couleur"[style.background-color]="membre.couleur"></div></div>
<div class="text-center mt-3">
<h3 class="mt-2 mb-0">{{membre.prenom }} {{membre.nom }}</h3>
<div class="buttons text-center"><button button type="button" class="btn btn-outline-primary px-4"
routerLink="../modifier-membre"
routerLinkActive="active-custom">
Modifier
</button><button button type="button" class="btn btn-primary px-4"
routerLink="../supprimer-membre"
routerLinkActive="active-custom">
Supprimer
</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,56 @@
#couleur{
width: 100px;
height: 100px;
margin: 0 auto;
background: black;
}
.card {
min-height: 22rem;
border: none;
position: relative;
overflow: hidden;
border-radius: 8px;
cursor: pointer
}
.fonts {
font-size: 11px
}
.buttons button:nth-child(1) {
margin-top: 5px;
border: 1px solid #7879F1 !important;
color: #7879F1;
height: 40px;
width: 150px;
}
.buttons button:nth-child(1):hover {
margin-top: 5px;
border: 1px solid #7879F1 !important;
color: #fff;
height: 40px;
width: 150px;
background-color: #7879F1
}
.buttons button:nth-child(2) {
margin-top: 5px;
border: 1px solid #7879F1 !important;
background-color: #7879F1;
color: #fff;
height: 40px;
width: 150px;
}
.buttons button:nth-child(2):hover {
margin-top: 5px;
border: 1px solid #bd4646 !important;
background-color: #bd4646;
color: #fff;
height: 40px;
width: 150px;
}

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
@Component({ @Component({
selector: 'app-card-member', selector: 'app-card-member',
@ -6,10 +6,12 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./card-member.component.scss'] styleUrls: ['./card-member.component.scss']
}) })
export class CardMemberComponent implements OnInit { export class CardMemberComponent implements OnInit {
@Input() membre: any;
constructor() { } constructor() { }
ngOnInit(): void { ngOnInit(): void {
} }
} }

View File

@ -1 +1,46 @@
<p>card-menu works!</p> <div class="menu">
<div *ngFor="let menu of listMenus">
<p>{{ menu.dateMenu }} {{ menu.libelle }}</p>
</div>
<ng-template #content let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">
Ajouter un menu
</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">
×
</span>
</button>
</div>
<div class="modal-body">
<form [formGroup]="menuForm">
<div class="form-group">
<label for="dateMenu">
Date
</label>
<div class="input-group">
<input id="dateMenu" class="form-control" formControlName="dateMenuFc" placeholder="yyyy-mm-dd" name="date"
>
<input id="libelle" class="form-control" formControlName="libelleFc" placeholder="" name="libelle"
>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-dark" (click)="modal.close(saveMenu())">
Save
</button>
</div>
</ng-template>
<button class="btn btn-lg btn-outline-primary" (click)="open(content)">
Ajouter un menu
</button>
</div>

View File

@ -0,0 +1,3 @@
.menu {
margin-left: 500px;
}

View File

@ -1,4 +1,16 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Menu } from 'src/app/models/menu';
import { MenusService } from 'src/app/services/menus.service';
import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
import {
FormBuilder,
FormControl,
FormGroup,
Validators,
} from '@angular/forms';
@Component({ @Component({
selector: 'app-card-menu', selector: 'app-card-menu',
@ -6,10 +18,92 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./card-menu.component.scss'] styleUrls: ['./card-menu.component.scss']
}) })
export class CardMenuComponent implements OnInit { export class CardMenuComponent implements OnInit {
closeResult = '';
public listMenus:any[];
public menuId : any;
public menuForm : FormGroup;
constructor(
private menusService: MenusService,
private router: Router,
private route: ActivatedRoute,
private modalService: NgbModal,
private fb: FormBuilder
) {
this.listMenus=[];
this.menuId=0;
this.menuForm = new FormGroup({});
}
//ajout d'un menu
saveMenu(): void {
const dateValue = this.menuForm.value['dateMenuFc'];
const libelleValue = this.menuForm.value['libelleFc'];
const menu: Menu = {
dateMenu: dateValue,
libelle: libelleValue,
};
// if (menu.dateMenu != undefined && menu.libelle != '') {
console.log(dateValue);
this.menusService.addMenu(menu)?.subscribe((resp) => {
this.router.navigate(['menu']);
});
// } else {
// this.router.navigate(['menu']);
// }
}
constructor() { }
ngOnInit(): void { ngOnInit(): void {
//affichage des menus d'une team
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
console.log(listMenus);
this.listMenus=listMenus;
});
this.menuForm = this.fb.group(
{
dateMenuFc: new FormControl('',[Validators.required]),
libelleFc: new FormControl('',[Validators.required]),
}
);
} }
open(content: any) {
this.modalService.open(content,
{ariaLabelledBy: 'menu'}).result.then((result)=> {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult =
`Dismissed ${this.getDismissReason(reason)}`;
});
}
private getDismissReason(reason: any): string {
if (reason === ModalDismissReasons.ESC) {
return 'by pressing ESC';
} else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
return 'by clicking on a backdrop';
} else {
return `with: ${reason}`;
}
}
} }
//modif d'un menu
// this.menuId=this.route.snapshot.paramMap.get('id');
// this.menusService.getMenuById(this.menuId)
// .subscribe((this.listMenus:any)=>)
//delete d'un menu

View File

@ -1,29 +1,43 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-sm"> <div class="row d-flex justify-content-end align-items-center flex-row">
<button routerLink="../modifier-contact/{{personne.id}}" class="w-100 btn btn-lg btn-rounded btn-secondary"> <div class="couleur col-7" [style.background-color]="personne.couleur"></div>
Modifier <div class="col-5">
</button> <div class="col">
</div> <button routerLink="../modifier-contact/{{personne.id}}"
<div class="col-sm"> class=" btn btn-sm btn-rounded btn-secondary mb-2">
<button class="w-100 btn btn-lg btn-rounded btn-secondary"> Modifier
Supprimer </button>
</button> </div>
</div> <div class="col">
<div class="row align-items-center"> <button class=" btn btn-sm btn-rounded btn-secondary" (click)="onClickDelete(personne.id)">
<div class="col-md-6 offset-md-3"> Supprimer
<img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/contact-1.png"/> </button>
<p class="fiche-contact" >{{ personne.prenom }} {{ personne.nom }}</p> </div>
<p class="fiche-contact" ><img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/phone.png"/> </div>
{{ personne.telephone }}</p> </div>
<p class="fiche-contact" ><img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/logo-gmail.png"/> <div class="row align-items-center">
{{ personne.email }}</p> <div class="col-md-12">
<p class="fiche-contact" ><img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/gateau.png"/> <div class="row my-3 d-flex justify-content-center flex-row">
{{ personne.dateNaissance }}</p> <span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }} </span>
<p class="fiche-contact" > </div>
{{ personne.adresse }}</p> <div class="row my-3 d-flex justify-content-center flex-row">
<span i class="col-4 bi bi-telephone-inbound"></span>
<span class="fiche-contact col-7">{{ personne.telephone }}</span>
</div>
<div class="row my-3 d-flex justify-content-center flex-row">
<i class="col-4 bi bi-envelope"></i>
<span class="fiche-contact col-7">{{ personne.email }}</span>
</div>
<div class="row my-3 d-flex justify-content-center flex-row">
<i class="col-4 bi bi-calendar-heart"></i>
<span class="fiche-contact col-7">{{ personne.dateNaissance }}</span>
</div>
<div class="row my-3 d-flex justify-content-center flex-row">
<i class="col-4 bi bi-map"></i>
<span class="fiche-contact col-7">{{ personne.adresse }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,10 +1,26 @@
.btn-secondary { .btn-secondary {
color: #fff; color: #fff;
background-color: #5a1e63 !important; background-color: #5a1e63 !important;
width: 100%; min-width: 100px;
max-width: 150px; border-radius: 55px;
padding: 15px; }
margin: auto;
.couleur{
border: none;
border-radius: 50%;
width: 110px;
height: 110px;
}
.info{
display:flex;
justify-content: center;
}
.fiche-contact{
display:flex;
justify-content: center;
flex-direction: row;
} }
.container { .container {

View File

@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
@Component({ @Component({
selector: 'app-fiche-contact', selector: 'app-fiche-contact',
@ -7,8 +7,14 @@ import { Component, Input, OnInit } from '@angular/core';
}) })
export class FicheContactComponent implements OnInit { export class FicheContactComponent implements OnInit {
@Input() personne: any; @Input() personne: any;
@Output() clickDelete = new EventEmitter();
constructor() {} constructor() {}
ngOnInit(): void {} ngOnInit(): void {}
onClickDelete(numPerson: number){
window.alert("Le contact à bien été supprimé!")
this.clickDelete.emit(numPerson);
}
} }

View File

@ -1,7 +1,4 @@
<div class="meteo"> <div class="meteo">
<input type="text" id="ville"> <iframe id="widget_autocomplete_preview" width="400" height="150" frameborder="1" border-radius="5"
<label for="ville">Entrez votre code postal</label>
<button id="meteo-button">Ok !</button>
<iframe id="widget_autocomplete_preview" width="150" height="300" frameborder="0"
src="https://meteofrance.com/widget/prevision/751010"> </iframe> src="https://meteofrance.com/widget/prevision/751010"> </iframe>
</div> </div>

View File

@ -1,11 +1,29 @@
<nav class="custom-side-bar flex-shrink-0 bg-white border-end"> <nav class="wrapper md-auto position-fixed ">
<div id="navbarNavAltMarkup"> <ul class="nav flex-column" id="sticky-sidebar">
<div class="navbar-nav"> <li class="nav-item" ngbNavItem="maTeam" >
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a> <a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</a> <i class="bi bi-people-fill"></i>
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">To-Do-List</a> Ma Team</a>
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a> </li>
<li class="nav-item">
</div> <a routerLink="/repertoire" routerLinkActive="active-custom" class="nav-link">
</div> <i class="bi bi-person-rolodex"></i>
Répertoire</a>
</li>
<li class="nav-item">
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">
<i class="bi bi-check2-square"></i>
To-Do-List</a>
</li>
<li class="nav-item">
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">
<i class='fas fa-pizza-slice'></i>
Menus</a>
</li>
<li class="nav-item">
<a routerLink="../agenda" routerLinkActive="active-custom" class="nav-link">
<i class="bi bi-calendar-event"></i>
Agenda</a>
</li>
</ul>
</nav> </nav>

View File

@ -0,0 +1,23 @@
.wrapper {
display: flex;
flex-direction: column;
align-items: left;
width: auto;
height: 100%;
position: absolute;
background-color: rgb(238, 238, 238);
}
.nav{
margin-top: 20px;
align-items: left;
}
li {
margin-bottom: 5px;
}
a{
color: black;
font-weight: bold;
}

View File

@ -1,40 +1,55 @@
<input
type="text"
class="todo-title"
placeholder="Titre"
value = "{{todo.nom}}"
/>
<div>
<button (click)="effacerList()">Effacer la To Do List</button>
</div>
<input <input
type="text" type="text"
class="todo-input" class="todo-input"
placeholder="Ajoute une nouvelle Tâche" placeholder="+ Nouvelle Tâche"
[(ngModel)]="todoTitle" [(ngModel)]="todoTitle"
(keyup.enter)="addTitle()" (keyup.enter)="addTache(todo.id)"
/> />
<div class="element" *ngFor="let todo of todosFilter()">
<div class="element" *ngFor="let tache of todo.taches">
<div class="element-gauche"> <div class="element-gauche">
<input <input
type="checkbox" type="checkbox"
[(ngModel)]="todo.completed" [(ngModel)]="tache.etat"
(change)="doneEdit(todo)" (change)="doneEdit(tache)"
checked="checked"
/> />
<div <div
*ngIf="!todo.editing; else editingTodo" *ngIf="!tache.editing; else editingTodo"
class="nomTache" class="nomTache"
[ngClass]="{ completed: todo.completed }" [ngClass]="{ completed: tache.etat }"
(dblclick)="modifier(todo)" (dblclick)="modifier(tache)"
> >
{{ todo.title }} {{ tache.texte }}
</div> </div>
<ng-template #editingTodo> <ng-template #editingTodo>
<input <input
type="text" type="text"
class="modifier-element" class="modifier-element"
[(ngModel)]="todo.title" [(ngModel)]="tache.texte"
(blur)="doneEdit(todo)" (blur)="doneEdit(tache)"
(keyup.enter)="doneEdit(todo)" (keyup.enter)="doneEdit(tache)"
(keyup.esc)="cancelEdit(todo)" (keyup.esc)="cancelEdit(tache)"
autofocus autofocus
/> />
</ng-template> </ng-template>
</div> </div>
<div class="deleteTache" (click)="deleteTodo(todo.id)">&times;</div> <div class="deleteTache" (click)="deleteTodo(tache.id)">&times;</div>
</div> </div>
<div class="extra-container"> <div class="extra-container">
<div> <div>
<label <label
@ -48,7 +63,7 @@
<div>{{ toDoRest() }} tâches</div> <div>{{ toDoRest() }} tâches</div>
</div> </div>
<div class="extra-container"> <div class="extra-container">
<div> <!-- <div>
<button [ngClass]="{ active: filter === 'tous' }" (click)="filter = 'tous'"> <button [ngClass]="{ active: filter === 'tous' }" (click)="filter = 'tous'">
Toutes la To Do List Toutes la To Do List
</button> </button>
@ -65,8 +80,6 @@
Terminées Terminées
</button> </button>
</div> </div>
-->
<div>
<button (click)="effacerList()">Effacer la To Do List</button>
</div>
</div> </div>

View File

@ -1,5 +1,15 @@
.todo-title {
width: 25%;
padding: 10px 18px;
font-size: xx-large;
margin-bottom: 16px;
&:focus {
outline: 0;
}
}
.todo-input { .todo-input {
width: 100%; width: 20%;
padding: 10px 18px; padding: 10px 18px;
font-size: 18px; font-size: 18px;
margin-bottom: 16px; margin-bottom: 16px;
@ -7,6 +17,8 @@
outline: 0; outline: 0;
} }
} }
.element { .element {
margin-bottom: 12px; margin-bottom: 12px;
display: flex; display: flex;
@ -16,6 +28,7 @@
} }
.deleteTache { .deleteTache {
width: 75%;
cursor: pointer; cursor: pointer;
margin-left: 14px; margin-left: 14px;
&:hover { &:hover {
@ -40,11 +53,12 @@
margin-left: 12px; margin-left: 12px;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
border: 1px solid #ccc; //override defaults border: 1px solid rgb(204, 204, 204); //override defaults
font-family: 'Avenir', Helvetica, Arial, sans-serif; font-family: 'Avenir', Helvetica, Arial, sans-serif;
&:focus { &:focus {
outline: none; outline: none;
background-color:aquamarine;
} }
} }
@ -53,15 +67,6 @@
color: grey; color: grey;
} }
.extra-container {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 16px;
border-top: 1px solid lightgrey;
padding-top: 14px;
margin-bottom: 14px;
}
button { button {
font-size: 14px; font-size: 14px;

View File

@ -1,5 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Todo } from 'src/app/interfaces/todo'; 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({ @Component({
selector: 'app-to-do-list', selector: 'app-to-do-list',
@ -7,22 +11,26 @@ import { Todo } from 'src/app/interfaces/todo';
styleUrls: ['./to-do-list.component.scss'], styleUrls: ['./to-do-list.component.scss'],
}) })
export class ToDoListComponent implements OnInit { export class ToDoListComponent implements OnInit {
@Input() todo!: ToDoList;
public beforeEditCache: string; public beforeEditCache: string;
public todos: Todo[]; //public todos: ToDoList[];
public todoTitle: string; public todoTitle: string;
public idTodo: number; public idTodo: number;
public filter : string; public filter : string;
public casesRestantes : boolean; public casesRestantes : boolean;
public masterSelected: boolean; public masterSelected: boolean;
public result : any;
public tache : Tache [];
constructor() { constructor(private TodoService : TodoService, private router: Router ) {
this.beforeEditCache = ''; this.beforeEditCache = '';
this.todos = []; //this.todos = [];
this.todoTitle = ''; this.todoTitle = '';
this.idTodo = 0; this.idTodo = 0;
this.filter =''; this.filter ='';
this.casesRestantes=true; this.casesRestantes=true;
this.masterSelected= false; this.masterSelected= false;
this.tache = [];
} }
ngOnInit(): void { ngOnInit(): void {
@ -31,89 +39,83 @@ export class ToDoListComponent implements OnInit {
this.filter='tous'; this.filter='tous';
this.idTodo = 4; this.idTodo = 4;
this.todoTitle = ''; this.todoTitle = '';
this.todos = [
{
id: 1,
title: 'Finish Angular Screencast',
completed: false,
editing: false,
},
{
id: 2,
title: 'Take over world',
completed: false,
editing: false,
},
{
id: 3,
title: 'One more thing',
completed: false,
editing: false,
},
];
} }
//ajouter tache //ajouter tache
addTitle(): void {
if (this.todoTitle.trim().length === 0) { addTache(idTodoList : number) {//idTodoList id que la todoList que l'on récupère
return; console.log(idTodoList);
const tache: Tache = {
id : 0,
texte: this.todoTitle,
etat : false,
editing : false,
} }
console.log(this.tache);
this.todos.push({ this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
id: this.idTodo, window.location.reload();
title: this.todoTitle, })
completed: false,
editing: false,
});
this.todoTitle = '';
this.idTodo++;
} }
//modifier la tâche
modifier(todo: Todo): void {
this.beforeEditCache = todo.title; //modifier par l'input
todo.editing = true; modifier(tache: Tache): void {
this.beforeEditCache = tache.texte;
tache.editing = true;
} }
// modifier l'apparence focus // ajouter la modification dans la liste
doneEdit(todo: Todo): void { doneEdit(tache: Tache): void {
if (todo.title.trim().length === 0) { if (tache.texte.trim().length === 0) {
todo.title = this.beforeEditCache; tache.texte = this.beforeEditCache;
} }
this.casesRestantes= this.casesQuiRestes(); this.casesRestantes= this.casesQuiRestes();
todo.editing = false; tache.editing = false;
this.TodoService.updateTache(tache).subscribe((resp)=>{
console.log(tache);
window.location.reload();
})
} }
// annuler la modification // annuler la modification
cancelEdit(todo: Todo): void { cancelEdit(tache: Tache): void {
todo.title = this.beforeEditCache; tache.texte = this.beforeEditCache;
todo.editing = false; tache.editing = false;
} }
//supprimer la tache //supprimer la tache
deleteTodo(id: number): void { deleteTodo(id: number) {
this.todos = this.todos.filter((todo) => todo.id !== id); this.TodoService.deleteTacheById(id).subscribe(
} resp =>{
window.location.reload();
}
);}
//nombre de tâches restantes //nombre de tâches restantes
toDoRest(): number{ toDoRest(): number{
return this.todos.filter(todo=> !todo.completed).length; return this.todo.taches.filter((tache: Tache)=> !tache.etat).length;
} }
//Cocher toutes les tâches de la liste //Cocher toutes les tâches de la liste
listComplete(): boolean { listComplete(): boolean {
return this.todos.filter(todo=> todo.completed).length>0; return this.todo.taches.filter((tache: Tache)=> tache).length>0;
} }
//Effacer la to do list //Effacer la to do list
effacerList(): void { effacerList(): void {
this.todos = []; //this.todo = [];
} }
//cocher toutes les cases de la todoList //cocher toutes les cases de la todoList
cocherAllTodoList(): void { cocherAllTodoList(): void {
for (var i = 0; i < this.todos.length; i++) { for (var i = 0; i < this.todo.taches.length; i++) {
this.todos[i].completed = this.masterSelected; this.todo.taches[i].etat = this.masterSelected;
} }
this.cocherAllTodoList(); this.cocherAllTodoList();
} }
@ -123,16 +125,16 @@ export class ToDoListComponent implements OnInit {
} }
//barre de filtre des tâches //barre de filtre des tâches
todosFilter(): Todo[] { /* todosFilter(): ToDoList[] {
if(this.filter === 'tous'){ if(this.filter === 'tous'){
return this.todos return this.todo.taches
}else if (this.filter === 'active'){ }else if (this.filter === 'active'){
return this.todos.filter(todo=> !todo.completed) return this.todo.taches.filter((tache: Tache)=> !tache.etat)
}else if (this.filter === 'complete'){ }else if (this.filter === 'complete'){
return this.todos.filter(todo=>todo.completed) return this.todo.taches.filter((tache: Tache)=>tache.etat)
}
return this.todos
} }
return this.todo
} */
} }

View File

@ -1,7 +1,7 @@
export interface Todo { export interface Todo {
id : number, id : number,
title : string, texte : string,
completed: boolean, etat: boolean,
editing: boolean // todoListId: number // FK
} }

View File

@ -1,5 +1,6 @@
export interface Contact { export interface Contact {
id: string; id: string;
couleur: string;
nom: string; nom: string;
prenom: string; prenom: string;
telephone: string; telephone: string;

View File

@ -4,7 +4,4 @@ import { Team } from './team';
export interface Menu { export interface Menu {
libelle: string; libelle: string;
dateMenu: Date; dateMenu: Date;
membre: Membre;
team: Team;
validationProposition: boolean;
} }

10
src/app/models/tache.ts Normal file
View File

@ -0,0 +1,10 @@
import { ToDoList } from './to-do-list';
export interface Tache {
id : number,
texte: string,
etat : boolean,
editing : boolean
}

View File

@ -1,7 +1,11 @@
import { Tache } from './tache';
import { Team } from './team'; import { Team } from './team';
export interface ToDoList { export interface ToDoList {
nom: string; nom: string;
team: Team; team: Team;
tache: string; taches: Tache [];
id:number;
} }

View File

@ -1,7 +1,31 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <div class="container-fluid">
<div class="d-flex justify-content-center"> <div class="row">
<button button type="button" class="btn btn-primary btn-lg" <app-side-bar></app-side-bar>
routerLink="../creation-team" <div class="col-9 offset-2" id="main">
routerLinkActive="active-custom">Créer ma team</button> <h1>Ma team</h1>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../modifier-compte"
routerLinkActive="active-custom">Modifier mon compte</button>
</div>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../supprimer-compte"
routerLinkActive="active-custom">Supprimer mon compte</button>
</div>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../ajout-membre"
routerLinkActive="active-custom">Ajouter un membre</button>
</div>
<div class="row">
<div class="col" *ngFor="let membreData of listMembres">
<app-card-member [membre]="membreData">
</app-card-member>
</div>
</div>
</div>
</div>
</div> </div>

View File

@ -0,0 +1,3 @@
button{
margin-bottom: 5px;
}

View File

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MembreService } from 'src/app/services/membre.service';
import { TeamService } from 'src/app/services/team.service';
@Component({ @Component({
selector: 'app-page-account', selector: 'app-page-account',
@ -6,10 +8,16 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./page-account.component.scss'] styleUrls: ['./page-account.component.scss']
}) })
export class PageAccountComponent implements OnInit { export class PageAccountComponent implements OnInit {
public listMembres: any[];
constructor() { } constructor(private teamService: TeamService, private membreService: MembreService) {
this.listMembres = [];
}
ngOnInit(): void { ngOnInit(): void {
this.membreService.getMembres().subscribe((membres: any[]) => {
this.listMembres = membres;
});
} }
} }

View File

@ -1,5 +1,6 @@
<app-header></app-header> <app-header></app-header>
<body> <body>
<div class="container">
<div class="bienvenue"> <div class="bienvenue">
<h2 class="titre">BIENVENUE</h2> <h2 class="titre">BIENVENUE</h2>
<p> <p>
@ -13,6 +14,7 @@ lu, nous sommes là pour vous aider !</p>
<div class="connexion"> <div class="connexion">
<app-signin></app-signin> <app-signin></app-signin>
</div> </div>
</div>
<div class="pub"> <div class="pub">
<img src="../../../assets/images/menu.png" /> <img src="../../../assets/images/menu.png" />
<img src="../../../assets/images/repertoire.png" /> <img src="../../../assets/images/repertoire.png" />

View File

@ -1,10 +1,15 @@
.container {
display: flex;
}
.bienvenue { .bienvenue {
float: left; float: left;
display: inline; // display: inline-block;
// height: 300px;
border: 4px solid #5d5fef; border: 4px solid #5d5fef;
border-radius: 10px; border-radius: 10px;
margin-top: 50px; margin-top: 50px;
margin-left: 200px; // margin-left: 200px;
padding-right: 10px; padding-right: 10px;
padding-left: 10px; padding-left: 10px;
} }
@ -18,17 +23,20 @@ p {
line-height: 2em; line-height: 2em;
} }
.connexion { .connexion {
float: right; // float: right;
height: 350px;
display: inline; display: inline;
margin-top: -40px; margin-top: -40px;
margin-right: 200px; margin-left: 10px;
// margin-right: 200px;
} }
.pub { .pub {
padding-top: 100px;
padding-right: 100px;
padding-left: 200px;
display: flex; display: flex;
flex-wrap: wrap;
padding-top: 100px;
padding-right: 200px;
padding-left: 200px;
justify-content: space-between; justify-content: space-between;
} }

View File

@ -1,101 +1,141 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <div class="container-fluid">
<div class="signup-form text-center"> <div class="row">
<main class="form-signup"> <app-side-bar></app-side-bar>
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm"> <div class="col-9 offset-2" id="main">
<h1>J'inscris un nouveau membre</h1> <div class="form-addMember">
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
<div class="form-floating"> <div class="form-floating">
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur" <input type="color"
formControlName="couleurFc"> class="form-control"
<label for="floatingInputcouleur">Choisissez une couleur !</label> id="floatingInputcouleur"
</div> placeholder=""
<!-- <div class="form-floating"> name="couleur"
<input type="text" formControlName="couleurFc">
class="form-control"
id="floatingInputlastName"
placeholder=""
name="lastName"
formControlName="lastNameFc"
[ngClass]="{'is-valid' : addMemberForm.controls['lastNameFc'].touched && addMemberForm.controls['lastNameFc'].valid,
'is-invalid': addMemberForm.controls['lastNameFc'].touched && !addMemberForm.controls['lastNameFc'].valid}">
<label for="floatingInputlastName">Avatar</label>
</div> -->
<div class="form-floating">
<input type="text"
class="form-control"
id="floatingInputlastName"
placeholder=""
name="lastName"
formControlName="lastNameFc"
[ngClass]="{'is-valid' : addMemberForm.controls['lastNameFc'].touched && addMemberForm.controls['lastNameFc'].valid,
'is-invalid': addMemberForm.controls['lastNameFc'].touched && !addMemberForm.controls['lastNameFc'].valid}">
<label for="floatingInputlastName">Nom</label>
</div> </div>
<div class="form-floating"> <div class="form-floating">
<input type="text" <input
class="form-control" type="text"
id="floatingInputfirstName" class="form-control"
placeholder="" id="floatingInputlastName"
name="firstName" placeholder=""
formControlName="firstNameFc" name="lastName"
[ngClass]="{'is-valid' : addMemberForm.controls['firstNameFc'].touched && addMemberForm.controls['firstNameFc'].valid, formControlName="lastNameFc"
'is-invalid': addMemberForm.controls['firstNameFc'].touched && !addMemberForm.controls['firstNameFc'].valid}"> [ngClass]="{
<label for="floatingInputfirstName">Prénom</label> 'is-valid':
addMemberForm.controls['lastNameFc'].touched &&
addMemberForm.controls['lastNameFc'].valid,
'is-invalid':
addMemberForm.controls['lastNameFc'].touched &&
!addMemberForm.controls['lastNameFc'].valid
}"
/>
<label for="floatingInputlastName">VOTRE NOM</label>
</div> </div>
<div class="form-floating"> <div class="form-floating">
<input type="date" <input
class="form-control" type="text"
id="floatingInputdateNaissance" class="form-control"
placeholder="" id="floatingInputfirstName"
name="dateNaissance" placeholder=""
formControlName="dateNaissanceFc" name="firstName"
[ngClass]="{'is-valid' : addMemberForm.controls['dateNaissanceFc'].touched && addMemberForm.controls['dateNaissanceFc'].valid, formControlName="firstNameFc"
'is-invalid': addMemberForm.controls['dateNaissanceFc'].touched && !addMemberForm.controls['dateNaissanceFc'].valid}"> [ngClass]="{
<label for="floatingInputfirstName">Date de naissance</label> 'is-valid':
</div> addMemberForm.controls['firstNameFc'].touched &&
<div class="form-floating"> addMemberForm.controls['firstNameFc'].valid,
<input type="email" 'is-invalid':
class="form-control" addMemberForm.controls['firstNameFc'].touched &&
id="floatingInput" !addMemberForm.controls['firstNameFc'].valid
placeholder="" }"
name="email" />
formControlName="emailFc" <label for="floatingInputfirstName">VOTRE PRENOM</label>
[ngClass]="{'is-valid' : addMemberForm.controls['emailFc'].touched && addMemberForm.controls['emailFc'].valid,
'is-invalid': addMemberForm.controls['emailFc'].touched && !addMemberForm.controls['emailFc'].valid}">
<label for="floatingInput">Adresse email</label>
</div> </div>
<div class="form-floating"> <div class="form-floating">
<input type="password" <input
class="form-control" type="date"
id="floatingPassword" class="form-control"
placeholder="" id="floatingInputdateNaissance"
name="password" placeholder=""
formControlName="passwordFc" name="dateNaissance"
[ngClass]="{'is-valid' : addMemberForm.controls['passwordFc'].touched && addMemberForm.controls['passwordFc'].valid, formControlName="dateNaissanceFc"
'is-invalid': addMemberForm.controls['passwordFc'].touched && !addMemberForm.controls['passwordFc'].valid}"> [ngClass]="{
<label for="floatingPassword">Mot de passe</label> 'is-valid':
addMemberForm.controls['dateNaissanceFc'].touched &&
addMemberForm.controls['dateNaissanceFc'].valid,
'is-invalid':
addMemberForm.controls['dateNaissanceFc'].touched &&
!addMemberForm.controls['dateNaissanceFc'].valid
}"
/>
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
</div> </div>
<div class="form-floating"> <div class="form-floating">
<input type="passwordConfirm" <input
class="form-control" type="email"
id="floatingpasswordConfirm" class="form-control"
placeholder="" id="floatingInputemail"
name="passwordConfirm" placeholder=""
formControlName="passwordConfirmFc" name="email"
[ngClass]="{'is-valid' : addMemberForm.controls['passwordConfirmFc'].touched && addMemberForm.controls['passwordConfirmFc'].valid, formControlName="emailFc"
'is-invalid': addMemberForm.controls['passwordConfirmFc'].touched && !addMemberForm.controls['passwordConfirmFc'].valid}"> [ngClass]="{
<label for="floatingPassword">Confirmer mot de passe</label> 'is-valid':
addMemberForm.controls['emailFc'].touched &&
addMemberForm.controls['emailFc'].valid,
'is-invalid':
addMemberForm.controls['emailFc'].touched &&
!addMemberForm.controls['emailFc'].valid
}"
/>
<label for="floatingInputemail">VOTRE EMAIL</label>
</div>
<div class="form-floating">
<input
type="password"
class="form-control"
id="floatingPassword"
placeholder=""
name="password"
formControlName="passwordFc"
[ngClass]="{
'is-valid':
addMemberForm.controls['passwordFc'].touched &&
addMemberForm.controls['passwordFc'].valid,
'is-invalid':
addMemberForm.controls['passwordFc'].touched &&
!addMemberForm.controls['passwordFc'].valid
}"
/>
<label for="floatingPassword">MOT DE PASSE</label>
</div>
<div class="form-floating">
<input
type="password"
class="form-control"
id="floatingpasswordConfirm"
placeholder=""
name="passwordConfirm"
formControlName="passwordConfirmFc"
[ngClass]="{
'is-valid':
addMemberForm.controls['passwordConfirmFc'].touched &&
addMemberForm.controls['passwordConfirmFc'].valid,
'is-invalid':
addMemberForm.controls['passwordConfirmFc'].touched &&
!addMemberForm.controls['passwordConfirmFc'].valid
}"
/>
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
</div> </div>
<button class="w-100 btn btn-lg btn-success" <button
type="submit" class="w-100 btn btn-lg btn-outline-success"
[disabled]="addMemberForm.invalid">Je confirme l'ajout de ce membre à ma team !</button> type="submit"
<p> [disabled]="addMemberForm.invalid"
Value : {{ addMemberForm.value | json }} >Ajouter le membre</button>
</p> </form>
<p> </div>
Form valid : {{ addMemberForm.valid }} </div>
</p> </div>
</div>
</form>
</main>

View File

@ -4,29 +4,72 @@
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.form-signup { .form-addMember {
width: 100%; width: 100%;
max-width: 330px; max-width: 330px;
padding: 15px; padding: 15px;
margin: auto; margin-top: 50px;
margin-left: auto;
margin-right: auto;
border: solid 1px;
border-radius: 10px;
background-color: #fcddec;
border-color: #ef5da8;
} }
.form-signup .checkbox { .form-addMember .checkbox {
font-weight: 400; font-weight: 400;
} }
.form-signup .form-floating:focus-within { .form-addMember .form-floating:focus-within {
z-index: 2; z-index: 2;
} }
.form-signup input[type="email"] { .form-addMember input[type="email"] {
margin-bottom: -1px; margin-bottom: 10px;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.form-signup input[type="password"] { .form-addMember input[type="color"] {
border: none;
margin-bottom: 10px;
margin-top: -70px;
margin-left: 100px;
border-radius: 50%;
width: 100px;
height: 100px;
}
.form-addMember input[type="color"]::-webkit-color-swatch {
border: none;
margin-top: -15px;
border-radius: 80%;
width: 80px;
height: 80px;
}
.form-addMember input[type="text"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-addMember input[type="date"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-addMember input[type="password"] {
margin-bottom: 10px; margin-bottom: 10px;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }
.btn-outline-success {
margin-top: 10px;
background-color: #ffff;
color: #ef5da8 !important;
border-color: #ef5da8 !important;
}

View File

@ -3,6 +3,7 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Membre } from 'src/app/models/membre'; import { Membre } from 'src/app/models/membre';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { MembreService } from 'src/app/services/membre.service';
@Component({ @Component({
selector: 'app-page-add-member', selector: 'app-page-add-member',
@ -13,6 +14,7 @@ export class PageAddMemberComponent implements OnInit {
public addMemberForm: FormGroup; public addMemberForm: FormGroup;
constructor( constructor(
private membreService: MembreService,
private authService: AuthService, private authService: AuthService,
private router: Router, private router: Router,
private fb: FormBuilder private fb: FormBuilder
@ -27,7 +29,7 @@ export class PageAddMemberComponent implements OnInit {
firstNameFc: new FormControl('', [Validators.required]), firstNameFc: new FormControl('', [Validators.required]),
lastNameFc: new FormControl('', [Validators.required]), lastNameFc: new FormControl('', [Validators.required]),
dateNaissanceFc: new FormControl('', [Validators.required]), dateNaissanceFc: new FormControl('', [Validators.required]),
couleurFc: new FormControl('', [Validators.required]), couleurFc: new FormControl('', []),
emailFc: new FormControl('', [ emailFc: new FormControl('', [
Validators.email, Validators.email,
Validators.required, Validators.required,
@ -73,8 +75,8 @@ export class PageAddMemberComponent implements OnInit {
if (membre.email !== '' && membre.password !== '') { if (membre.email !== '' && membre.password !== '') {
this.authService.signup(membre).subscribe((resp) => { this.membreService.addMembre(membre).subscribe((resp) => {
this.router.navigate(['account/signin']); this.router.navigate(['compte']);
}); });
} else { } else {
// affichage erreur // affichage erreur

View File

@ -3,10 +3,14 @@
<app-side-bar></app-side-bar> <app-side-bar></app-side-bar>
</div> </div>
<div class="ajoutContact-form text-center"> <div class="ajoutContact-form text-center">
<h1>Ajouter un contact</h1>
<main class="form-ajoutContact"> <main class="form-ajoutContact">
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm"> <form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
<h1>Ajouter un contact</h1>
<div class="form-floating">
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
formControlName="couleurFc">
</div>
<div class="form-floating"> <div class="form-floating">
<input type="text" <input type="text"

View File

@ -1,14 +1,20 @@
.login-form { .login-form {
height: 100vh; height: 100vh;
padding-top: 40px; padding-top: 40px;
background-color: #f5f5f5; background-color: #e286d3;
} }
.form-ajoutContact { .form-ajoutContact {
width: 100%; width: 100%;
max-width: 330px; max-width: 330px;
padding: 15px; padding: 15px;
margin: auto; margin-top: 50px;
margin-left: auto;
margin-right: auto;
border: solid 1px;
border-radius: 10px;
background-color: #fcddec;
border-color: #81164d;
} }
.form-ajoutContact .checkbox { .form-ajoutContact .checkbox {
@ -20,12 +26,45 @@
} }
.form-ajoutContact input[type="email"] { .form-ajoutContact input[type="email"] {
margin-bottom: -1px; margin-bottom: 10px;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.form-ajoutContact input[type="color"] {
border: none;
margin-bottom: 10px;
margin-top: -70px;
margin-left: 100px;
border-radius: 50%;
width: 100px;
height: 100px;
}
.form-ajoutContact input[type="color"]::-webkit-color-swatch {
border: none;
margin-top: -15px;
border-radius: 80%;
width: 80px;
height: 80px;
}
.form-ajoutContact input[type="text"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-ajoutContact input[type="date"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-secondary { .btn-secondary {
color: #fff; margin-top: 10px;
background-color: #ffff;
color: rgb(255, 255, 255);
background-color: #5a1e63 !important; background-color: #5a1e63 !important;
} }

View File

@ -6,6 +6,7 @@ import {
Validators, Validators,
} from '@angular/forms'; } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { TokenService } from 'src/app/services/token.service';
import { Contact } from '../../models/contact'; import { Contact } from '../../models/contact';
import { RepertoireService } from '../../services/repertoire.service'; import { RepertoireService } from '../../services/repertoire.service';
@ -19,6 +20,7 @@ export class PageAjoutContactComponent implements OnInit {
constructor( constructor(
private repertoireService: RepertoireService, private repertoireService: RepertoireService,
private tokenService: TokenService,
private router: Router, private router: Router,
private fb: FormBuilder private fb: FormBuilder
) { ) {
@ -28,6 +30,7 @@ export class PageAjoutContactComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
// *********************************pensser à changer group car déprécié******************************** // *********************************pensser à changer group car déprécié********************************
this.ajoutContactForm = this.fb.group({ this.ajoutContactForm = this.fb.group({
couleurFc: new FormControl('', [Validators.required]),
lastNameFc: new FormControl('', [Validators.required]), lastNameFc: new FormControl('', [Validators.required]),
firstNameFc: new FormControl('', [Validators.required]), firstNameFc: new FormControl('', [Validators.required]),
telephoneFc: new FormControl('', [Validators.required]), telephoneFc: new FormControl('', [Validators.required]),
@ -42,24 +45,25 @@ export class PageAjoutContactComponent implements OnInit {
} }
public onSubmit(): void { public onSubmit(): void {
console.log('value : ', this.ajoutContactForm.value); const couleurValue = this.ajoutContactForm.value['couleurFc'];
console.log('form : ', this.ajoutContactForm);
const firstNameValue = this.ajoutContactForm.value['firstNameFc']; const firstNameValue = this.ajoutContactForm.value['firstNameFc'];
const lastNameValue = this.ajoutContactForm.value['lastNameFc']; const lastNameValue = this.ajoutContactForm.value['lastNameFc'];
const telephoneValue = this.ajoutContactForm.value['telephoneFc']; const telephoneValue = this.ajoutContactForm.value['telephoneFc'];
const emailValue = this.ajoutContactForm.value['emailFc']; const emailValue = this.ajoutContactForm.value['emailFc'];
const dateNaissanceValue = this.ajoutContactForm.value['dateNaissanceFc']; const dateNaissanceValue = this.ajoutContactForm.value['dateNaissanceFc'];
const adresseValue = this.ajoutContactForm.value['adresseFc']; const adresseValue = this.ajoutContactForm.value['adresseFc'];
const teamId = this.tokenService.getCurrentTeamId()
const contact: Contact = { const contact: Contact = {
id: '', id: '',
couleur: couleurValue,
nom: lastNameValue, nom: lastNameValue,
prenom: firstNameValue, prenom: firstNameValue,
telephone: telephoneValue, telephone: telephoneValue,
email: emailValue, email: emailValue,
dateNaissance: dateNaissanceValue, dateNaissance: dateNaissanceValue,
adresse: adresseValue, adresse: adresseValue,
team: { id: '1' }, // changer l'id quand la personne est logé => recuperer l'id de la team du membre team: { id: teamId }, // changer l'id quand la personne est logé => recuperer l'id de la team du membre
}; };
if (contact.nom !== '') { if (contact.nom !== '') {
@ -67,7 +71,7 @@ export class PageAjoutContactComponent implements OnInit {
this.router.navigate(['repertoire/']); this.router.navigate(['repertoire/']);
}); });
} else { } else {
// affichage erreur window.alert("Le contact ne peut pas être ajouté!")
} }
} }
} }

View File

@ -1,30 +1,27 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <div class="row">
<div class="signup-form text-center"> <div class="col-md-auto">
<main class="form-signup"> <app-side-bar></app-side-bar>
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm"> </div>
<h1>Créer votre team!</h1> <div class=" col team-form text-center">
<div class="form-floating"> <h1>Créer votre team</h1>
<input type="text" <main class="form-team">
class="form-control" <form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
id="floatingInputName" <div class="form-floating">
placeholder="" <input type="text"
name="name" class="form-control"
formControlName="nameFc" id="floatingInputName"
[ngClass]="{'is-valid' : teamForm.controls['nameFc'].touched && teamForm.controls['nameFc'].valid, placeholder=""
'is-invalid': teamForm.controls['nameFc'].touched && !teamForm.controls['nameFc'].valid}"> name="name"
<label for="floatingInputName">Nom</label> formControlName="nameFc"
</div> [ngClass]="{'is-valid' : teamForm.controls['nameFc'].touched && teamForm.controls['nameFc'].valid,
<button class="w-100 btn btn-lg btn-success" 'is-invalid': teamForm.controls['nameFc'].touched && !teamForm.controls['nameFc'].valid}">
type="submit" <label for="floatingInputName">Nom</label>
[disabled]="teamForm.invalid">Je crée ma team</button> </div>
<p> <button class="w-100 btn btn-lg btn-success"
Value : {{ teamForm.value | json }} type="submit"
</p> [disabled]="teamForm.invalid">Je crée ma team</button>
<p> </form>
Form valid : {{ teamForm.valid }} </main>
</p> </div>
</div>
</form>
</main>
</div>

View File

@ -1,31 +1,40 @@
.team-form{
margin-top: 20px;
align-content: center;
}
button{
margin-top: 10px;
}
.login-form { .login-form {
height: 100vh; height: 100vh;
padding-top: 40px; padding-top: 40px;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.form-signup { .form-team {
width: 100%; width: 100%;
max-width: 330px; max-width: 500px;
padding: 15px; padding: 15px;
margin: auto; margin: auto;
} }
.form-signup .checkbox { .form-team .checkbox {
font-weight: 400; font-weight: 400;
} }
.form-signup .form-floating:focus-within { .form-team .form-floating:focus-within {
z-index: 2; z-index: 2;
} }
.form-signup input[type="email"] { .form-team input[type="email"] {
margin-bottom: -1px; margin-bottom: -1px;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.form-signup input[type="password"] { .form-team input[type="password"] {
margin-bottom: 10px; margin-bottom: 10px;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;

View File

@ -7,7 +7,7 @@ import {
} from '@angular/forms'; } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Team } from 'src/app/models/team'; import { Team } from 'src/app/models/team';
import { AuthService } from '../../services/auth.service'; import { TeamService } from 'src/app/services/team.service';
@Component({ @Component({
selector: 'app-page-creation-team', selector: 'app-page-creation-team',
@ -17,7 +17,7 @@ import { AuthService } from '../../services/auth.service';
export class PageCreationTeamComponent implements OnInit { export class PageCreationTeamComponent implements OnInit {
public teamForm: FormGroup; public teamForm: FormGroup;
constructor( constructor(
private authService: AuthService, private teamService: TeamService,
private router: Router, private router: Router,
private fb: FormBuilder private fb: FormBuilder
) { ) {
@ -43,7 +43,7 @@ export class PageCreationTeamComponent implements OnInit {
if (team.nom !== '' ) { if (team.nom !== '' ) {
this.authService.creationTeam(team).subscribe((resp) => { this.teamService.addTeam(team).subscribe((resp) => {
this.router.navigate(['compte']); this.router.navigate(['compte']);
}); });
} else { } else {

View File

@ -2,3 +2,8 @@
<app-side-bar></app-side-bar> <app-side-bar></app-side-bar>
<app-meteo></app-meteo> <app-meteo></app-meteo>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg" routerLink="../creation-team"
routerLinkActive="active-custom">Créer ma team</button>
</div>

View File

@ -0,0 +1,5 @@
.meteo {
display: flex;
margin-left: 300px;
margin-top: -60px;
}

View File

@ -0,0 +1,12 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<h1>Supprimer votre compte</h1>
<main class="contenu-compte">
</main>
</div>
</div>

View File

@ -1,20 +1,20 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AvatarComponent } from './avatar.component'; import { PageDeleteAccountComponent } from './page-delete-account.component';
describe('AvatarComponent', () => { describe('PageDeleteAccountComponent', () => {
let component: AvatarComponent; let component: PageDeleteAccountComponent;
let fixture: ComponentFixture<AvatarComponent>; let fixture: ComponentFixture<PageDeleteAccountComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ AvatarComponent ] declarations: [ PageDeleteAccountComponent ]
}) })
.compileComponents(); .compileComponents();
}); });
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(AvatarComponent); fixture = TestBed.createComponent(PageDeleteAccountComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@ -0,0 +1,15 @@
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 {
}
}

View File

@ -1 +1,12 @@
<app-header></app-header> <app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<h1>Supprimer ce membre</h1>
<main class="contenu-compte">
</main>
</div>
</div>

View File

@ -13,10 +13,10 @@
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button> routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button>
</form> </form>
<!--
<div *ngIf="errorForm"> <div *ngIf="errorForm">
<p class="text-danger">Il manque des informations dans le formulaire...</p> <p class="text-danger">Il manque des informations dans le formulaire...</p>
</div> </div> -->
</main> </main>
</div> </div>

View File

@ -14,25 +14,20 @@ import {
styleUrls: ['./page-forgot-password.component.scss'] styleUrls: ['./page-forgot-password.component.scss']
}) })
export class PageForgotPasswordComponent implements OnInit { export class PageForgotPasswordComponent implements OnInit {
public errorForm: boolean;
constructor(private authService: AuthService, private router: Router) { constructor(private authService: AuthService, private router: Router) {
this.errorForm = false;
} }
ngOnInit(): void {} ngOnInit(): void {}
public onSubmit(submittedForm: any): void {
public onSubmit(submittedForm: any): void {
console.log(submittedForm.form.value); console.log(submittedForm.form.value);
const email = submittedForm.form.value['email'];
if (email !== '') { // const email = submittedForm.form.value['email'];
this.authService.forgotPassword(email).subscribe((resp) => { // console.log(email);
console.log('Component : PageForgotPassword ', resp); window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
this.router.navigate(['reinitialisation-password']); // this.router.navigate(['reinitialisation-password']);
});
} else { }
// afficher une erreur à l'utilisateur
this.errorForm = true;
}
} }
}

View File

@ -1,2 +1,29 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<h1>Menu de la semaine</h1>
<main class="contenu-compte">
<app-card-menu></app-card-menu>
<div class="d-flex justify-content-center">
</div>
<div class="d-flex justify-content-center">
</div>
<div class="d-flex justify-content-center">
</div>
<div class="d-flex justify-content-center">
</div>
<div class="d-flex justify-content-center">
</div>
<div class="d-flex justify-content-center">
</div>
</main>
</div>

View File

@ -4,10 +4,14 @@
</div> </div>
<div class="modifContact-form text-center"> <div class="modifContact-form text-center">
<h1>Modifier ce contact</h1>
<main class="form-modifContact"> <main class="form-modifContact">
<form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm"> <form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm">
<h1>Modifier ce contact</h1>
<div class="form-floating">
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
formControlName="couleurFc" value= "{{ listContactInfo.couleur }}">
</div>
<div class="form-floating"> <div class="form-floating">
<input type="text" <input type="text"

View File

@ -8,7 +8,13 @@
width: 100%; width: 100%;
max-width: 330px; max-width: 330px;
padding: 15px; padding: 15px;
margin: auto; margin-top: 50px;
margin-left: auto;
margin-right: auto;
border: solid 1px;
border-radius: 10px;
background-color: #fcddec;
border-color: #81164d;
} }
.form-modifContact .checkbox { .form-modifContact .checkbox {
@ -25,7 +31,40 @@
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.form-modifContact input[type="color"] {
border: none;
margin-bottom: 10px;
margin-top: -70px;
margin-left: 100px;
border-radius: 50%;
width: 100px;
height: 100px;
}
.form-modifContact input[type="color"]::-webkit-color-swatch {
border: none;
margin-top: -15px;
border-radius: 80%;
width: 80px;
height: 80px;
}
.form-modifContact input[type="text"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-modifContact input[type="date"] {
margin-bottom: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-secondary { .btn-secondary {
color: #fff; margin-top: 10px;
background-color: #ffff;
color: rgb(255, 255, 255);
background-color: #5a1e63 !important; background-color: #5a1e63 !important;
} }

View File

@ -44,6 +44,7 @@ export class PageModifierContactComponent implements OnInit {
// *********************************pensser à changer group car déprécié******************************** // *********************************pensser à changer group car déprécié********************************
this.modifContactForm = this.fb.group({ this.modifContactForm = this.fb.group({
couleurFc: new FormControl('', [Validators.required]),
lastNameFc: new FormControl('', [Validators.required]), lastNameFc: new FormControl('', [Validators.required]),
firstNameFc: new FormControl('', [Validators.required]), firstNameFc: new FormControl('', [Validators.required]),
telephoneFc: new FormControl('', [Validators.required]), telephoneFc: new FormControl('', [Validators.required]),
@ -71,8 +72,7 @@ export class PageModifierContactComponent implements OnInit {
//Méthode qui envoie les champs modifiés pour mise à jour //Méthode qui envoie les champs modifiés pour mise à jour
public onSubmit(): void { public onSubmit(): void {
console.log('value : ', this.modifContactForm.value); const couleurValue = this.modifContactForm.value['couleurFc'];
console.log('form : ', this.modifContactForm);
const firstNameValue = this.modifContactForm.value['firstNameFc']; const firstNameValue = this.modifContactForm.value['firstNameFc'];
const lastNameValue = this.modifContactForm.value['lastNameFc']; const lastNameValue = this.modifContactForm.value['lastNameFc'];
const telephoneValue = this.modifContactForm.value['telephoneFc']; const telephoneValue = this.modifContactForm.value['telephoneFc'];
@ -82,6 +82,7 @@ export class PageModifierContactComponent implements OnInit {
const contact: Contact = { const contact: Contact = {
id: this.personneid, id: this.personneid,
couleur: couleurValue,
nom: lastNameValue, nom: lastNameValue,
prenom: firstNameValue, prenom: firstNameValue,
telephone: telephoneValue, telephone: telephoneValue,

View File

@ -1,5 +1,5 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar>
<div> <div>
<div class="ctn-link min-vh-100"> <div class="ctn-link min-vh-100">

View File

@ -1,31 +1,41 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div> <div class=" col compte text-center py-3 border">
<button class="w-100 btn btn-lg btn-secondary " <div>
type="submit">Tous les contacts <button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">Tous les contacts
</button> </button>
<button routerLink="/ajouter-contact" class="btn btn-sm btn-rounded btn-secondary m-3">
Ajouter un contact
</button>
<button routerLink="/ajouter-contact" class="w-100 btn btn-lg btn-rounded btn-secondary"> <div class="input-group mb-3 d-flex justify-content-center">
Ajouter un contact <input type="text" class="form-control" placeholder="Rechercher un contact"
</button> aria-label="Rechercher un contact" aria-describedby="basic-addon2" #word
(keyup)="onSearchChange(word.value)">
<div class="input-group mb-3"> <div class="input-group-append"></div>
<input type="text" class="form-control" </div>
placeholder="Rechercher un contact" <div>
aria-label="Rechercher un contact" <h4>Liste des Contacts</h4>
aria-describedby="basic-addon2" </div>
#word <div class="row justify-content-evenly">
(keyup)="onSearchChange(word.value)"> <div class="col-4">
<div class="row my-3 d-flex justify-content-center flex-row" *ngFor="let personne of listContact"
<div class="input-group-append"> (click)="onClick(personne)">
<div class="couleur col-4" [style.background-color]="personne.couleur"></div>
<span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }}</span>
</div>
</div>
<div class="col-4" *ngIf="openDetails">
<app-fiche-contact [personne]="openDetails" (clickDelete)="onClickDelete($event)">
</app-fiche-contact>
</div>
</div>
</div> </div>
</div> </div>
</div>
<div *ngFor="let personne of listContact" (click)="onClick(personne)" >
<img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/contact-1.png"/>
<p class="fiche-contact" >{{ personne.prenom }} {{ personne.nom }}</p>
</div>
<div *ngIf="openDetails"><app-fiche-contact [personne]="openDetails"></app-fiche-contact></div>
</div>

View File

@ -2,14 +2,33 @@
color: #fff; color: #fff;
background-color: #5a1e63 !important; background-color: #5a1e63 !important;
width: 100%; width: 100%;
max-width: 330px; max-width: 230px;
padding: 15px; padding: 15px;
margin: auto; margin: auto;
min-width: 100px;
border-radius: 55px;
font-weight: bold;
} }
.input-group mb-3 { .input-group.mb-3 {
width: 100%; width: 50%;
max-width: 330px; max-width: 330px;
padding: 15px; padding: 15px;
margin: auto; margin: auto;
display: flex;
flex-direction: row;
} }
.couleur{
border: none;
margin-top: -15px;
border-radius: 80%;
width: 60px;
height: 60px;
flex-direction: row;
}
.h4 {
color: black;
font-weight: bold;
}

View File

@ -33,16 +33,6 @@ export class PageRepertoireComponent implements OnInit {
this.listContact = listContact; this.listContact = listContact;
this.listFull = listContact; this.listFull = listContact;
}); });
this.personneid = this.route.snapshot.paramMap.get('id');
console.log(this.personneid);
this.repertoireService
.getContactById(this.personneid)
.subscribe((listContactInfo: any) => {
console.log(listContactInfo);
this.listContactInfo = listContactInfo;
});
} }
// Méthode pour récuper ce qui est saisi dans l'input // Méthode pour récuper ce qui est saisi dans l'input
@ -63,13 +53,21 @@ export class PageRepertoireComponent implements OnInit {
this.listContact = prenom; this.listContact = prenom;
} }
// Méthode qui au click va ouvrir les détails d'un contat // Méthode qui au click va ouvrir les détails d'un contact
onClick(personne: any) { onClick(personne: any) {
console.log(personne); console.log(personne);
this.openDetails = personne; this.openDetails = personne;
} }
// this.repertoireService.deleteContact(contact).subscribe((resp) => { // Méthode qui au click va supprimer un contact
// this.router.navigate(['repertoire/']); onClickDelete(contactId: number){
// }); this.repertoireService.deleteContact(contactId).subscribe((resp) => {
if(contactId) {
this.listContact.forEach(contactId => console.log(contactId))
}else{
window.alert("Le contact ne peut pas être supprimé!")
}
this.router.navigate(['repertoire/']);
});
}
} }

View File

@ -1,12 +1,12 @@
<app-header></app-header> <app-header></app-header>
<div class="signup-form text-center"> <div class="signup-form text-center">
<h1>Inscrivez-vous !</h1> <h1>Inscrivez-vous !</h1>
<label for="floatingInputcouleur">Choisissez une couleur</label>
<main class="form-signup"> <main class="form-signup">
<form (ngSubmit)="onSubmit()" [formGroup]="signupForm"> <form (ngSubmit)="onSubmit()" [formGroup]="signupForm">
<div class="form-floating"> <div class="form-floating">
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur" <input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
formControlName="couleurFc"> formControlName="couleurFc">
</div> </div>
<div class="form-floating"> <div class="form-floating">
<input <input
@ -126,10 +126,10 @@
<button <button
class="w-100 btn btn-lg btn-outline-success" class="w-100 btn btn-lg btn-outline-success"
type="submit" type="submit"
[disabled]="signupForm.invalid" [disabled]="signupForm.invalid">
>
CREER MON COMPTE CREER MON COMPTE
</button> </button>
</form> </form>
</main> </main>
</div> </div>

View File

@ -1,5 +1,9 @@
<app-header></app-header> <app-header></app-header>
<app-side-bar></app-side-bar> <app-side-bar></app-side-bar>
<div class="container"> <div class="d-flex align-items-stretch">
<app-to-do-list></app-to-do-list> <div class="row">
<div class="col" *ngFor="let todos of result">
<app-to-do-list [todo]="todos"> </app-to-do-list>
</div>
</div>
</div> </div>

View File

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { TodoService } from 'src/app/services/todo.service';
@Component({ @Component({
selector: 'app-page-to-do-list', selector: 'app-page-to-do-list',
@ -6,10 +9,18 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./page-to-do-list.component.scss'] styleUrls: ['./page-to-do-list.component.scss']
}) })
export class PageToDoListComponent implements OnInit { export class PageToDoListComponent implements OnInit {
public result : any;
constructor() { } constructor(private TodoService : TodoService) { }
ngOnInit(): void { ngOnInit(): void {
this.TodoService.getToDoListByTeamId().subscribe((data :any)=>{
this.result = data;
console.log(data);
});
} }
} }

View File

@ -0,0 +1,12 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<h1>Modifier votre compte</h1>
<main class="contenu-compte">
</main>
</div>
</div>

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PageUpdateAccountComponent } from './page-update-account.component';
describe('PageUpdateAccountComponent', () => {
let component: PageUpdateAccountComponent;
let fixture: ComponentFixture<PageUpdateAccountComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PageUpdateAccountComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PageUpdateAccountComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
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 {
}
}

View File

@ -1 +1,12 @@
<app-header></app-header> <app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<h1>Modifier ce membre</h1>
<main class="contenu-compte">
</main>
</div>
</div>

View File

@ -41,9 +41,9 @@ export class AuthService {
return this.http.post(`${this.apiUrl}/membres/sign-in`, body).pipe( return this.http.post(`${this.apiUrl}/membres/sign-in`, body).pipe(
map((x: any) => { map((x: any) => {
console.log('Service : ', x.accessToken); console.log('Service : ', x.token);
// Modification à faire ici // Modification à faire ici
localStorage.setItem(this.tokenKey, x.accessToken); localStorage.setItem(this.tokenKey, x.token);
return x; // permet de renvoyer la réponse à l'initiateur (page Signin) après le traitement du map return x; // permet de renvoyer la réponse à l'initiateur (page Signin) après le traitement du map
}) })
); );

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MembreService } from './membre.service';
describe('MembreService', () => {
let service: MembreService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MembreService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,40 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Membre } from '../models/membre';
@Injectable({
providedIn: 'root'
})
export class MembreService {
apiUrl: string;
tokenKey: string;
constructor(private http: HttpClient) {
this.apiUrl = environment.apiUrl;
this.tokenKey = environment.tokenKey;
}
getMembres(): Observable<any> {
return this.http.get(`${this.apiUrl}/membres/all`);
}
getMembreId(id: any): Observable<any> {
return this.http.get(`${this.apiUrl}/membres/1` + id);
}
addMembre(membre: Membre): Observable<any> {
console.log(membre);
return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
}
deleteMembre(membre: Membre): Observable<any> {
return this.http.delete(`${this.apiUrl}/membres/delete/1`);
}
updateMembre(membre: Membre): Observable<any> {
return this.http.put(`${this.apiUrl}/membres/update/1`, membre);
}
}

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MenusService } from './menus.service';
describe('MenusService', () => {
let service: MenusService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MenusService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,56 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Menu } from '../models/menu';
import { Router } from '@angular/router';
import { TokenService } from './token.service';
@Injectable({
providedIn: 'root'
})
export class MenusService {
apiUrl: string;
constructor(private http: HttpClient, private router: Router, private tokenService: TokenService) {
// On se sert des variables d'environnement de notre application
this.apiUrl = environment.apiUrl;
}
//on affiche les menus d'une team
getMenu(): Observable<any> | void {
const teamId = this.tokenService.getCurrentTeamId();
if (teamId){
return this.http.get(`${this.apiUrl}/menus/team/${teamId}`);
}else {
this.router.navigate(['accueil']);
}
}
getMenuById(id: any): Observable<any> {
return this.http.get(`${this.apiUrl}/menus/` + id);
}
addMenu(menu: Menu): Observable<any> | void {
console.log(menu);
const teamId = this.tokenService.getCurrentTeamId();
if (teamId){
return this.http.post(`${this.apiUrl}/menus/add/${teamId}`, menu);
}else {
this.router.navigate(['accueil']);
}
}
deleteMenu(id: any): Observable<any> {
return this.http.delete(`${this.apiUrl}/menus/delete/`+ id);
}
updateMenu(menu: Menu): Observable<any> {
return this.http.put(`${this.apiUrl}/contacts/update/`, menu);
}
}

View File

@ -3,6 +3,8 @@ import { HttpClient } from '@angular/common/http';
import { map, Observable } from 'rxjs'; import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { Contact } from '../models/contact'; import { Contact } from '../models/contact';
import { Router } from '@angular/router';
import { TokenService } from './token.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -11,14 +13,15 @@ export class RepertoireService {
apiUrl: string; apiUrl: string;
tokenKey: string; tokenKey: string;
constructor(private http: HttpClient) { constructor(private http: HttpClient, private router: Router, private tokenService: TokenService) {
// On se sert des variables d'environnement de notre application // On se sert des variables d'environnement de notre application
this.apiUrl = environment.apiUrl; this.apiUrl = environment.apiUrl;
this.tokenKey = environment.tokenKey; this.tokenKey = environment.tokenKey;
} }
getContact(): Observable<any> { getContact(): Observable<any> {
return this.http.get(`${this.apiUrl}/contacts/team/1`); const teamId = this.tokenService.getCurrentTeamId()
return this.http.get(`${this.apiUrl}/contacts/team/${teamId}`);
} }
getContactById(id: any): Observable<any> { getContactById(id: any): Observable<any> {
@ -26,13 +29,12 @@ export class RepertoireService {
} }
addContact(contact: Contact): Observable<any> { addContact(contact: Contact): Observable<any> {
console.log(contact); const teamId = this.tokenService.getCurrentTeamId()
return this.http.post(`${this.apiUrl}/contacts/add`, contact); return this.http.post(`${this.apiUrl}/contacts/add`, contact);
} }
deleteContact(contact: Contact): Observable<any> { deleteContact(contactId: number): Observable<any> {
return this.http.delete(`${this.apiUrl}/contacts/delete/1`); return this.http.delete(`${this.apiUrl}/contacts/delete/${contactId}`);
} }
updateContact(contact: Contact): Observable<any> { updateContact(contact: Contact): Observable<any> {

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TeamService } from '../services/team.service';
describe('TeamService', () => {
let service: TeamService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TeamService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,41 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Team } from '../models/team';
@Injectable({
providedIn: 'root'
})
export class TeamService {
apiUrl: string;
tokenKey: string;
constructor(private http: HttpClient) {
this.apiUrl = environment.apiUrl;
this.tokenKey = environment.tokenKey;
}
getTeams(): Observable<any> {
return this.http.get(`${this.apiUrl}/teams/all`);
}
getTeamById(id: any): Observable<any> {
return this.http.get(`${this.apiUrl}/teams/1` + id);
}
addTeam(team: Team): Observable<any> {
console.log(team);
return this.http.post(`${this.apiUrl}/teams/add`, team);
}
deleteTeam(team: Team): Observable<any> {
return this.http.delete(`${this.apiUrl}/teams/delete/1`);
}
updateTeam(team: Team): Observable<any> {
return this.http.put(`${this.apiUrl}/teams/update/1`, team);
}
}

View File

@ -1,43 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class TodoServiceService {
private toDoList: any;
private apiUrl: string;
constructor(private http: HttpClient) {
this.apiUrl = environment.apiUrl;
}
//consulter toDoList
getToDoList(){
this.toDoList = this.http.get(`${this.apiUrl}/todolist/team/{team_id}`);
return this.toDoList;
console.log(this.toDoList)
}
//ajouter une tache
addTitle(title:string){
this.toDoList.push({
title:title,
isChecked: false
});
}
// cocher et décocher la checkbox
checkOrUnCheckTitle($key: string,flag: boolean){
this.toDoList.update($key,{isChecked:flag});
}
//supprimer la tache
removeTitle($key : string){
this.toDoList.remove($key);
}
}

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TodoService } from './todo.service';
describe('TodoService', () => {
let service: TodoService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TodoService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,38 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Tache } from '../models/tache';
import { ToDoList } from '../models/to-do-list';
@Injectable({
providedIn: 'root',
})
export class TodoService {
private toDoList: any;
private apiUrl: string;
constructor(private http: HttpClient) {
this.apiUrl = environment.apiUrl;
}
getToDoListByTeamId(): Observable<any> {
return this.http.get(`${this.apiUrl}/todolist/team/1`);
}
deleteTacheById(idTache: any): Observable<any> {
return this.http.delete(`${this.apiUrl}/taches/delete/${idTache}`, {
responseType: 'text',
});
}
addTache(newtache: Tache, idTodoList: number): Observable<any> {
// console.log(newtache);
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
}
updateTache(tache: Tache): Observable<any> {
console.log(tache);
return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
}
}

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TokenService } from './token.service';
describe('TokenService', () => {
let service: TokenService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TokenService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,59 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import jwt_decode from 'jwt-decode';
@Injectable({
providedIn: 'root'
})
export class TokenService {
tokenKey = environment.tokenKey;
constructor() { }
public getToken(): string | null {
const token = localStorage.getItem(this.tokenKey);
if(token) {
return token;
} else {
return null;
}
}
public getCurrentMembreId(): number | null {
const token = this.getToken();
if(token) {
const decodedToken = jwt_decode<any>(token);
const userId = decodedToken.sub;
return userId;
} else {
return null;
}
}
public getCurrentTeamId(): number | null {
const token = this.getToken();
if(token){
const decodedToken = jwt_decode<any>(token);
const teamId = decodedToken.teamId;
return teamId ;
}else {
return null;
}
}
public getRole(): string | null {
const token = this.getToken();
if(token){
const decodedToken = jwt_decode<any>(token);
const role= decodedToken.auth[0].authority;
return role;
}else{
return null;
}
}
}

2
src/app/todo-list.ts Normal file
View File

@ -0,0 +1,2 @@
export interface TodoList {
}

View File

@ -1,11 +1,13 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="fr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>OrganizeeFront</title> <title>Organizee</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<!-- Pour accèder à la bibliothèque d'icons W3S-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
</head> </head>
<body> <body>
<app-root></app-root> <app-root></app-root>

View File

@ -1 +1,3 @@
@import "~bootstrap/scss/bootstrap.scss"; @import "~bootstrap/scss/bootstrap.scss";
//Pour utiliser les icons ne fonctionne que si vous avez fait cette commande : npm i bootstrap-icons --save
@import "~bootstrap-icons/font/bootstrap-icons.scss";