Affichage des liste des participants dans les détails d'une formation

master
Yanaël GRETTE 4 years ago
parent 8ee9651cbf
commit b5d1170c0f
  1. 46
      src/app/formations/details-formation/formation.component.html
  2. 37
      src/app/formations/details-formation/formation.component.ts
  3. 1
      src/app/shared/api-swagger/model/participationFormationModel.ts
  4. 2
      src/app/shared/displayInfo/displayFormation.ts
  5. 12
      src/app/shared/displayInfo/displayParticipation.ts
  6. 1
      src/app/shared/displayInfo/displays.ts
  7. 2
      src/app/shared/utils/paths.ts

@ -9,19 +9,49 @@
<p>{{dateTexte}} {{formation.dateDebut | date:"dd/MM/yyyy"}}</p> <p>{{dateTexte}} {{formation.dateDebut | date:"dd/MM/yyyy"}}</p>
<p>Origine : {{formation.origine}}</p> <p>Origine : {{formation.origine}}</p>
<p>Organisme : {{ formation.organisme}}</p> <p>Organisme : {{ formation.organisme}}</p>
<p>Mode formation : {{ formation.modeFormation}}</p> <p>Mode formation : {{ formation.mode}}</p>
<p>Type formation : {{ formation.typeFormation}}</p> <p>Type formation : {{ formation.type}}</p>
</ng-container> </ng-container>
<ng-container> <ng-container>
<h3>Liste des participants</h3> <h3>Liste des participants</h3>
<mat-table [dataSource]=dataSource> <mat-table [dataSource]="dataSource">
<ng-container matColumnDef="agence">
<mat-header-cell *matHeaderCellDef>Agence</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.agence}}</mat-cell>
</ng-container>
<ng-container matColumnDef="collaborateur">
<mat-header-cell *matHeaderCellDef>Collaborateur</mat-header-cell>
<mat-cell *matCellDef="let row" [routerLink]="['/collaborateurs', row.idCollaborateur]">{{row.collaborateur}}</mat-cell>
</ng-container>
<ng-container matColumnDef="dateinscription">
<mat-header-cell *matHeaderCellDef>Inscrit le</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.dateCreation | date :'dd/MM/yy à HH:mm'}}</mat-cell>
</ng-container>
<ng-container matColumnDef="ep">
<mat-header-cell *matHeaderCellDef>EP</mat-header-cell>
<mat-cell *matCellDef="let row">
<p *ngIf="row.statutEP>=5" [routerLink]="['/ep',row.idEP]">Voir EP</p>
<p *ngIf="row.statutEP>=2 && row.statutEP<5" [routerLink]="['/ep',row.idEP]">EP en cours</p>
<p *ngIf="row.statutEP<=1">Attente prochain EP</p>
</mat-cell>
</ng-container>
<ng-container matColumnDef="evaluation">
<mat-header-cell *matHeaderCellDef>Evaluations</mat-header-cell>
<mat-cell *matCellDef="let row">
<p *ngIf="row.estEvaluee" [routerLink]="['/collaborateurs',row.idCollaborateur,'formations','evaluation',row.id]">Voir évaluation</p>
<p *ngIf="!row.estEvaluee">Attente évaluation</p>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table> </mat-table>
</ng-container> </ng-container>
</ng-container> </ng-container>
POSER DES QUESTIONS A HELEN
Heures/Jours
Mode de formation, type de formation
CREER LES PARTICIPATIONS
<mat-spinner *ngIf="formation==undefined"></mat-spinner> <mat-spinner *ngIf="formation==undefined"></mat-spinner>

