diff --git a/src/app/components/fiche-contact/fiche-contact.component.ts b/src/app/components/fiche-contact/fiche-contact.component.ts
index f6c1a8a..2c2a1b5 100644
--- a/src/app/components/fiche-contact/fiche-contact.component.ts
+++ b/src/app/components/fiche-contact/fiche-contact.component.ts
@@ -1,4 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { TokenService } from 'src/app/services/token.service';
@Component({
selector: 'app-fiche-contact',
@@ -8,10 +9,20 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
export class FicheContactComponent implements OnInit {
@Input() personne: any;
@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){
window.alert("Le contact à bien été supprimé!")
diff --git a/src/app/components/signin/signin.component.html b/src/app/components/signin/signin.component.html
index 33e5f02..83e4a52 100644
--- a/src/app/components/signin/signin.component.html
+++ b/src/app/components/signin/signin.component.html
@@ -23,9 +23,14 @@
routerLinkActive="active-custom">S'inscrire
-
-
diff --git a/src/app/components/signin/signin.component.ts b/src/app/components/signin/signin.component.ts
index 7ae9a33..ff6c04d 100644
--- a/src/app/components/signin/signin.component.ts
+++ b/src/app/components/signin/signin.component.ts
@@ -14,9 +14,10 @@ import {
styleUrls: ['./signin.component.scss'],
})
export class SigninComponent implements OnInit {
- public errorForm: boolean;
+ alert : any;
+ isShow : boolean;
constructor(private authService: AuthService, private router: Router) {
- this.errorForm = false;
+ this.isShow = false;
}
ngOnInit(): void {}
@@ -26,18 +27,21 @@ export class SigninComponent implements OnInit {
const email = submittedForm.form.value['email'];
const password = submittedForm.form.value['password'];
if (email !== '' && password !== '') {
- this.authService.signin(email, password).subscribe((resp) => {
- console.log('Component Signin: ', resp);
- //if(resp == ){
- this.router.navigate(['tableau-de-bord']);
- //}else{
- // window.alert("Votre identifiant/mot de passe est erroné");
- //}
- console.log('Component Signin: ', resp);
- });
+ this.authService.signin(email, password).subscribe(
+ {
+ next: resp => {
+ this.router.navigate(['tableau-de-bord']);
+ },
+ error: err => {
+ this.alert={"type":"danger", "content":"Le login ou paswword est invalide"};
+ this.isShow = true;
+ },
+ complete: () => console.log('DONE!')
+ });
} else {
// afficher une erreur à l'utilisateur
- this.errorForm = true;
+ this.alert={"type":"danger", "content":"Le login ou password est invalide"};
+ this.isShow = true;
}
}
}
diff --git a/src/app/components/to-do-list/to-do-list.component.html b/src/app/components/to-do-list/to-do-list.component.html
index e06e89c..02f7e08 100644
--- a/src/app/components/to-do-list/to-do-list.component.html
+++ b/src/app/components/to-do-list/to-do-list.component.html
@@ -1,69 +1,70 @@
-
+
-
-
-
-->
diff --git a/src/app/components/to-do-list/to-do-list.component.scss b/src/app/components/to-do-list/to-do-list.component.scss
index 9ff8f30..7bfbde7 100644
--- a/src/app/components/to-do-list/to-do-list.component.scss
+++ b/src/app/components/to-do-list/to-do-list.component.scss
@@ -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 {
- width: 25%;
+ width: 75%;
padding: 10px 18px;
- font-size: xx-large;
- margin-bottom: 16px;
+ font-size: large !important;
+ 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 {
outline: 0;
+ background-color: lightgray;
}
}
.todo-input {
- width: 20%;
+ width: 75%;
padding: 10px 18px;
font-size: 18px;
margin-bottom: 16px;
+ color: white !important;
+ background-color: #4e9e7b !important;
+ border-radius: 5%;
+ margin-left: 4%;
&:focus {
outline: 0;
+ background-color: lightgray;
}
}
-
.element {
margin-bottom: 12px;
display: flex;
align-items: center;
justify-content: space-between;
animation-duration: 0.3s;
+ color: black;
+ background-color: #4e9e7b;
+}
+
+::placeholder {
+ color: white;
}
.deleteTache {
@@ -36,56 +66,66 @@
}
}
-.element-gauche { // later
+.element-gauche {
display: flex;
align-items: center;
}
-.nomTache{
+.nomTache {
padding: 10px;
- border: 1px solid white;
margin-left: 12px;
}
.modifier-element {
font-size: 24px;
- color: #2c3e50;
+ color: white;
margin-left: 12px;
width: 100%;
padding: 10px;
border: 1px solid rgb(204, 204, 204); //override defaults
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
+ font-family: "Avenir", Helvetica, Arial, sans-serif;
&:focus {
outline: none;
- background-color:aquamarine;
+ background-color: grey;
}
}
+.selection {
+ margin-left: 0%;
+ text-align: left;
+ font-size: medium;
+ font-weight: bold;
+ color: #4e9e7b;
+}
+
.completed {
text-decoration: line-through;
- color: grey;
+ color: white !important;
+}
+.casesRestantes {
+ color: #4cc690;
}
-
-button {
+/* button {
font-size: 14px;
background-color: white;
appearance: none;
&:hover {
- background: lightgreen;
+ background: grey;
}
&:focus {
outline: none;
}
-}
+} */
-.active {
- background: lightgreen;
-}
-.completed {
+/* .active {
+ background: grey;
+} */
+/* .completed {
text-decoration: line-through;
color: grey;
}
+ */
diff --git a/src/app/components/to-do-list/to-do-list.component.ts b/src/app/components/to-do-list/to-do-list.component.ts
index 6780170..f5dd560 100644
--- a/src/app/components/to-do-list/to-do-list.component.ts
+++ b/src/app/components/to-do-list/to-do-list.component.ts
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
-import { Tache} from 'src/app/models/tache';
-import { ToDoList} from 'src/app/models/to-do-list';
+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';
@@ -16,49 +16,59 @@ export class ToDoListComponent implements OnInit {
//public todos: ToDoList[];
public todoTitle: string;
public idTodo: number;
- public filter : string;
- public casesRestantes : boolean;
+ public filter: string;
+ public casesRestantes: boolean;
public masterSelected: boolean;
- public result : any;
- public tache : Tache [];
+ public result: any;
+ public tache: Tache[];
- constructor(private TodoService : TodoService, private router: Router ) {
+ constructor(private TodoService: TodoService, private router: Router) {
this.beforeEditCache = '';
//this.todos = [];
this.todoTitle = '';
this.idTodo = 0;
- this.filter ='';
- this.casesRestantes=true;
- this.masterSelected= false;
+ this.filter = '';
+ this.casesRestantes = true;
+ this.masterSelected = false;
this.tache = [];
}
ngOnInit(): void {
this.beforeEditCache = '';
- this.casesRestantes=true;
- this.filter='tous';
+ this.casesRestantes = true;
+ this.filter = 'tous';
this.idTodo = 4;
this.todoTitle = '';
-
+ }
+ //supprimer la todoList
+ deleteTodo(id: number): void {
+ this.TodoService.deleteTodoById(id).subscribe((resp) => {
+ window.location.reload();
+ });
}
//ajouter tache
- addTache(idTodoList : number) {//idTodoList id que la todoList que l'on récupère
-console.log(idTodoList);
+ addTache(idTodoList: number) {
+ //idTodoList id que la todoList que l'on récupère
+ console.log(idTodoList);
const tache: Tache = {
- id : 0,
+ id: 0,
texte: this.todoTitle,
- etat : false,
- editing : false,
-
- }
+ etat: false,
+ editing: false,
+ };
console.log(this.tache);
- this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
+ this.TodoService.addTache(tache, idTodoList).subscribe((resp) => {
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(tache: Tache): void {
@@ -71,13 +81,12 @@ console.log(idTodoList);
if (tache.texte.trim().length === 0) {
tache.texte = this.beforeEditCache;
}
- this.casesRestantes= this.casesQuiRestes();
+ this.casesRestantes = this.casesQuiRestes();
tache.editing = false;
- this.TodoService.updateTache(tache).subscribe((resp)=>{
+ this.TodoService.updateTache(tache).subscribe((resp) => {
console.log(tache);
window.location.reload();
- })
-
+ });
}
// annuler la modification
@@ -87,23 +96,20 @@ console.log(idTodoList);
}
//supprimer la tache
- deleteTodo(id: number) {
- this.TodoService.deleteTacheById(id).subscribe(
- resp =>{
+ deleteTache(id: number) {
+ this.TodoService.deleteTacheById(id).subscribe((resp) => {
window.location.reload();
- }
- );}
-
-
+ });
+ }
//nombre de tâches restantes
- toDoRest(): number{
- return this.todo.taches.filter((tache: Tache)=> !tache.etat).length;
+ toDoRest(): number {
+ return this.todo.taches.filter((tache: Tache) => !tache.etat).length;
}
//Cocher toutes les tâches de la liste
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
@@ -125,7 +131,7 @@ console.log(idTodoList);
}
//barre de filtre des tâches
- /* todosFilter(): ToDoList[] {
+ /* todosFilter(): ToDoList[] {
if(this.filter === 'tous'){
return this.todo.taches
}else if (this.filter === 'active'){
@@ -135,6 +141,4 @@ console.log(idTodoList);
}
return this.todo
} */
- }
-
-
+}
diff --git a/src/app/models/mail.ts b/src/app/models/mail.ts
new file mode 100644
index 0000000..d4d7afe
--- /dev/null
+++ b/src/app/models/mail.ts
@@ -0,0 +1,5 @@
+export interface Mail {
+ recipient: string;
+ subject: string;
+ message: string;
+}
diff --git a/src/app/models/to-do-list.ts b/src/app/models/to-do-list.ts
index ec149d4..4b8c345 100644
--- a/src/app/models/to-do-list.ts
+++ b/src/app/models/to-do-list.ts
@@ -3,9 +3,6 @@ import { Team } from './team';
export interface ToDoList {
nom: string;
- team: Team;
- taches: Tache [];
- id:number;
+ taches: Tache[];
+ id: number;
}
-
-
diff --git a/src/app/pages/page-accueil/page-accueil.component.ts b/src/app/pages/page-accueil/page-accueil.component.ts
index a3a39fd..490000a 100644
--- a/src/app/pages/page-accueil/page-accueil.component.ts
+++ b/src/app/pages/page-accueil/page-accueil.component.ts
@@ -1,4 +1,7 @@
+import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { TokenService } from 'src/app/services/token.service';
@Component({
selector: 'app-page-accueil',
@@ -7,9 +10,15 @@ import { Component, OnInit } from '@angular/core';
})
export class PageAccueilComponent implements OnInit {
- constructor() { }
+ constructor(private http: HttpClient, private router: Router, private tokenService: TokenService) {
+
+ }
ngOnInit(): void {
+ const token = this.tokenService.getToken();
+ if(token){
+ this.router.navigate(['tableau-de-bord']);
+ }
}
}
diff --git a/src/app/pages/page-add-member/page-add-member.component.ts b/src/app/pages/page-add-member/page-add-member.component.ts
index e6f9cb4..d685097 100644
--- a/src/app/pages/page-add-member/page-add-member.component.ts
+++ b/src/app/pages/page-add-member/page-add-member.component.ts
@@ -1,8 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
+import { Mail } from 'src/app/models/mail';
import { Membre } from 'src/app/models/membre';
import { AuthService } from 'src/app/services/auth.service';
+import { MailService } from 'src/app/services/mail.service';
import { MembreService } from 'src/app/services/membre.service';
@Component({
@@ -15,6 +17,7 @@ export class PageAddMemberComponent implements OnInit {
public addMemberForm: FormGroup;
constructor(
private membreService: MembreService,
+ private mailService: MailService,
private authService: AuthService,
private router: Router,
private fb: FormBuilder
@@ -75,9 +78,21 @@ export class PageAddMemberComponent implements OnInit {
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 !== '') {
this.membreService.addMembre(membre)?.subscribe((resp) => {
+ this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
+ console.log("Mail envoyé");
+ })
this.router.navigate(['compte']);
});
} else {
diff --git a/src/app/pages/page-agenda/page-agenda.component.scss b/src/app/pages/page-agenda/page-agenda.component.scss
index 95439b2..8a8fc2c 100644
--- a/src/app/pages/page-agenda/page-agenda.component.scss
+++ b/src/app/pages/page-agenda/page-agenda.component.scss
@@ -40,4 +40,4 @@
.fullscreen {
position: absolute; top:90px; left: 0px; right: 0px; bottom: 0px;
-}
\ No newline at end of file
+}
diff --git a/src/app/pages/page-agenda/page-agenda.component.ts b/src/app/pages/page-agenda/page-agenda.component.ts
index 291b1e0..1e438ae 100644
--- a/src/app/pages/page-agenda/page-agenda.component.ts
+++ b/src/app/pages/page-agenda/page-agenda.component.ts
@@ -188,8 +188,8 @@ export class PageAgendaComponent implements AfterViewInit {
end: args.e.end(),
id: args.e.id(),
barColor: "#555555",
- text: args.e.text(),
- membre: {id:this.userId},
+ text: this.rdvSplit(args.e.text()),
+ membre: {id:args.e.data.tags.membre},
team: {id:this.teamId}
}
this.evenementService.updateEvenements(event).subscribe(
diff --git a/src/app/pages/page-dashboard/page-dashboard.component.scss b/src/app/pages/page-dashboard/page-dashboard.component.scss
index 11c3260..d2d8bff 100644
--- a/src/app/pages/page-dashboard/page-dashboard.component.scss
+++ b/src/app/pages/page-dashboard/page-dashboard.component.scss
@@ -12,7 +12,7 @@
.container {
display: flex;
- padding: 10px;
+ padding: 20px;
}
@@ -26,7 +26,7 @@ button{
#boxFour{
height: 150px;
- margin-top: -70px;
+ margin-top: -99px;
width: fit-content;
}
diff --git a/src/app/pages/page-forgot-password/page-forgot-password.component.html b/src/app/pages/page-forgot-password/page-forgot-password.component.html
index d34857a..711b397 100644
--- a/src/app/pages/page-forgot-password/page-forgot-password.component.html
+++ b/src/app/pages/page-forgot-password/page-forgot-password.component.html
@@ -9,10 +9,22 @@