From 09059dee66e86af21f713af5a3938b1d040acb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Thu, 18 Mar 2021 11:34:30 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20l'affichage=20des=20?= =?UTF-8?q?commentaires=20assistants,=20de=20la=20liste=20des=20participan?= =?UTF-8?q?ts=20et=20de=20la=20demande=20de=20d=C3=A9l=C3=A9gation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/ep/details-ep/details-ep.component.html | 6 +++--- .../ep-commentaire-assistant.component.html | 1 - .../ep-commentaire-assistant.component.ts | 16 ---------------- .../ep-commentaires-assistant.component.html | 14 ++++++++++++++ .../ep-commentaires-assistant.component.ts | 17 +++++++++++++++++ .../ep-demande-delegation.component.html | 16 +++++++++++++++- .../ep-demande-delegation.component.ts | 14 ++++++++++---- .../ep-participants.component.html | 12 +++++++++++- .../ep-participants.component.ts | 12 ++++++------ src/app/ep/ep.module.ts | 6 +++++- .../model/commentaireAssistantDTO.ts | 7 ++++--- src/app/shared/api-swagger/model/epDTO.ts | 2 +- src/app/shared/api-swagger/model/etatDemande.ts | 13 ++++++++++++- 13 files changed, 98 insertions(+), 38 deletions(-) delete mode 100644 src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.html delete mode 100644 src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.ts create mode 100644 src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.html create mode 100644 src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.ts diff --git a/src/app/ep/details-ep/details-ep.component.html b/src/app/ep/details-ep/details-ep.component.html index 78f0b8e..ecf6776 100644 --- a/src/app/ep/details-ep/details-ep.component.html +++ b/src/app/ep/details-ep/details-ep.component.html @@ -53,7 +53,7 @@ - Ajout et consultation des commentaires (pour les assistants) + @@ -64,10 +64,10 @@ Le référent propose trois dates d'entretien (référent) - Effectuer une demande de délégation (Assistant et référent) + - Ajouter et enlever des participants (Assistants et référent) + diff --git a/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.html b/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.html deleted file mode 100644 index 36c2eb0..0000000 --- a/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.html +++ /dev/null @@ -1 +0,0 @@ -

Consultation commentaire assistant

diff --git a/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.ts b/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.ts deleted file mode 100644 index 61fccc0..0000000 --- a/src/app/ep/details-ep/ep-commentaire-assistant/ep-commentaire-assistant.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -/** - * Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter - */ -@Component({ - selector: 'app-ep-commentaire-assistant', - templateUrl: './ep-commentaire-assistant.component.html' -}) -export class EpCommentaireAssistantComponent implements OnInit { - - constructor() {} - - ngOnInit() { - } -} diff --git a/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.html b/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.html new file mode 100644 index 0000000..57a3341 --- /dev/null +++ b/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.html @@ -0,0 +1,14 @@ + + Aucun commentaire assistant + + + + + Liste des commentaires assistants : + + \ No newline at end of file diff --git a/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.ts b/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.ts new file mode 100644 index 0000000..1a231c1 --- /dev/null +++ b/src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.ts @@ -0,0 +1,17 @@ +import { Component, Input } from '@angular/core'; +import { EpDTO } from '@shared/api-swagger'; + +/** + * Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter + */ +@Component({ + selector: 'ep-commentaires-assistant', + templateUrl: './ep-commentaires-assistant.component.html' +}) +export class EpCommentairesAssistantComponent { + + @Input() ep : EpDTO; + + constructor() {} + +} diff --git a/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.html b/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.html index 4c4962f..1c8f53d 100644 --- a/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.html +++ b/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.html @@ -1 +1,15 @@ -

Consultation demande delegation

+ +

Aucune demande de délégation en cours

+
+ + +

Demande de délégation en cours :

+

Receveur : {{demande.referent.nom}} {{demande.referent.prenom}}

+

Date de la demande : {{demande.dateDemande | date: 'dd/MM/yyyy'}}

+

Raison de la demande : {{demande.raisonDemande }}

+

{{afficherEtatDemande(demande.etatDemande)}}

+ +

Date réponse : {{demande.dateReponse | date: 'dd/MM/yyyy'}}

+

Raison refus : {{demande.raisonRefus}}

