Création de fonctions pour l'affichage et l'état des statuts EP avec mise à jour de l'affiche des EP

develop
Yanaël GRETTE 4 years ago
parent 35abb47e9b
commit f5af77ff30
  1. 35
      src/app/shared/api-swagger/model/statutEp.ts
  2. 8
      src/app/shared/mat-tables/ep-table/ep-table.html
  3. 19
      src/app/shared/mat-tables/ep-table/ep-table.ts
  4. 6
      src/app/shared/mat-tables/participations-formation-table/participations-formation.table.ts

@ -26,4 +26,37 @@ export const StatutEp = {
Signe: 'Signe' as StatutEp,
Rejete: 'Rejete' as StatutEp,
Annule: 'Annule' as StatutEp
};
};
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é"
}
}

@ -89,7 +89,7 @@
<ng-container matColumnDef="typeep">
<mat-header-cell *matHeaderCellDef mat-sort-header disableClear>Type EP</mat-header-cell>
<mat-cell *matCellDef="let row"> {{ afficherTypeEP(row.type) }}</mat-cell>
<mat-cell *matCellDef="let row"> {{ row.type }}</mat-cell>
</ng-container>
<ng-container matColumnDef="dateentretien">
@ -104,7 +104,11 @@
<ng-container matColumnDef="consultation">
<mat-header-cell *matHeaderCellDef mat-sort-header disableClear></mat-header-cell>
<mat-cell *matCellDef="let row" (click)="emitEvent('ep', row)"> Consulter EP </mat-cell>
<ng-container *matCellDef="let row" >
<mat-cell *ngIf="!EstEPEnAttente(row.statut)" (click)="emitEvent('ep', row)"> Consulter EP </mat-cell>
<mat-cell *ngIf="EstEPEnAttente(row.statut)"> EP indisponible </mat-cell>
</ng-container>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>

@ -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

@ -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() {

Loading…
Cancel
Save