diff --git a/src/app/collaborateurs/collaborateurs.component.html b/src/app/collaborateurs/collaborateurs.component.html index 04dd5eb..dc9babb 100644 --- a/src/app/collaborateurs/collaborateurs.component.html +++ b/src/app/collaborateurs/collaborateurs.component.html @@ -4,7 +4,7 @@ Agence - {{ row.businessunit.nom }} + {{ row.businessUnit.nom }} diff --git a/src/app/collaborateurs/collaborateurs.module.ts b/src/app/collaborateurs/collaborateurs.module.ts index 5d110df..4032bad 100644 --- a/src/app/collaborateurs/collaborateurs.module.ts +++ b/src/app/collaborateurs/collaborateurs.module.ts @@ -8,20 +8,20 @@ import { MaterialModule } from "@shared/angular-material/angular-material.module import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; import { CollaborateursComponent } from "./collaborateurs.component"; -/* import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component"; + import { EvaluationComponent } from "./formations-collaborateur/details-evaluation/evaluation.component"; import { EditEvaluationComponent } from "./formations-collaborateur/edit-evaluation/edit-evaluation.component"; import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component"; -*/ + import { CollaborateursRoutingModule } from "./collaborateurs.routing.module"; @NgModule({ declarations: [ - CollaborateursComponent - /*DetailsCollaborateurComponent, EvaluationComponent, EditEvaluationComponent, - , FormationsCollaboateurComponent*/ + CollaborateursComponent, DetailsCollaborateurComponent, + DetailsCollaborateurComponent, EvaluationComponent, EditEvaluationComponent, + FormationsCollaboateurComponent ], exports: [ CollaborateursComponent diff --git a/src/app/collaborateurs/collaborateurs.routing.module.ts b/src/app/collaborateurs/collaborateurs.routing.module.ts index 926ddfd..107615d 100644 --- a/src/app/collaborateurs/collaborateurs.routing.module.ts +++ b/src/app/collaborateurs/collaborateurs.routing.module.ts @@ -2,23 +2,22 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CollaborateursComponent } from "./collaborateurs.component"; -/* import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component"; import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component"; import { EvaluationComponent } from './formations-collaborateur/details-evaluation/evaluation.component'; import { EditEvaluationComponent } from './formations-collaborateur/edit-evaluation/edit-evaluation.component'; -*/ + import { paths_collaborateurs } from '@shared/utils/paths'; import { KeycloakGuard } from '@shared/guards/keycloakguard'; const routes: Routes = [ - { path:'', component: CollaborateursComponent, pathMatch: 'full', canActivate: [KeycloakGuard] }/*, + { path:'', component: CollaborateursComponent, pathMatch: 'full', canActivate: [KeycloakGuard] }, { path:paths_collaborateurs.formations, component: FormationsCollaboateurComponent, canActivate: [KeycloakGuard] }, { path:paths_collaborateurs.evaluation, component: EvaluationComponent, canActivate: [KeycloakGuard] }, { path:paths_collaborateurs.edit, component: EditEvaluationComponent, canActivate: [KeycloakGuard] }, - { path:paths_collaborateurs.get, component: DetailsCollaborateurComponent, canActivate: [KeycloakGuard] }*/ + { path:paths_collaborateurs.get, component: DetailsCollaborateurComponent, canActivate: [KeycloakGuard] } ]; diff --git a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html index 6f50b1a..24d784d 100644 --- a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html +++ b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html @@ -9,16 +9,16 @@ - +

Aucun EP effectué encore

- +

Liste des précédents EP

Date entretient - {{ row.dateentretien}} + {{ row.datePrevisionnelle }} @@ -28,7 +28,7 @@ Type - {{ row.type}} + {{ row.type }} diff --git a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts index 12e9320..d067ede 100644 --- a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts +++ b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts @@ -9,9 +9,7 @@ import {MatSort} from '@angular/material/sort'; import { CollaborateursService, EpService } from "@shared/api-swagger/api/api"; -import { CollaborateurModel } from "@shared/api-swagger/model/collaborateurModel"; -import { EpModel } from "@shared/api-swagger/model/epModel"; -import { DisplayEP } from "@shared/displayInfo/displays"; +import { EpInformationDTO, CollaborateurDTO } from "@shared/api-swagger/model/models"; /** */ @@ -20,13 +18,19 @@ import { DisplayEP } from "@shared/displayInfo/displays"; templateUrl: './details-collaborateur.component.html' }) export class DetailsCollaborateurComponent implements OnInit { -//epCollaborateurIdCollaborateurGet - collaborateur: CollaborateurModel; + + asc = true; + numPage = 1; + parPage = 5; + search = ""; + tri = ""; + + nbEP = 0; + collaborateur: CollaborateurDTO; private collaborateurSubscription : Subscription; private epSubscription : Subscription; - epEffectues : DisplayEP[]; displayedColumns: string[] = ["dateentretien", "referent", "type", "details"]; - dataSource : MatTableDataSource; + dataSource : MatTableDataSource; eploaded = false; idCollaborateur: any; @@ -44,35 +48,31 @@ export class DetailsCollaborateurComponent implements OnInit { ngOnInit() { this.idCollaborateur = this.route.snapshot.paramMap.get('id'); + console.log(this.idCollaborateur); this.collaborateurSubscription = this.collaborateusrService.getCollaborateurById(this.idCollaborateur).subscribe( collaborateur => this.initCollaborateur(collaborateur[0]), err => console.log(err) ); } - initCollaborateur(collaborateur:CollaborateurModel) { + initCollaborateur(collaborateur:CollaborateurDTO) { this.collaborateur = collaborateur; - this.epSubscription = this.epService.getEPByCollaborateur(this.idCollaborateur).subscribe( - ep => this.initEP(ep) - ) + this.updateEP() } - initEP(ep:EpModel[]) { - this.epEffectues = []; - let epDisplay : DisplayEP; - for(let un_ep of ep) { - epDisplay = new DisplayEP(); - epDisplay.id = un_ep.id; - epDisplay.referent = un_ep.referent; - epDisplay.etat = un_ep.etat; - epDisplay.type = un_ep.type; - epDisplay.dateentretien = un_ep.dateEntretien; - this.epEffectues.push(epDisplay); - } - this.dataSource = new MatTableDataSource(this.epEffectues); - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; + updateEP() { + console.log(this.idCollaborateur); + this.epSubscription = this.epService.getEPByCollaborateur(this.asc, this.idCollaborateur, this.numPage, this.parPage, undefined, this.search, this.tri).subscribe( + ep => + { + this.nbEP = ep.length; + this.dataSource = new MatTableDataSource(ep); + }, + err => console.log(err) + ); this.eploaded = true; + //this.dataSource.paginator = this.paginator; + //this.dataSource.sort = this.sort; } ngOnDestroy() { diff --git a/src/app/home/home-assistante/home-assistante.component.html b/src/app/home/home-assistante/home-assistante.component.html index d7c0089..9fe22e4 100644 --- a/src/app/home/home-assistante/home-assistante.component.html +++ b/src/app/home/home-assistante/home-assistante.component.html @@ -16,7 +16,7 @@ Agence - {{row.collaborateur.businessunit.nom}} + {{row.collaborateur.businessUnit.nom}}