From 4cfc1c8a132a0a1cfdf659af90f6ba1922811a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Thu, 25 Feb 2021 11:57:37 +0100 Subject: [PATCH] =?UTF-8?q?Affichage=20du=20prochain=20EP=20du=20collabora?= =?UTF-8?q?teur=20dans=20ses=20d=C3=A9tails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../affichage-details-collaborateur.html | 4 ++ .../affichage-details-collaborateur.module.ts | 7 ++- .../prochain-ep/prochain-ep.component.html | 31 ++++++++++++ .../prochain-ep/prochain-ep.component.ts | 50 +++++++++++++++++++ src/app/shared/api-swagger/model/statutEp.ts | 2 +- 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html create mode 100644 src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts diff --git a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html index 4809dd0..d6c34e9 100644 --- a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html +++ b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.html @@ -11,6 +11,10 @@ + + + + diff --git a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.module.ts b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.module.ts index 8ae3cf0..7a9c867 100644 --- a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.module.ts +++ b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.module.ts @@ -6,18 +6,21 @@ import { MaterialModule } from "../angular-material/angular-material.module"; import { AffichageDetailsCollaborateurComponent } from "@shared/affichage-details-collaboarteur/affichage-details-collaborateur"; import { MatTablesModule } from '@shared/mat-tables/mat-tables.module'; import { DialogAssignationRapideReferentComponent, DialogAssignationRapideCollaborateursComponent } from "./dialog-assignation-rapide/dialog-assignation-rapide.component"; +import { ProchainEpComponent } from "./prochain-ep/prochain-ep.component"; +import { RouterModule } from "@angular/router"; @NgModule({ declarations: [ AffichageDetailsCollaborateurComponent, DialogAssignationRapideReferentComponent, - DialogAssignationRapideCollaborateursComponent + DialogAssignationRapideCollaborateursComponent, ProchainEpComponent ], imports: [ MaterialModule, CommonModule, FormsModule, - MatTablesModule + MatTablesModule, + RouterModule ], exports: [AffichageDetailsCollaborateurComponent] }) diff --git a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html new file mode 100644 index 0000000..aca3d0c --- /dev/null +++ b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html @@ -0,0 +1,31 @@ + + + + + +

Aucun prochain EP n'a été trouvé

+
+ + + +

Prochain {{ep.type}} disponible pour saisie le {{ ep.dateDisponibilite | date: "dd/MM/yyyy" }}

+
+ + +

{{ep.type}} : {{ afficherStatutEP(ep.statut) }}

+

Disponible depuis le {{ ep.dateDisponibilite | date : "dd/MM/yyyy" }}

+

Date d'entretien le {{ ep.datePrevisionnelle | date : "dd/MM/yyyy" }}

+ +

Référent EP : {{ep.referent.nom}} {{ep.referent.prenom}}

+
+ + + +

Il n'y a actuellement aucun référent pour cet EP

+
+ + +
+
+ +
diff --git a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts new file mode 100644 index 0000000..379deb4 --- /dev/null +++ b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts @@ -0,0 +1,50 @@ +import { Component, Input, OnInit } from "@angular/core" +import { affichageStatut, EpInformationDTO, EpService, StatutEp } from "@shared/api-swagger"; +import { Subscription } from "rxjs"; + + + +@Component({ + selector: "prochain-ep", + templateUrl: "./prochain-ep.component.html" +}) +export class ProchainEpComponent implements OnInit { + + statutEP : any = StatutEp; + + @Input() idCollaborateur: string; + + chargement: boolean = true; + + ep : EpInformationDTO; + + epSubscription: Subscription; + + constructor(private epService: EpService) { + + } + + ngOnInit() { + this.epSubscription = this.epService.getProchainEPCollaborateur(this.idCollaborateur).subscribe( + ep => { + console.log(ep); + this.ep = ep; + this.chargement = false; + }, + err => { + this.chargement = false; + console.log(err) + } + ); + } + + afficherStatutEP(statut: StatutEp) { + return affichageStatut(statut); + } + + ngDestroy() { + if(this.epSubscription != undefined) + this.epSubscription.unsubscribe(); + } + +} \ No newline at end of file diff --git a/src/app/shared/api-swagger/model/statutEp.ts b/src/app/shared/api-swagger/model/statutEp.ts index 9c6f90d..f4def08 100644 --- a/src/app/shared/api-swagger/model/statutEp.ts +++ b/src/app/shared/api-swagger/model/statutEp.ts @@ -55,7 +55,7 @@ export function affichageStatut(statut: StatutEp) { case StatutEp.Saisi: return "Saisie effectuée"; case StatutEp.SignatureReferent: - return "Attente signature collaborature"; + return "Attente signature collaborateur"; case StatutEp.Signe: return "Signé" }