diff --git a/src/app/components/fiche-contact/fiche-contact.component.html b/src/app/components/fiche-contact/fiche-contact.component.html
index ad8df74..33b89bc 100644
--- a/src/app/components/fiche-contact/fiche-contact.component.html
+++ b/src/app/components/fiche-contact/fiche-contact.component.html
@@ -4,13 +4,17 @@
-
-
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/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-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-repertoire/page-repertoire.component.html b/src/app/pages/page-repertoire/page-repertoire.component.html
index 298c97e..d390bff 100644
--- a/src/app/pages/page-repertoire/page-repertoire.component.html
+++ b/src/app/pages/page-repertoire/page-repertoire.component.html
@@ -7,10 +7,8 @@
-
- Tous les contacts
-
diff --git a/src/app/pages/page-repertoire/page-repertoire.component.ts b/src/app/pages/page-repertoire/page-repertoire.component.ts
index 8870890..c387247 100644
--- a/src/app/pages/page-repertoire/page-repertoire.component.ts
+++ b/src/app/pages/page-repertoire/page-repertoire.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Contact } from 'src/app/models/contact';
import { RepertoireService } from 'src/app/services/repertoire.service';
+import { TokenService } from 'src/app/services/token.service';
@Component({
selector: 'app-page-repertoire',
@@ -15,18 +16,27 @@ export class PageRepertoireComponent implements OnInit {
public personneid: any;
keyword: any;
openDetails: any;
+ parent: boolean;
constructor(
private repertoireService: RepertoireService,
private router: Router,
- private route: ActivatedRoute
+ private route: ActivatedRoute,
+ private tokenService: TokenService
) {
this.listContact = [];
this.listFull = [];
this.listContactInfo = '';
+ this.parent = false;
}
ngOnInit(): void {
+ const roleUser = this.tokenService.getRole();
+
+ if(roleUser == "ROLE_PARENT"){
+ this.parent = true;
+ }
+
//récupère tout les contact et leurs info
this.repertoireService.getContact().subscribe((listContact: any[]) => {
console.log(listContact);