+
+
\ No newline at end of file diff --git a/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.ts b/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.ts index ca26f67..39ccd4d 100644 --- a/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.ts +++ b/src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.ts @@ -1,16 +1,22 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input} from '@angular/core'; +import { AfficherEtatDemandeDelegation, DemandeDelegationDTO, EpDTO, EtatDemande } from '@shared/api-swagger'; /** * Composant pour faire une demande de délégation et voir la dernière en cours */ @Component({ - selector: 'app-ep-demande-delegation', + selector: 'ep-demande-delegation', templateUrl: './ep-demande-delegation.component.html' }) -export class EpDemandeDelegationComponent implements OnInit { +export class EpDemandeDelegationComponent{ + etatDemande : any = EtatDemande; + + @Input() demande: DemandeDelegationDTO; constructor() {} - ngOnInit() { + afficherEtatDemande(etat: EtatDemande) { + return AfficherEtatDemandeDelegation(etat); } + } diff --git a/src/app/ep/details-ep/ep-participants/ep-participants.component.html b/src/app/ep/details-ep/ep-participants/ep-participants.component.html index 202500e..462a7ce 100644 --- a/src/app/ep/details-ep/ep-participants/ep-participants.component.html +++ b/src/app/ep/details-ep/ep-participants/ep-participants.component.html @@ -1 +1,11 @@ -

Consultation participants

+ +

Aucun participant

+
+ + + + \ No newline at end of file diff --git a/src/app/ep/details-ep/ep-participants/ep-participants.component.ts b/src/app/ep/details-ep/ep-participants/ep-participants.component.ts index fbf6418..04da4b9 100644 --- a/src/app/ep/details-ep/ep-participants/ep-participants.component.ts +++ b/src/app/ep/details-ep/ep-participants/ep-participants.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { EpDTO } from '@shared/api-swagger'; /** * Composant pour afficher la liste des participants de l'EP */ @Component({ - selector: 'app-ep-participants', + selector: 'ep-participants', templateUrl: './ep-participants.component.html' }) -export class EpParticipantsComponent implements OnInit { +export class EpParticipantsComponent { - constructor() {} + @Input() ep : EpDTO; - ngOnInit() { - } + constructor() {} } diff --git a/src/app/ep/ep.module.ts b/src/app/ep/ep.module.ts index ad7422e..6f5fc2f 100644 --- a/src/app/ep/ep.module.ts +++ b/src/app/ep/ep.module.ts @@ -14,13 +14,17 @@ import { MatTablesModule } from "@shared/mat-tables/mat-tables.module"; import { EpSignesComponent } from "./ep-signes/ep-signes.component"; import { DetailsEPComponent } from "./details-ep/details-ep.component"; import { EpObjectifsComponent } from "./details-ep/ep-objectifs/ep-objectifs.component"; +import { EpParticipantsComponent } from "./details-ep/ep-participants/ep-participants.component"; +import { EpDemandeDelegationComponent } from "./details-ep/ep-demande-delegation/ep-demande-delegation.component"; +import { EpCommentairesAssistantComponent } from "./details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component"; /** * Module de l'ep */ @NgModule({ declarations: [ - EpComponent, EpSignesComponent, DetailsEPComponent, EpObjectifsComponent + EpComponent, EpSignesComponent, DetailsEPComponent, EpObjectifsComponent, + EpParticipantsComponent, EpDemandeDelegationComponent, EpCommentairesAssistantComponent ], exports: [EpComponent, DetailsEPComponent ], diff --git a/src/app/shared/api-swagger/model/commentaireAssistantDTO.ts b/src/app/shared/api-swagger/model/commentaireAssistantDTO.ts index e8bc6fa..fde1288 100644 --- a/src/app/shared/api-swagger/model/commentaireAssistantDTO.ts +++ b/src/app/shared/api-swagger/model/commentaireAssistantDTO.ts @@ -2,7 +2,7 @@ * API du serveur de l'application de digitalisation des EP * API qui sra utilisée afin de faire communiquer le client et le serveur ainsi que le serveur et la boîte noire. * - * OpenAPI spec version: 1.3.6 + * OpenAPI spec version: 1.3.7 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,7 +13,7 @@ /** * DTO contenant le commentaire d'un assistant sur l'EP. */ -export interface CommentaireAssistantDTO { + export interface CommentaireAssistantDTO { /** * Id du commentaire assistant */ @@ -21,7 +21,8 @@ export interface CommentaireAssistantDTO { /** * Id de l'assistant qui a écrit le commentaire */ - idAssistante?: string; + idAssistant: string; + assistant?: string; /** * Le commentaire de l’assistant */ diff --git a/src/app/shared/api-swagger/model/epDTO.ts b/src/app/shared/api-swagger/model/epDTO.ts index abf95df..b456996 100644 --- a/src/app/shared/api-swagger/model/epDTO.ts +++ b/src/app/shared/api-swagger/model/epDTO.ts @@ -74,7 +74,7 @@ export interface EpDTO { participants?: Array; engagements?: Array; augmentationSalaire?: AugmentationSalaireDTO; - demandesDelegation?: Array; + demandesDelegation?: DemandeDelegationDTO; demandeEPI?: DemandeEPIDTO; documents: Array; commentairesAssistant?: Array; diff --git a/src/app/shared/api-swagger/model/etatDemande.ts b/src/app/shared/api-swagger/model/etatDemande.ts index af195be..3bb523a 100644 --- a/src/app/shared/api-swagger/model/etatDemande.ts +++ b/src/app/shared/api-swagger/model/etatDemande.ts @@ -19,4 +19,15 @@ export const EtatDemande = { EnAttente: 'EnAttente' as EtatDemande, Validee: 'Validee' as EtatDemande, Rejetee: 'Rejetee' as EtatDemande -}; \ No newline at end of file +}; + +export function AfficherEtatDemandeDelegation(etat: EtatDemande) { + switch(etat) { + case EtatDemande.Rejetee : + return "Demande rejetée"; + case EtatDemande.Validee: + return "Demande acceptée"; + case EtatDemande.EnAttente: + return "Demande en attente"; + } +} \ No newline at end of file