|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import { Component, Input, OnInit } from "@angular/core"; |
|
|
|
|
import { CollaborateurDTO, CollaborateursService } from "@shared/api-swagger"; |
|
|
|
|
import { CollaborateurDTO, CollaborateursService, ParticipationFormationDTO, ParticipationsFormationsService } from "@shared/api-swagger"; |
|
|
|
|
import { Subscription } from "rxjs"; |
|
|
|
|
import { collaborateurTypeRecherche } from "@shared/utils/cles"; |
|
|
|
|
import { MatDialog } from "@angular/material/dialog"; |
|
|
|
@ -19,26 +19,37 @@ export class AffichageDetailsCollaborateurComponent implements OnInit{ |
|
|
|
|
typeRecherche : string = collaborateurTypeRecherche.collaborateursEP; |
|
|
|
|
|
|
|
|
|
displayedColumns : string[] = ["businessunit", "collaborateur", "datearrivee"]; |
|
|
|
|
|
|
|
|
|
displayedColumnsParticipationFormaton: string[]= ["intitule", "statut", "dateCreation", "ep", "evaluation"]; |
|
|
|
|
rechercherParBU: boolean = false; |
|
|
|
|
rechercherParDate: boolean= false; |
|
|
|
|
|
|
|
|
|
collaborateur: CollaborateurDTO = undefined; |
|
|
|
|
participationsFormation: Array<ParticipationFormationDTO> = []; |
|
|
|
|
private collaborateurSubscription: Subscription; |
|
|
|
|
private participationFormationSubscription: Subscription; |
|
|
|
|
|
|
|
|
|
constructor(private collaborateurService: CollaborateursService, private dialog: MatDialog, private router: Router) {} |
|
|
|
|
constructor(private collaborateurService: CollaborateursService, private participationFormationService: ParticipationsFormationsService, private dialog: MatDialog, private router: Router) {} |
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
|
this.collaborateurSubscription = this.collaborateurService.getCollaborateurById(this.idCollaborateur).subscribe( |
|
|
|
|
collab => this.collaborateur = collab, |
|
|
|
|
err => console.log(err) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
this.participationFormationSubscription = this.participationFormationService.getParticipationByCollaborateur(this.idCollaborateur).subscribe( |
|
|
|
|
participationsFormation => this.participationsFormation = participationsFormation, |
|
|
|
|
err => console.log(err) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnDestroy() { |
|
|
|
|
if(this.collaborateurSubscription != undefined) { |
|
|
|
|
this.collaborateurSubscription.unsubscribe(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(this.participationFormationSubscription != undefined) { |
|
|
|
|
this.participationFormationSubscription.unsubscribe(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|