From 3c16eadc69bf957b14970bc8ae20ff70ebdc403d Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Sat, 26 Feb 2022 12:58:39 +0100 Subject: [PATCH 1/2] app module --- src/app/app.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index dec0f01..5850a5c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -43,7 +43,6 @@ import localeFr from '@angular/common/locales/fr'; import { CardAvatarComponent } from './components/card-avatar/card-avatar.component'; import { HumeurComponent } from './components/humeur/humeur.component'; import { DeconnexionComponent } from './components/deconnexion/deconnexion.component'; -import { HumeurComponent } from './components/humeur/humeur.component'; registerLocaleData(localeFr) @NgModule({ From 4386c4b4741ec09e4ffd01ec6246e713b48dc496 Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Sat, 26 Feb 2022 17:48:12 +0100 Subject: [PATCH 2/2] redirection page acceuil et miseen place de privation d'action si enfant --- .../fiche-contact/fiche-contact.component.html | 8 ++++++-- .../fiche-contact/fiche-contact.component.ts | 15 +++++++++++++-- .../pages/page-accueil/page-accueil.component.ts | 11 ++++++++++- .../page-dashboard/page-dashboard.component.scss | 4 ++-- .../page-repertoire.component.html | 4 +--- .../page-repertoire/page-repertoire.component.ts | 12 +++++++++++- 6 files changed, 43 insertions(+), 11 deletions(-) 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 @@
-