diff --git a/src/app/shared/api-swagger/model/statutEp.ts b/src/app/shared/api-swagger/model/statutEp.ts index b366720..9c6f90d 100644 --- a/src/app/shared/api-swagger/model/statutEp.ts +++ b/src/app/shared/api-swagger/model/statutEp.ts @@ -26,4 +26,37 @@ export const StatutEp = { Signe: 'Signe' as StatutEp, Rejete: 'Rejete' as StatutEp, Annule: 'Annule' as StatutEp -}; \ No newline at end of file +}; + +export function estEnAttente (statut:StatutEp) { + return statut == StatutEp.Cree || statut == StatutEp.Disponible +} + +export function estEPDisponible (statut:StatutEp) { + return statut != StatutEp.Cree && statut != StatutEp.Disponible +} + +export function affichageStatut(statut: StatutEp) { + switch(statut) { + case StatutEp.Cree: + return "Crée"; + case StatutEp.Annule: + return "Annulée"; + case StatutEp.AttenteEntretien: + return "En attente de l'entretien"; + case StatutEp.DatesProposees: + return "Dates proposées"; + case StatutEp.Disponible: + return "En attente de saisie"; + case StatutEp.Effectue: + return "Entretien effectué"; + case StatutEp.Rejete: + return "Rejeté"; + case StatutEp.Saisi: + return "Saisie effectuée"; + case StatutEp.SignatureReferent: + return "Attente signature collaborature"; + case StatutEp.Signe: + return "Signé" + } +} \ No newline at end of file diff --git a/src/app/shared/mat-tables/ep-table/ep-table.html b/src/app/shared/mat-tables/ep-table/ep-table.html index 88f7112..c03a7cf 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.html +++ b/src/app/shared/mat-tables/ep-table/ep-table.html @@ -89,7 +89,7 @@ Type EP - {{ afficherTypeEP(row.type) }} + {{ row.type }} @@ -104,7 +104,11 @@ - Consulter EP + + Consulter EP + EP indisponible + + diff --git a/src/app/shared/mat-tables/ep-table/ep-table.ts b/src/app/shared/mat-tables/ep-table/ep-table.ts index bad2405..f01a626 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.ts +++ b/src/app/shared/mat-tables/ep-table/ep-table.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { MatTableDataSource } from "@angular/material/table"; -import { BusinessUnitDTO, CollaborateurDTO, EpInformationDTO, EpService, StatutEp, TypeEp } from "@shared/api-swagger"; +import { affichageStatut, BusinessUnitDTO, CollaborateurDTO, EpInformationDTO, EpService, estEnAttente, StatutEp, TypeEp } from "@shared/api-swagger"; import { cles, epTypeRecherche } from "@shared/utils/cles"; import { Subscription } from "rxjs"; @@ -120,6 +120,14 @@ export class EpTableComponent implements OnInit{ ); } + afficherStatutEP(statut: StatutEp) { + return affichageStatut(statut); + } + + EstEPEnAttente(statut: StatutEp) { + return estEnAttente(statut); + } + getEPEnSignes() { this.epSubscription = this.epService.getEPSignes(this.busIds, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin).subscribe( eps => { @@ -190,15 +198,6 @@ export class EpTableComponent implements OnInit{ this.setSearch(); } - - afficherStatutEP(statut: StatutEp) { - return "statut"; - } - - afficherTypeEP(type: TypeEp) { - return "typeEP" - } - /** * Mettre à jour toutes les checkox * @param event case cochée ou décochée diff --git a/src/app/shared/mat-tables/participations-formation-table/participations-formation.table.ts b/src/app/shared/mat-tables/participations-formation-table/participations-formation.table.ts index a02b1d9..9508882 100644 --- a/src/app/shared/mat-tables/participations-formation-table/participations-formation.table.ts +++ b/src/app/shared/mat-tables/participations-formation-table/participations-formation.table.ts @@ -4,7 +4,7 @@ import {MatPaginator} from '@angular/material/paginator'; import {MatSort} from '@angular/material/sort'; import {MatTableDataSource} from '@angular/material/table'; -import { ParticipationFormationDTO, StatutEp } from '@shared/api-swagger/model/models' +import { estEnAttente, estEPDisponible, ParticipationFormationDTO, StatutEp } from '@shared/api-swagger/model/models' import { DatePipe } from "@angular/common"; @@ -79,11 +79,11 @@ export class ParticipationsFormationTableComponent implements OnInit, AfterViewI } estEnAttente (statut:StatutEp) { - return statut == StatutEp.Cree || statut == StatutEp.Disponible + return estEnAttente(statut); } estEPDisponible (statut:StatutEp) { - return statut != StatutEp.Cree && statut != StatutEp.Disponible + return estEPDisponible(statut); } setSearch() {