@ -3,8 +3,15 @@ import { Component, OnInit } from '@angular/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {MatTableDataSource} from '@angular/material/table';
import {MatPaginator} from '@angular/material/paginator';
import {MatSort} from '@angular/material/sort';
import { FormationsService } from '@shared/api-swagger/api/api'; import { FormationsService } from '@shared/api-swagger/api/api';
import { FormationModel } from "@shared/api-swagger/model/models"; import { FormationModel } from "@shared/api-swagger/model/models";
import { DisplayParticipation } from "@shared/displayInfo/displays";
/** /**
*/ */
@Component({ @Component({
@ -15,7 +22,11 @@ export class FormationComponent implements OnInit {
formation:FormationModel; formation:FormationModel;
dateTexte:string = "Prévue le"; dateTexte:string = "Prévue le";
formationSubscription: Subscription; formationSubscription: Subscription;
participationsDisplay: DisplayParticipation[];
dataSource : MatTableDataSource<DisplayParticipation>; dataSource : MatTableDataSource<DisplayParticipation>;
displayedColumns: string[]= ["agence", "collaborateur", "dateinscription", "ep"];
constructor(private service:FormationsService,private route:ActivatedRoute) {} constructor(private service:FormationsService,private route:ActivatedRoute) {}
@ -30,11 +41,35 @@ export class FormationComponent implements OnInit {
this.formation = formation; this.formation = formation;
if(this.formation.statut == 2) { if(this.formation.statut == 2) {
this.dateTexte = "Effecutée le"; this.dateTexte = "Effecutée le";
this.displayedColumns.push("evaluation");
} }
if(this.formation.statut == 3) { if(this.formation.statut == 3) {
this.dateTexte = "Initialement prévue le"; this.dateTexte = "Initialement prévue le";
} }
//if(formation.participantsFormation != undefined ) if(formation.participantsFormation != undefined && formation.participantsFormation.length != 0 ) {
this.initParticpationFormation();
}
}
initParticpationFormation() {
let participationDisplay : DisplayParticipation;
this.participationsDisplay = [];
for(let participation of this.formation.participantsFormation ) {
participationDisplay = new DisplayParticipation();
participationDisplay.id =participation.id;
participationDisplay.dateCreation = participation.dateCreation;
participationDisplay.estEvaluee = participation.estEvaluee;
participationDisplay.idEP = participation.demandeformation.ep.id;
participationDisplay.statutEP = participation.demandeformation.ep.etat;
participationDisplay.idCollaborateur = participation.demandeformation.ep.collaborateur.id;
participationDisplay.collaborateur = participation.demandeformation.ep.collaborateur.prenom + " " + participation.demandeformation.ep.collaborateur.nom;
participationDisplay.agence = participation.demandeformation.ep.collaborateur.businessUnit.nom;
this.participationsDisplay.push(participationDisplay);
}
this.dataSource = new MatTableDataSource(this.participationsDisplay);
} }
getStatut(statut:number) { getStatut(statut:number) {

@ -16,6 +16,7 @@ import { SaisieModel } from './saisieModel';
export interface ParticipationFormationModel { export interface ParticipationFormationModel {
id: number; id: number;
dateCreation: Date; dateCreation: Date;
estEvaluee: boolean;
formation: FormationModel; formation: FormationModel;
demandeformation: DemandeFormationModel; demandeformation: DemandeFormationModel;
evaluations?: Array<SaisieModel>; evaluations?: Array<SaisieModel>;

@ -6,5 +6,5 @@ export class DisplayFormation {
nbParticipants : number; nbParticipants : number;
datePrevu: Date; datePrevu: Date;
origine : string; origine : string;
statut: FormationModel.StatusEnum; statut: FormationModel.StatutEnum;
} }

@ -1,8 +1,14 @@
import { CollaborateurModel, EpModel, FormationModel } from "@shared/api-swagger/model/models";
export class DisplayParticipation {
export class displayParticipation {
id: number; id: number;
intitule: string; intitule: string;
agence: string;
collaborateur: string; collaborateur: string;
referent: string; idCollaborateur: string;
idEP: number;
estEvaluee: boolean;
statutEP : number;
dateCreation: Date;
formation: FormationModel;
} }

@ -1,3 +1,4 @@
export * from "./displayEP"; export * from "./displayEP";
export * from "./displayCollaborateur"; export * from "./displayCollaborateur";
export * from "./displayFormation"; export * from "./displayFormation";
export * from "./displayParticipation";

@ -3,7 +3,7 @@ const paths_collaborateurs = {
path: "collaborateurs", path: "collaborateurs",
get: ":id", get: ":id",
formations: ":id/formations", formations: ":id/formations",
evaluation: ":id/formations/evaluation/:id", evaluation: ":id/formations/evaluation/:idParticipation",
edit: ":id/formations/evaluation/:id/edit" edit: ":id/formations/evaluation/:id/edit"
}; };

Loading…
Cancel
Save