Mise à jour du home RH

develop
Yanaël GRETTE 4 years ago
parent 03cecbed1e
commit d7b947c956
  1. 13
      src/app/home/home-rh/home-rh.component.html
  2. 48
      src/app/home/home-rh/home-rh.component.ts
  3. 3
      src/app/home/home.component.html
  4. 6
      src/app/home/home.module.ts

@ -13,17 +13,22 @@
<ng-container matColumnDef="date">
<mat-header-cell *matHeaderCellDef>Date prévisionnelle</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.datePrevu | date:'dd/MM/yyyy à hh:mm' }}</mat-cell>
<mat-cell *matCellDef="let row">{{ row.dateDebut | date:'dd/MM/yyyy à hh:mm' }}</mat-cell>
</ng-container>
<!--
<ng-container matColumnDef="origine">
<mat-header-cell *matHeaderCellDef>Origine</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.origine}}</mat-cell>
</ng-container>
-->
<ng-container matColumnDef="statut">
<mat-header-cell *matHeaderCellDef>Statut</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.statut}}</mat-cell>
<mat-cell *matCellDef="let row">{{row.statut.libelle}}</mat-cell>
</ng-container>
<ng-container matColumnDef="certification">
<mat-header-cell *matHeaderCellDef>Certifiée</mat-header-cell>
<mat-cell *matCellDef="let row">{{estCertifiee(row.estCertifie)}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>

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

@ -1,7 +1,8 @@
<app-nav-menu></app-nav-menu>
<h1> Bonjour</h1>
<home-assistante *ngIf="this.userRole == role.assistante"></home-assistante>
<home-rh *ngIf="this.userRole ==role.rh"></home-rh>
<!--
<home-collaborateur *ngIf="this.userRole ==role.collaborateur"></home-collaborateur>
<home-commercial *ngIf="this.userRole ==role.commercial"></home-commercial>
<home-rh *ngIf="this.userRole ==role.rh"></home-rh>-->
-->

@ -6,18 +6,18 @@ import { FormsModule } from '@angular/forms';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
import {HomeAssistanteComponent} from './home-assistante/home-assistante.component';
import {HomeRHComponent} from './home-rh/home-rh.component';
/*
import {HomeCollaborateurComponent} from './home-collaborateur/home-collaborateur.component';
import {HomeCommercialComponent} from './home-commercial/home-commercial.component';
import {HomeRHComponent} from './home-rh/home-rh.component';
*/
import {HomeComponent} from './home.component';
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
@NgModule({
declarations: [
HomeComponent, HomeAssistanteComponent
HomeComponent, HomeAssistanteComponent, HomeRHComponent
/*, HomeCollaborateurComponent,
HomeCommercialComponent, HomeRHComponent*/
HomeCommercialComponent, */
],
exports: [
HomeComponent

Loading…
Cancel
Save