|
|
@ -6,8 +6,7 @@ import {MatTableDataSource} from '@angular/material/table'; |
|
|
|
import {MatPaginator} from '@angular/material/paginator'; |
|
|
|
import {MatPaginator} from '@angular/material/paginator'; |
|
|
|
import {MatSort} from '@angular/material/sort'; |
|
|
|
import {MatSort} from '@angular/material/sort'; |
|
|
|
|
|
|
|
|
|
|
|
import { FormationModel } from "@shared/api-swagger/model/models"; |
|
|
|
import { FormationDetailsDTO } from "@shared/api-swagger/model/models"; |
|
|
|
import { DisplayFormation } from "@shared/displayInfo/displays"; |
|
|
|
|
|
|
|
import { FormationsService } from "@shared/api-swagger/api/api"; |
|
|
|
import { FormationsService } from "@shared/api-swagger/api/api"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,17 +23,21 @@ import { FormationsService } from "@shared/api-swagger/api/api"; |
|
|
|
export class HomeRHComponent implements OnInit { |
|
|
|
export class HomeRHComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formationsDisponibles : DisplayFormation[]; |
|
|
|
asc = true; |
|
|
|
formationsFiltres : DisplayFormation[]; |
|
|
|
parPage = 15; |
|
|
|
|
|
|
|
numPage = 1; |
|
|
|
|
|
|
|
tri = ""; |
|
|
|
|
|
|
|
|
|
|
|
private formationsDisponiblesSubscription : Subscription; |
|
|
|
private formationsDisponiblesSubscription : Subscription; |
|
|
|
|
|
|
|
|
|
|
|
//displayedColumns: string[] = ["intitule", "participants", "date", "origine", "statut"]
|
|
|
|
//displayedColumns: string[] = ["intitule", "participants", "date", "origine", "statut"]
|
|
|
|
displayedColumns: string[] = ["intitule", "origine", "participants", "date", "statut"] |
|
|
|
//displayedColumns: string[] = ["intitule", "origine", "participants", "date", "statut","certification"];
|
|
|
|
|
|
|
|
displayedColumns: string[] = ["intitule", "participants", "date", "statut","certification"]; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* source pour l'affichage des formations dans le tableau qui est affichée. |
|
|
|
* source pour l'affichage des formations dans le tableau qui est affichée. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
dataSource : MatTableDataSource<DisplayFormation>; |
|
|
|
dataSource : MatTableDataSource<FormationDetailsDTO>; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* contenu de la recherche. |
|
|
|
* contenu de la recherche. |
|
|
@ -59,31 +62,20 @@ export class HomeRHComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
ngOnInit() { |
|
|
|
this.formationsDisponiblesSubscription = this.service.getProchainesFormation(undefined, 1).subscribe( |
|
|
|
this.updateFormations(); |
|
|
|
formations => this.initFormations(formations) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
initFormations(formations:FormationModel[]) { |
|
|
|
updateFormations() { |
|
|
|
this.formationsDisponibles = []; |
|
|
|
this.formationsDisponiblesSubscription = this.service.getProchainesFormation(this.asc, this.numPage, this.parPage, 1, this.search, this.tri).subscribe( |
|
|
|
let formationDisplay : DisplayFormation; |
|
|
|
formations => this.dataSource = new MatTableDataSource(formations), |
|
|
|
for(let formation of formations) { |
|
|
|
err => console.log(err) |
|
|
|
formationDisplay = new DisplayFormation(); |
|
|
|
) |
|
|
|
formationDisplay.id = formation.id; |
|
|
|
} |
|
|
|
formationDisplay.intitule = formation.intitule; |
|
|
|
|
|
|
|
formationDisplay.nbParticipants = 0; |
|
|
|
estCertifiee(certifiee) { |
|
|
|
if(formation.participantsFormation != undefined) { |
|
|
|
if(certifiee) |
|
|
|
formationDisplay.nbParticipants = formation.participantsFormation.length; |
|
|
|
return "Oui"; |
|
|
|
} |
|
|
|
return "Non"; |
|
|
|
formationDisplay.datePrevu = formation.dateDebut; |
|
|
|
|
|
|
|
formationDisplay.origine = formation.origine; |
|
|
|
|
|
|
|
formationDisplay.statut = formation.statut; |
|
|
|
|
|
|
|
this.formationsDisponibles.push(formationDisplay); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.formationsFiltres = this.formationsDisponibles; |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.formationsFiltres); |
|
|
|
|
|
|
|
this.dataSource.paginator = this.paginator; |
|
|
|
|
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() { |
|
|
|
ngOnDestroy() { |
|
|
|