Merge branch 'dev' of https://github.com/AlineRinquin/organizee-front into blandine
This commit is contained in:
commit
6c489a4fda
@ -36,7 +36,7 @@ const routes: Routes = [
|
|||||||
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
||||||
{ path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent },
|
{ path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent },
|
||||||
{ path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent },
|
{ path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent },
|
||||||
{ path: 'reinitialisation-password', component: PageResetPasswordComponent },
|
{ path: 'reinitialisation-password/:uuid', component: PageResetPasswordComponent },
|
||||||
{ path: 'creation-compte', component: PageSignupComponent },
|
{ path: 'creation-compte', component: PageSignupComponent },
|
||||||
{ path: 'page-support', component: PageSupportComponent},
|
{ path: 'page-support', component: PageSupportComponent},
|
||||||
{ path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent },
|
{ path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent },
|
||||||
|
@ -4,13 +4,17 @@
|
|||||||
<div class="couleur col-7" [style.background-color]="personne.couleur"></div>
|
<div class="couleur col-7" [style.background-color]="personne.couleur"></div>
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button routerLink="../modifier-contact/{{personne.id}}"
|
<button
|
||||||
|
*ngIf="parent"
|
||||||
|
routerLink="../modifier-contact/{{personne.id}}"
|
||||||
class=" btn btn-sm btn-rounded btn-secondary mb-2">
|
class=" btn btn-sm btn-rounded btn-secondary mb-2">
|
||||||
Modifier
|
Modifier
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button class=" btn btn-sm btn-rounded btn-secondary" (click)="onClickDelete(personne.id)">
|
<button
|
||||||
|
*ngIf="parent"
|
||||||
|
class=" btn btn-sm btn-rounded btn-secondary" (click)="onClickDelete(personne.id)">
|
||||||
Supprimer
|
Supprimer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-fiche-contact',
|
selector: 'app-fiche-contact',
|
||||||
@ -8,10 +9,20 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|||||||
export class FicheContactComponent implements OnInit {
|
export class FicheContactComponent implements OnInit {
|
||||||
@Input() personne: any;
|
@Input() personne: any;
|
||||||
@Output() clickDelete = new EventEmitter();
|
@Output() clickDelete = new EventEmitter();
|
||||||
|
parent: boolean;
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
ngOnInit(): void {}
|
constructor(private tokenService: TokenService) {
|
||||||
|
this.parent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
const roleUser = this.tokenService.getRole();
|
||||||
|
|
||||||
|
if(roleUser == "ROLE_PARENT"){
|
||||||
|
this.parent = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onClickDelete(numPerson: number){
|
onClickDelete(numPerson: number){
|
||||||
window.alert("Le contact à bien été supprimé!")
|
window.alert("Le contact à bien été supprimé!")
|
||||||
|
@ -23,9 +23,14 @@
|
|||||||
routerLinkActive="active-custom">S'inscrire</button>
|
routerLinkActive="active-custom">S'inscrire</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<a routerLink="/password-oublie" routerLinkActive="active-custom" class="nav-link">password perdu ?</a>
|
||||||
<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 *ngIf="isShow">
|
||||||
|
<div class="alert alert-{{alert.type}}" role="alert">
|
||||||
|
{{alert.content}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,9 +14,10 @@ import {
|
|||||||
styleUrls: ['./signin.component.scss'],
|
styleUrls: ['./signin.component.scss'],
|
||||||
})
|
})
|
||||||
export class SigninComponent implements OnInit {
|
export class SigninComponent implements OnInit {
|
||||||
public errorForm: boolean;
|
alert : any;
|
||||||
|
isShow : boolean;
|
||||||
constructor(private authService: AuthService, private router: Router) {
|
constructor(private authService: AuthService, private router: Router) {
|
||||||
this.errorForm = false;
|
this.isShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
@ -26,18 +27,21 @@ export class SigninComponent implements OnInit {
|
|||||||
const email = submittedForm.form.value['email'];
|
const email = submittedForm.form.value['email'];
|
||||||
const password = submittedForm.form.value['password'];
|
const password = submittedForm.form.value['password'];
|
||||||
if (email !== '' && password !== '') {
|
if (email !== '' && password !== '') {
|
||||||
this.authService.signin(email, password).subscribe((resp) => {
|
this.authService.signin(email, password).subscribe(
|
||||||
console.log('Component Signin: ', resp);
|
{
|
||||||
//if(resp == ){
|
next: resp => {
|
||||||
this.router.navigate(['tableau-de-bord']);
|
this.router.navigate(['tableau-de-bord']);
|
||||||
//}else{
|
},
|
||||||
// window.alert("Votre identifiant/mot de passe est erroné");
|
error: err => {
|
||||||
//}
|
this.alert={"type":"danger", "content":"Le login ou paswword est invalide"};
|
||||||
console.log('Component Signin: ', resp);
|
this.isShow = true;
|
||||||
});
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// afficher une erreur à l'utilisateur
|
// afficher une erreur à l'utilisateur
|
||||||
this.errorForm = true;
|
this.alert={"type":"danger", "content":"Le login ou password est invalide"};
|
||||||
|
this.isShow = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,69 +1,70 @@
|
|||||||
<input
|
<div class="container">
|
||||||
type="text"
|
<input
|
||||||
class="todo-title"
|
type="text"
|
||||||
placeholder="Titre"
|
class="todo-title btn btn-outline-success"
|
||||||
value = "{{todo.nom}}"
|
placeholder="Titre"
|
||||||
/>
|
value="{{ todo.nom }}"
|
||||||
<div>
|
[(ngModel)]="todo.nom"
|
||||||
<button (click)="effacerList()">Effacer la To Do List</button>
|
(keyup.enter)="updateTodo(todo)"
|
||||||
</div>
|
/>
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
class="todo-input"
|
|
||||||
placeholder="+ Nouvelle Tâche"
|
|
||||||
[(ngModel)]="todoTitle"
|
|
||||||
(keyup.enter)="addTache(todo.id)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
<i class="bi bi-trash3" (click)="deleteTodo(todo.id)"></i>
|
||||||
|
<div class="row justify-align">
|
||||||
<div class="element" *ngFor="let tache of todo.taches">
|
|
||||||
<div class="element-gauche">
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="text"
|
||||||
[(ngModel)]="tache.etat"
|
class="todo-input shadow justify-center"
|
||||||
(change)="doneEdit(tache)"
|
placeholder="+ Nouvelle Tâche"
|
||||||
checked="checked"
|
[(ngModel)]="todoTitle"
|
||||||
|
(keyup.enter)="addTache(todo.id)"
|
||||||
/>
|
/>
|
||||||
<div
|
|
||||||
*ngIf="!tache.editing; else editingTodo"
|
|
||||||
class="nomTache"
|
|
||||||
[ngClass]="{ completed: tache.etat }"
|
|
||||||
(dblclick)="modifier(tache)"
|
|
||||||
>
|
|
||||||
{{ tache.texte }}
|
|
||||||
</div>
|
|
||||||
<ng-template #editingTodo>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
class="modifier-element"
|
|
||||||
[(ngModel)]="tache.texte"
|
|
||||||
(blur)="doneEdit(tache)"
|
|
||||||
(keyup.enter)="doneEdit(tache)"
|
|
||||||
(keyup.esc)="cancelEdit(tache)"
|
|
||||||
autofocus
|
|
||||||
/>
|
|
||||||
</ng-template>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="deleteTache" (click)="deleteTodo(tache.id)">×</div>
|
<div
|
||||||
</div>
|
class="element btn btn-outline-success shadow"
|
||||||
|
*ngFor="let tache of todo.taches"
|
||||||
|
>
|
||||||
|
<div class="element-gauche">
|
||||||
<div class="extra-container">
|
<input
|
||||||
<div>
|
type="checkbox"
|
||||||
<label
|
[(ngModel)]="tache.etat"
|
||||||
><input
|
(change)="doneEdit(tache)"
|
||||||
|
checked="checked"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
*ngIf="!tache.editing; else editingTodo"
|
||||||
|
class="nomTache"
|
||||||
|
[ngClass]="{ completed: tache.etat }"
|
||||||
|
(dblclick)="modifier(tache)"
|
||||||
|
>
|
||||||
|
{{ tache.texte }}
|
||||||
|
</div>
|
||||||
|
<ng-template #editingTodo>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="modifier-element"
|
||||||
|
[(ngModel)]="tache.texte"
|
||||||
|
(blur)="doneEdit(tache)"
|
||||||
|
(keyup.enter)="doneEdit(tache)"
|
||||||
|
(keyup.esc)="cancelEdit(tache)"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
|
<div class="deleteTache" (click)="deleteTache(tache.id)">×</div>
|
||||||
|
</div>
|
||||||
|
<div class="selection">
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
class="selection"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
(change)="cocherAllTodoList()"
|
(change)="cocherAllTodoList()"
|
||||||
[(ngModel)]="masterSelected"
|
[(ngModel)]="masterSelected"
|
||||||
/>Selectionner toutes les tâches</label
|
/>Selectionner toutes les tâches</label
|
||||||
>
|
>
|
||||||
|
<div class="casesRestantes">{{ toDoRest() }} tâche(s) restante(s)</div>
|
||||||
</div>
|
</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>
|
||||||
@ -80,6 +81,5 @@
|
|||||||
Terminées
|
Terminées
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
|
|
||||||
</div>
|
</div> -->
|
||||||
|
@ -1,30 +1,60 @@
|
|||||||
|
.container {
|
||||||
|
border: 3px #4e9e7b solid;
|
||||||
|
padding: 5%;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 30%;
|
||||||
|
margin: 5%;
|
||||||
|
border-radius: 5%;
|
||||||
|
margin-bottom: 20% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.todo-title {
|
.todo-title {
|
||||||
width: 25%;
|
width: 75%;
|
||||||
padding: 10px 18px;
|
padding: 10px 18px;
|
||||||
font-size: xx-large;
|
font-size: large !important;
|
||||||
margin-bottom: 16px;
|
font-weight: bold !important;
|
||||||
|
color: #4e9e7b !important;
|
||||||
|
border-top-color: #4e9e7b !important;
|
||||||
|
border-left-color: #4e9e7b !important;
|
||||||
|
border-radius: 5% !important;
|
||||||
|
margin-top: 0%;
|
||||||
|
margin-bottom: 5%;
|
||||||
|
margin-right: 3% !important;
|
||||||
|
color: black;
|
||||||
|
box-shadow: 5px 5px 5px gray;
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
background-color: lightgray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.todo-input {
|
.todo-input {
|
||||||
width: 20%;
|
width: 75%;
|
||||||
padding: 10px 18px;
|
padding: 10px 18px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
color: white !important;
|
||||||
|
background-color: #4e9e7b !important;
|
||||||
|
border-radius: 5%;
|
||||||
|
margin-left: 4%;
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
background-color: lightgray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.element {
|
.element {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
animation-duration: 0.3s;
|
animation-duration: 0.3s;
|
||||||
|
color: black;
|
||||||
|
background-color: #4e9e7b;
|
||||||
|
}
|
||||||
|
|
||||||
|
::placeholder {
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleteTache {
|
.deleteTache {
|
||||||
@ -36,56 +66,66 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.element-gauche { // later
|
.element-gauche {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nomTache{
|
.nomTache {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid white;
|
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modifier-element {
|
.modifier-element {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #2c3e50;
|
color: white;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid rgb(204, 204, 204); //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;
|
background-color: grey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selection {
|
||||||
|
margin-left: 0%;
|
||||||
|
text-align: left;
|
||||||
|
font-size: medium;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #4e9e7b;
|
||||||
|
}
|
||||||
|
|
||||||
.completed {
|
.completed {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: grey;
|
color: white !important;
|
||||||
|
}
|
||||||
|
.casesRestantes {
|
||||||
|
color: #4cc690;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* button {
|
||||||
button {
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: lightgreen;
|
background: grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
.active {
|
/* .active {
|
||||||
background: lightgreen;
|
background: grey;
|
||||||
}
|
} */
|
||||||
.completed {
|
/* .completed {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: grey;
|
color: grey;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Tache} from 'src/app/models/tache';
|
import { Tache } from 'src/app/models/tache';
|
||||||
import { ToDoList} from 'src/app/models/to-do-list';
|
import { ToDoList } from 'src/app/models/to-do-list';
|
||||||
import { TodoService } from 'src/app/services/todo.service';
|
import { TodoService } from 'src/app/services/todo.service';
|
||||||
import { TodoList } from 'src/app/todo-list';
|
import { TodoList } from 'src/app/todo-list';
|
||||||
|
|
||||||
@ -16,49 +16,59 @@ export class ToDoListComponent implements OnInit {
|
|||||||
//public todos: ToDoList[];
|
//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 result: any;
|
||||||
public tache : Tache [];
|
public tache: Tache[];
|
||||||
|
|
||||||
constructor(private TodoService : TodoService, private router: Router ) {
|
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 = [];
|
this.tache = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.beforeEditCache = '';
|
this.beforeEditCache = '';
|
||||||
this.casesRestantes=true;
|
this.casesRestantes = true;
|
||||||
this.filter='tous';
|
this.filter = 'tous';
|
||||||
this.idTodo = 4;
|
this.idTodo = 4;
|
||||||
this.todoTitle = '';
|
this.todoTitle = '';
|
||||||
|
}
|
||||||
|
//supprimer la todoList
|
||||||
|
deleteTodo(id: number): void {
|
||||||
|
this.TodoService.deleteTodoById(id).subscribe((resp) => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//ajouter tache
|
//ajouter tache
|
||||||
|
|
||||||
addTache(idTodoList : number) {//idTodoList id que la todoList que l'on récupère
|
addTache(idTodoList: number) {
|
||||||
console.log(idTodoList);
|
//idTodoList id que la todoList que l'on récupère
|
||||||
|
console.log(idTodoList);
|
||||||
const tache: Tache = {
|
const tache: Tache = {
|
||||||
id : 0,
|
id: 0,
|
||||||
texte: this.todoTitle,
|
texte: this.todoTitle,
|
||||||
etat : false,
|
etat: false,
|
||||||
editing : false,
|
editing: false,
|
||||||
|
};
|
||||||
}
|
|
||||||
console.log(this.tache);
|
console.log(this.tache);
|
||||||
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
this.TodoService.addTache(tache, idTodoList).subscribe((resp) => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//modifier le titre de la to-do-list
|
||||||
|
updateTodo(todoList: ToDoList): void {
|
||||||
|
this.TodoService.updateTodo(todoList)?.subscribe((resp) => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//modifier par l'input
|
//modifier par l'input
|
||||||
modifier(tache: Tache): void {
|
modifier(tache: Tache): void {
|
||||||
@ -71,13 +81,12 @@ console.log(idTodoList);
|
|||||||
if (tache.texte.trim().length === 0) {
|
if (tache.texte.trim().length === 0) {
|
||||||
tache.texte = this.beforeEditCache;
|
tache.texte = this.beforeEditCache;
|
||||||
}
|
}
|
||||||
this.casesRestantes= this.casesQuiRestes();
|
this.casesRestantes = this.casesQuiRestes();
|
||||||
tache.editing = false;
|
tache.editing = false;
|
||||||
this.TodoService.updateTache(tache).subscribe((resp)=>{
|
this.TodoService.updateTache(tache).subscribe((resp) => {
|
||||||
console.log(tache);
|
console.log(tache);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// annuler la modification
|
// annuler la modification
|
||||||
@ -87,23 +96,20 @@ console.log(idTodoList);
|
|||||||
}
|
}
|
||||||
|
|
||||||
//supprimer la tache
|
//supprimer la tache
|
||||||
deleteTodo(id: number) {
|
deleteTache(id: number) {
|
||||||
this.TodoService.deleteTacheById(id).subscribe(
|
this.TodoService.deleteTacheById(id).subscribe((resp) => {
|
||||||
resp =>{
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
});
|
||||||
);}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//nombre de tâches restantes
|
//nombre de tâches restantes
|
||||||
toDoRest(): number{
|
toDoRest(): number {
|
||||||
return this.todo.taches.filter((tache: Tache)=> !tache.etat).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.todo.taches.filter((tache: Tache)=> tache).length>0;
|
return this.todo.taches.filter((tache: Tache) => tache).length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Effacer la to do list
|
//Effacer la to do list
|
||||||
@ -125,7 +131,7 @@ console.log(idTodoList);
|
|||||||
}
|
}
|
||||||
|
|
||||||
//barre de filtre des tâches
|
//barre de filtre des tâches
|
||||||
/* todosFilter(): ToDoList[] {
|
/* todosFilter(): ToDoList[] {
|
||||||
if(this.filter === 'tous'){
|
if(this.filter === 'tous'){
|
||||||
return this.todo.taches
|
return this.todo.taches
|
||||||
}else if (this.filter === 'active'){
|
}else if (this.filter === 'active'){
|
||||||
@ -135,6 +141,4 @@ console.log(idTodoList);
|
|||||||
}
|
}
|
||||||
return this.todo
|
return this.todo
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
5
src/app/models/mail.ts
Normal file
5
src/app/models/mail.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface Mail {
|
||||||
|
recipient: string;
|
||||||
|
subject: string;
|
||||||
|
message: string;
|
||||||
|
}
|
@ -3,9 +3,6 @@ import { Team } from './team';
|
|||||||
|
|
||||||
export interface ToDoList {
|
export interface ToDoList {
|
||||||
nom: string;
|
nom: string;
|
||||||
team: Team;
|
taches: Tache[];
|
||||||
taches: Tache [];
|
id: number;
|
||||||
id:number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-accueil',
|
selector: 'app-page-accueil',
|
||||||
@ -7,9 +10,15 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class PageAccueilComponent implements OnInit {
|
export class PageAccueilComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(private http: HttpClient, private router: Router, private tokenService: TokenService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
const token = this.tokenService.getToken();
|
||||||
|
if(token){
|
||||||
|
this.router.navigate(['tableau-de-bord']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { Mail } from 'src/app/models/mail';
|
||||||
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 { MailService } from 'src/app/services/mail.service';
|
||||||
import { MembreService } from 'src/app/services/membre.service';
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -15,6 +17,7 @@ export class PageAddMemberComponent implements OnInit {
|
|||||||
public addMemberForm: FormGroup;
|
public addMemberForm: FormGroup;
|
||||||
constructor(
|
constructor(
|
||||||
private membreService: MembreService,
|
private membreService: MembreService,
|
||||||
|
private mailService: MailService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
@ -75,9 +78,21 @@ export class PageAddMemberComponent implements OnInit {
|
|||||||
roleList: [roleValue]
|
roleList: [roleValue]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const mail: Mail = {
|
||||||
|
recipient: emailValue,
|
||||||
|
subject: "Votre mot de passe Organizee",
|
||||||
|
//message: 'Votre mot de passe'
|
||||||
|
message: `Bonjour ${firstNameValue}!\n Voici vos identifiants de connexion : \n
|
||||||
|
Identifiant : ${emailValue}
|
||||||
|
Mot de passe : ${passwordValue}`
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
if (membre.email !== '' && membre.password !== '') {
|
if (membre.email !== '' && membre.password !== '') {
|
||||||
this.membreService.addMembre(membre)?.subscribe((resp) => {
|
this.membreService.addMembre(membre)?.subscribe((resp) => {
|
||||||
|
this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
|
||||||
|
console.log("Mail envoyé");
|
||||||
|
})
|
||||||
this.router.navigate(['compte']);
|
this.router.navigate(['compte']);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -188,8 +188,8 @@ export class PageAgendaComponent implements AfterViewInit {
|
|||||||
end: args.e.end(),
|
end: args.e.end(),
|
||||||
id: args.e.id(),
|
id: args.e.id(),
|
||||||
barColor: "#555555",
|
barColor: "#555555",
|
||||||
text: args.e.text(),
|
text: this.rdvSplit(args.e.text()),
|
||||||
membre: {id:this.userId},
|
membre: {id:args.e.data.tags.membre},
|
||||||
team: {id:this.teamId}
|
team: {id:this.teamId}
|
||||||
}
|
}
|
||||||
this.evenementService.updateEvenements(event).subscribe(
|
this.evenementService.updateEvenements(event).subscribe(
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px;
|
padding: 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ button{
|
|||||||
|
|
||||||
#boxFour{
|
#boxFour{
|
||||||
height: 150px;
|
height: 150px;
|
||||||
margin-top: -70px;
|
margin-top: -99px;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,22 @@
|
|||||||
<label for="floatingInput">Adresse email</label>
|
<label for="floatingInput">Adresse email</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="w-100 btn btn-lg btn-success" type="submit" [disabled]="forgotForm.invalid" routerLink="../reinitialisation-password"
|
<!-- <button class="w-100 btn btn-lg btn-success" type="submit" [disabled]="forgotForm.invalid" routerLink="../reinitialisation-password"
|
||||||
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button>
|
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button> -->
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="w-100 btn btn-lg btn-outline-success"
|
||||||
|
type="submit"
|
||||||
|
[disabled]="forgotForm.invalid">
|
||||||
|
Ré-initialiser mon mot de passe
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
<br/> <br/>
|
||||||
|
<div *ngIf="isShow">
|
||||||
|
<div class="alert alert-{{alert.type}}" role="alert">
|
||||||
|
{{alert.content}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!--
|
<!--
|
||||||
<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>
|
||||||
|
@ -7,6 +7,9 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
Validators,
|
Validators,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
|
import { Membre } from 'src/app/models/membre';
|
||||||
|
import { MailService } from 'src/app/services/mail.service';
|
||||||
|
import { Mail } from 'src/app/models/mail';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-forgot-password',
|
selector: 'app-page-forgot-password',
|
||||||
@ -14,18 +17,76 @@ import {
|
|||||||
styleUrls: ['./page-forgot-password.component.scss']
|
styleUrls: ['./page-forgot-password.component.scss']
|
||||||
})
|
})
|
||||||
export class PageForgotPasswordComponent implements OnInit {
|
export class PageForgotPasswordComponent implements OnInit {
|
||||||
constructor(private authService: AuthService, private router: Router) {
|
|
||||||
|
|
||||||
|
alert : any;
|
||||||
|
isShow : boolean;
|
||||||
|
|
||||||
|
constructor(private authService: AuthService, private router: Router, private mailService: MailService,) {
|
||||||
|
this.alert = "";
|
||||||
|
this.isShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
public onSubmit(submittedForm: any): void {
|
public onSubmit(submittedForm: any): void {
|
||||||
console.log(submittedForm.form.value);
|
const membre: Membre = {
|
||||||
|
nom: "",
|
||||||
|
prenom: "",
|
||||||
|
dateNaissance: new Date(),
|
||||||
|
email: submittedForm.form.value.email,
|
||||||
|
password: "",
|
||||||
|
roleList: ["ROLE_PARENT"],
|
||||||
|
couleur: "",
|
||||||
|
passwordConfirm: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(membre);
|
||||||
|
// this.authService.forgotPassword(membre).subscribe((resp) => {
|
||||||
|
// console.log('----'+resp)
|
||||||
|
// });
|
||||||
|
|
||||||
|
this.authService.forgotPassword(membre).subscribe(
|
||||||
|
{
|
||||||
|
next: result => {
|
||||||
|
this.alert={"type":"success", "content":"Un mail à été envoyé !"};
|
||||||
|
this.isShow = true;
|
||||||
|
const mail: Mail = {
|
||||||
|
recipient: submittedForm.form.value.email,
|
||||||
|
subject: "Votre mot de passe Organizee",
|
||||||
|
//message: 'Votre mot de passe'
|
||||||
|
message: `
|
||||||
|
Bonjour!\n
|
||||||
|
Vous avez fait une demande de ré-initialisation de mot de passe. \n
|
||||||
|
Cliquez sur le lien pour définir un nouveau mot de passe: \n
|
||||||
|
Lien : http://192.168.1.16:4200/reinitialisation-password/${result}`
|
||||||
|
};
|
||||||
|
this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
|
||||||
|
console.log("Mail envoyé");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.alert={"type":"danger", "content":"Le mail a merdé, ou il n'y a personne ds la bdd !"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// service resetpassword
|
||||||
|
// creer un random et le mettre dans password
|
||||||
|
//service envoi de mail // envoyer un lien avec ce random
|
||||||
|
// nouveau formulaire de reset password
|
||||||
|
// update du password
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const email = submittedForm.form.value['email'];
|
// const email = submittedForm.form.value['email'];
|
||||||
// console.log(email);
|
// console.log(email);
|
||||||
window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
//window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
||||||
// this.router.navigate(['reinitialisation-password']);
|
// this.router.navigate(['reinitialisation-password']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
|
|
||||||
<div class="col compte text-center py-3 border">
|
<div class="col compte text-center py-3 border">
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">
|
|
||||||
Tous les contacts
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
|
*ngIf="parent"
|
||||||
routerLink="/ajouter-contact"
|
routerLink="/ajouter-contact"
|
||||||
class="btn btn-sm btn-rounded btn-secondary m-3"
|
class="btn btn-sm btn-rounded btn-secondary m-3"
|
||||||
>
|
>
|
||||||
|
@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Contact } from 'src/app/models/contact';
|
import { Contact } from 'src/app/models/contact';
|
||||||
import { RepertoireService } from 'src/app/services/repertoire.service';
|
import { RepertoireService } from 'src/app/services/repertoire.service';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-repertoire',
|
selector: 'app-page-repertoire',
|
||||||
@ -15,18 +16,27 @@ export class PageRepertoireComponent implements OnInit {
|
|||||||
public personneid: any;
|
public personneid: any;
|
||||||
keyword: any;
|
keyword: any;
|
||||||
openDetails: any;
|
openDetails: any;
|
||||||
|
parent: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private repertoireService: RepertoireService,
|
private repertoireService: RepertoireService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute
|
private route: ActivatedRoute,
|
||||||
|
private tokenService: TokenService
|
||||||
) {
|
) {
|
||||||
this.listContact = [];
|
this.listContact = [];
|
||||||
this.listFull = [];
|
this.listFull = [];
|
||||||
this.listContactInfo = '';
|
this.listContactInfo = '';
|
||||||
|
this.parent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
const roleUser = this.tokenService.getRole();
|
||||||
|
|
||||||
|
if(roleUser == "ROLE_PARENT"){
|
||||||
|
this.parent = true;
|
||||||
|
}
|
||||||
|
|
||||||
//récupère tout les contact et leurs info
|
//récupère tout les contact et leurs info
|
||||||
this.repertoireService.getContact().subscribe((listContact: any[]) => {
|
this.repertoireService.getContact().subscribe((listContact: any[]) => {
|
||||||
console.log(listContact);
|
console.log(listContact);
|
||||||
|
@ -1,19 +1,45 @@
|
|||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<div class="reset-form text-center">
|
<div class="reset-form text-center">
|
||||||
<main class="form-reset">
|
<main class="form-reset">
|
||||||
<form (ngSubmit)="onSubmit(resetForm)" #resetForm="ngForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="resetForm">
|
||||||
<h3>Entrez ici votre email et votre nouveau mot de passe</h3>
|
<h3>Entrez ici votre email et votre nouveau mot de passe</h3>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="email" class="form-control" id="floatingEmail" placeholder="" name="email" ngModel required
|
<input
|
||||||
[ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['email'] != '' ,
|
type="password"
|
||||||
'is-invalid': resetForm.form.touched && resetForm.form.value['email'] == ''}">
|
class="form-control"
|
||||||
<label for="floatingEmail">Email</label>
|
id="floatingPassword"
|
||||||
|
placeholder=""
|
||||||
|
name="password"
|
||||||
|
formControlName="passwordFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
resetForm.controls['passwordFc'].touched &&
|
||||||
|
resetForm.controls['passwordFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
resetForm.controls['passwordFc'].touched &&
|
||||||
|
!resetForm.controls['passwordFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingPassword">MOT DE PASSE</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
|
<input
|
||||||
required [ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['password'] != '' ,
|
type="password"
|
||||||
'is-invalid': resetForm.form.touched && resetForm.form.value['password'] == ''}">
|
class="form-control"
|
||||||
<label for="floatingPassword">Mot de passe</label>
|
id="floatingpasswordConfirm"
|
||||||
|
placeholder=""
|
||||||
|
name="passwordConfirm"
|
||||||
|
formControlName="passwordConfirmFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
resetForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
resetForm.controls['passwordConfirmFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
resetForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
!resetForm.controls['passwordConfirmFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="w-100 btn btn-outline-success" type="submit" [disabled]="resetForm.invalid">Enregistrer</button>
|
<button class="w-100 btn btn-outline-success" type="submit" [disabled]="resetForm.invalid">Enregistrer</button>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { Membre } from 'src/app/models/membre';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
|
||||||
|
|
||||||
@ -9,20 +11,80 @@ import { AuthService } from 'src/app/services/auth.service';
|
|||||||
styleUrls: ['./page-reset-password.component.scss']
|
styleUrls: ['./page-reset-password.component.scss']
|
||||||
})
|
})
|
||||||
export class PageResetPasswordComponent implements OnInit {
|
export class PageResetPasswordComponent implements OnInit {
|
||||||
|
public resetForm: FormGroup;
|
||||||
|
uuid:string;
|
||||||
|
constructor(private authService: AuthService, private router: Router,private fb: FormBuilder, private activatedRoute: ActivatedRoute) {
|
||||||
|
this.resetForm = new FormGroup({});
|
||||||
|
this.uuid = this.activatedRoute.snapshot.params['uuid'];
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private authService: AuthService, private router: Router,) { }
|
ngOnInit(): void {
|
||||||
|
this.resetForm = this.fb.group(
|
||||||
|
{
|
||||||
|
passwordFc: new FormControl('', [
|
||||||
|
Validators.minLength(8),
|
||||||
|
Validators.required,
|
||||||
|
]),
|
||||||
|
passwordConfirmFc: new FormControl('', [
|
||||||
|
Validators.minLength(8),
|
||||||
|
Validators.required,
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: this.ConfirmedValidator('passwordFc', 'passwordConfirmFc'),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void { }
|
// public onSubmit(submittedForm: any): void {
|
||||||
|
// console.log(submittedForm.form.value);
|
||||||
|
// const password = submittedForm.form.value['password'];
|
||||||
|
// console.log(email);
|
||||||
|
// this.authService.resetPassword(email, password).subscribe((resp: any) => {
|
||||||
|
// window.alert("Votre mot de passe est bien ré-initialisé !")
|
||||||
|
// this.router.navigate(['accueil']);
|
||||||
|
|
||||||
public onSubmit(submittedForm: any): void {
|
// });
|
||||||
console.log(submittedForm.form.value);
|
// }
|
||||||
const password = submittedForm.form.value['password'];
|
|
||||||
const email = submittedForm.form.value['email'];
|
|
||||||
console.log(email);
|
|
||||||
this.authService.resetPassword(email, password).subscribe((resp: any) => {
|
|
||||||
window.alert("Votre mot de passe est bien ré-initialisé !")
|
|
||||||
this.router.navigate(['accueil']);
|
|
||||||
|
|
||||||
});
|
public onSubmit(): void {
|
||||||
|
console.log('value : ', this.resetForm.value);
|
||||||
|
console.log('form : ', this.resetForm);
|
||||||
|
const passwordValue = this.resetForm.value['passwordFc'];
|
||||||
|
const passwordConfirmValue = this.resetForm.value['passwordConfirmFc'];
|
||||||
|
|
||||||
|
const membre: Membre = {
|
||||||
|
nom: "",
|
||||||
|
prenom: "",
|
||||||
|
dateNaissance: new Date(),
|
||||||
|
email: "",
|
||||||
|
password: passwordValue,
|
||||||
|
roleList: ["ROLE_PARENT"],
|
||||||
|
couleur: "",
|
||||||
|
passwordConfirm: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.authService.resetPassword(membre,this.uuid).subscribe((resp) => {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfirmedValidator(controlName: string, matchingControlName: string) {
|
||||||
|
return (formGroup: FormGroup) => {
|
||||||
|
const control = formGroup.controls[controlName];
|
||||||
|
const matchingControl = formGroup.controls[matchingControlName];
|
||||||
|
if (
|
||||||
|
matchingControl.errors &&
|
||||||
|
!matchingControl.errors['confirmedValidator']
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (control.value !== matchingControl.value) {
|
||||||
|
matchingControl.setErrors({ confirmedValidator: true });
|
||||||
|
} else {
|
||||||
|
matchingControl.setErrors(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,27 @@
|
|||||||
<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 menu text-center">
|
||||||
|
<h2>To-Do-List</h2>
|
||||||
|
<div class="d-flex align-items-stretch"></div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="btn btn-outline-success"
|
||||||
|
placeholder=" Ajouter une To-Do-List"
|
||||||
|
[(ngModel)]="todoListTitle"
|
||||||
|
(keyup.enter)="addTodoByTeamId()"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="d-flex align-items-stretch">
|
<div class="d-flex align-items-stretch">
|
||||||
<div class="row">
|
<div class="custom-main container p-3">
|
||||||
<div class="col" *ngFor="let todos of result">
|
<div class="row">
|
||||||
<app-to-do-list [todo]="todos"> </app-to-do-list>
|
<div class="col" *ngFor="let todos of listTodos">
|
||||||
|
<app-to-do-list [todo]="todos"> </app-to-do-list>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
.btn {
|
||||||
|
margin-top: 1%;
|
||||||
|
margin-bottom: 1%;
|
||||||
|
color: black;
|
||||||
|
box-shadow: 5px 5px 5px gray;
|
||||||
|
}
|
@ -1,26 +1,50 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ToDoList } from 'src/app/models/to-do-list';
|
||||||
import { TodoService } from 'src/app/services/todo.service';
|
import { TodoService } from 'src/app/services/todo.service';
|
||||||
|
import { Team } from 'src/app/models/team';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-to-do-list',
|
selector: 'app-page-to-do-list',
|
||||||
templateUrl: './page-to-do-list.component.html',
|
templateUrl: './page-to-do-list.component.html',
|
||||||
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;
|
public result: any;
|
||||||
|
public listTodos: any[];
|
||||||
constructor(private TodoService : TodoService) { }
|
public todoListTitle: string;
|
||||||
|
public idTodo: number;
|
||||||
ngOnInit(): void {
|
|
||||||
this.TodoService.getToDoListByTeamId().subscribe((data :any)=>{
|
|
||||||
|
|
||||||
this.result = data;
|
|
||||||
console.log(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
constructor(private TodoService: TodoService) {
|
||||||
|
this.listTodos = [];
|
||||||
|
this.todoListTitle = '';
|
||||||
|
this.idTodo = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.TodoService.getToDoListByTeamId()?.subscribe((listTodos: any) => {
|
||||||
|
console.log(listTodos);
|
||||||
|
this.listTodos = listTodos;
|
||||||
|
this.todoListTitle = '';
|
||||||
|
this.idTodo = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//Ajouter une todo List
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,17 +44,13 @@ export class AuthService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forgotPassword(email: string): Observable<any> {
|
forgotPassword(membre: Membre): Observable<any> {
|
||||||
const body = {
|
return this.http.post(`${this.apiUrl}/membres/forgot-password`, membre, {responseType: "text"});
|
||||||
email: email,
|
|
||||||
};
|
|
||||||
return this.http.get(`${this.apiUrl}/membres/forgot-password`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resetPassword(email: string, password: string): Observable<any> {
|
resetPassword(membre: Membre, uuid:string): Observable<any> {
|
||||||
const body = password;
|
console.log('--'+uuid+' / '+membre);
|
||||||
console.log(password);
|
return this.http.put(`${this.apiUrl}/membres/reset-password/${uuid}`, membre);
|
||||||
return this.http.put(`${this.apiUrl}/membres/reset-password/${email}`, body);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
creationTeam(team: Team): Observable<any> {
|
creationTeam(team: Team): Observable<any> {
|
||||||
|
16
src/app/services/mail.service.spec.ts
Normal file
16
src/app/services/mail.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { MailService } from './mail.service';
|
||||||
|
|
||||||
|
describe('MailService', () => {
|
||||||
|
let service: MailService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(MailService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
29
src/app/services/mail.service.ts
Normal file
29
src/app/services/mail.service.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { Mail } from '../models/mail';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MailService {
|
||||||
|
apiUrl: string;
|
||||||
|
tokenKey: string;
|
||||||
|
|
||||||
|
constructor(private http: HttpClient, private tokenService: TokenService, private router: Router) {
|
||||||
|
this.apiUrl = environment.apiUrl;
|
||||||
|
this.tokenKey = environment.tokenKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
envoiMailText(mail: Mail): Observable<any> | void{
|
||||||
|
return this.http.post(`${this.apiUrl}/sendmail/text`, mail, {
|
||||||
|
responseType: "text"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -4,6 +4,8 @@ import { Observable } from 'rxjs';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Tache } from '../models/tache';
|
import { Tache } from '../models/tache';
|
||||||
import { ToDoList } from '../models/to-do-list';
|
import { ToDoList } from '../models/to-do-list';
|
||||||
|
import { TodoList } from '../todo-list';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@ -12,12 +14,13 @@ export class TodoService {
|
|||||||
private toDoList: any;
|
private toDoList: any;
|
||||||
private apiUrl: string;
|
private apiUrl: string;
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient, private tokenService: TokenService) {
|
||||||
this.apiUrl = environment.apiUrl;
|
this.apiUrl = environment.apiUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
getToDoListByTeamId(): Observable<any> {
|
getToDoListByTeamId(): Observable<any> | void {
|
||||||
return this.http.get(`${this.apiUrl}/todolist/team/1`);
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
return this.http.get(`${this.apiUrl}/todolist/team/${teamId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteTacheById(idTache: any): Observable<any> {
|
deleteTacheById(idTache: any): Observable<any> {
|
||||||
@ -27,12 +30,27 @@ export class TodoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addTache(newtache: Tache, idTodoList: number): Observable<any> {
|
addTache(newtache: Tache, idTodoList: number): Observable<any> {
|
||||||
// console.log(newtache);
|
// console.log(newtache);
|
||||||
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTache(tache: Tache): Observable<any> {
|
updateTache(tache: Tache): Observable<any> {
|
||||||
console.log(tache);
|
console.log(tache);
|
||||||
return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
|
return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
|
||||||
}
|
}
|
||||||
|
addTodoByTeamId(newtodoList: TodoList): Observable<any> {
|
||||||
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
console.log(newtodoList + 'newtodoList');
|
||||||
|
return this.http.post(`${this.apiUrl}/todolist/add/${teamId}`, newtodoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteTodoById(idTodo: any): Observable<any> {
|
||||||
|
return this.http.delete(`${this.apiUrl}/todolist/delete/${idTodo}`, {
|
||||||
|
responseType: 'text',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
updateTodo(todoList: TodoList): Observable<any> {
|
||||||
|
console.log(todoList);
|
||||||
|
return this.http.put(`${this.apiUrl}/todolist/update/666`, todoList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: 'http://localhost:8088',
|
apiUrl: 'http://localhost:8080',
|
||||||
tokenKey: 'TOKEN-ORGANIZEE',
|
tokenKey: 'TOKEN-ORGANIZEE',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user