Affichage de certains onglets des détails d'un EP qu'en fonction du statut EP

develop
Yanaël GRETTE 4 years ago
parent 1c41609db7
commit 3c4f4df19d
  1. 11
      src/app/ep/details-ep/details-ep.component.html
  2. 16
      src/app/ep/details-ep/details-ep.component.ts
  3. 2
      src/app/ep/details-ep/ep-demandes-formation/ep-demandes-formation.component.html
  4. 4
      src/app/ep/details-ep/ep-engagements/ep-engagements.component.html
  5. 2
      src/app/ep/details-ep/ep-participants/new-participant/new-participant.component.html
  6. 17
      src/app/ep/details-ep/ep-participants/new-participant/new-participant.component.ts
  7. 12
      src/app/shared/api-swagger/model/statutEp.ts

@ -49,10 +49,10 @@
</mat-vertical-stepper>
</mat-tab>
<mat-tab label="Les engagements">
<mat-tab label="Les engagements" *ngIf="afficherDemandesFormationEtEngagements()">
<ep-engagements [engagements]="ep.engagements"></ep-engagements>
</mat-tab>
<mat-tab label="Les demandes de formation">
<mat-tab label="Les demandes de formation" *ngIf="afficherDemandesFormationEtEngagements()">
<ep-demandes-formation [demandesFormation]="ep.demandesFormation"></ep-demandes-formation>
</mat-tab>
@ -60,14 +60,15 @@
<ep-commentaires-assistant [ep]="ep"></ep-commentaires-assistant>
</mat-tab>
<mat-tab label="Choix de dates">
<mat-tab label="Choix de dates" *ngIf="afficherChoixDates()" >
<ep-choix-date [rdvsEntretien]="ep.propositionsEntretien"></ep-choix-date>
</mat-tab>
<mat-tab label="Proposition de date">
<mat-tab label="Proposition de date" *ngIf="epNonEffectue()">
<ep-propositions-dates [choixTypeEntretien]="ep.choixTypeEntretien"></ep-propositions-dates>
</mat-tab>
<mat-tab label="Demande délégation">
<mat-tab label="Demande délégation" *ngIf="epNonEffectue()">
<ep-demande-delegation [demande]="ep.demandesDelegation"></ep-demande-delegation>
</mat-tab>
<mat-tab label="Les participants">

@ -1,6 +1,6 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { affichageStatut, EpDTO, EpService, StatutEp } from "@shared/api-swagger";
import { affichageStatut, EpDTO, EpService, StatutEp, estEPEnCours, estEPSigne, estEPEnAttenteSignatureCollaborateur, estEPEffectue } from "@shared/api-swagger";
import { AuthService } from "@shared/auth/auth.service";
import { Role } from "@shared/utils/roles";
import { Subscription } from "rxjs";
@ -38,7 +38,21 @@ export class DetailsEPComponent implements OnInit {
);
}
afficherDemandesFormationEtEngagements() {
return estEPSigne(this.ep.statut) || estEPEnAttenteSignatureCollaborateur(this.ep.statut);
}
afficherTypeEP(statutEP: StatutEp) {
return affichageStatut(statutEP);
}
afficherChoixDates() {
return this.ep.statut == StatutEp.DatesProposees;
}
epNonEffectue() {
return estEPEnCours(this.ep.statut) && !estEPEnAttenteSignatureCollaborateur(this.ep.statut) && !estEPEffectue(this.ep.statut);
}
}

@ -1,2 +1,2 @@
<h3 *ngIf="demandesFormation == undefined || demandesFormation == []">Aucune demande de formation</h3>
<demandes-formation-table *ngIf="demandesFormation != undefined && demandesFormation != []" [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [demandesFormation]="demandesFormation" ></demandes-formation-table>
<demandes-formation-table *ngIf="demandesFormation != undefined && demandesFormation.length != 0" [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [demandesFormation]="demandesFormation" ></demandes-formation-table>

@ -1,8 +1,8 @@
<ng-container *ngIf="engagements == undefined || engagements == []">
<ng-container *ngIf="engagements == undefined || engagements.length == 0">
<h3>Aucun engagements pris</h3>
</ng-container>
<ng-container *ngIf="engagements != undefined && engagements != []">
<ng-container *ngIf="engagements != undefined && engagements.length != 0">
<engagements-table [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [engagementsSaisis]="engagements"></engagements-table>
</ng-container>

@ -1,2 +0,0 @@
<app-nav-menu></app-nav-menu>
<h1>New participant </h1>

@ -1,17 +0,0 @@
import { Component, OnInit } from '@angular/core';
/**
* Composant permettant l'ajout d'un participant à un EP
* Ce composant pourrait être remplacé par un dialog de material angular
*/
@Component({
selector: 'app-new-participant',
templateUrl: './new-participant.component.html'
})
export class NewParticipantComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -40,6 +40,18 @@ export function estEPEnCours (statut:StatutEp) {
return statut != StatutEp.Annule && statut != StatutEp.Cree && statut != StatutEp.Rejete && statut != StatutEp.Signe
}
export function estEPEffectue(statut: StatutEp) {
return statut == StatutEp.Effectue;
}
export function estEPEnAttenteSignatureCollaborateur(statut: StatutEp) {
return statut == StatutEp.SignatureReferent;
}
export function estEPSigne( statut : StatutEp) {
return statut == StatutEp.Signe;
}
export function affichageStatut(statut: StatutEp) {
switch(statut) {
case StatutEp.Cree:

Loading…
Cancel
Save