parent
0838e86509
commit
155f773b97
@ -1 +1,22 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h2>Vos EP</h2> |
||||
|
||||
<ng-container *ngIf="idCollaborateur == undefined"> |
||||
|
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
<ng-container *ngIf="idCollaborateur != undefined"> |
||||
<mat-tab-group mat-align-tabs="start"> |
||||
<mat-tab label="EP signés"> |
||||
<ep-table [rechercherParBU]="false" [rechercherParDate]="true" [typeRechercheEP]="epTypeRecherche.RechercheEPCollaborateursSignes" [displayedColumns]="displayedColumnsEPSignes" [idCollaborateur]="idCollaborateur" (eventEmitter)="ouvrirEP($event)" ></ep-table> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="EP référent"> |
||||
<ep-table [rechercherParBU]="false" [rechercherParDate]="true" [typeRechercheEP]="epTypeRecherche.RechercheEPReferentSignes" [displayedColumns]="displayedColumnsEPReferent" [idCollaborateur]="idCollaborateur" (eventEmitter)="ouvrirEP($event)" ></ep-table> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="EP Participant"> |
||||
TODO |
||||
</mat-tab> |
||||
</mat-tab-group> |
||||
</ng-container> |
@ -1,11 +1,54 @@ |
||||
import { Component } from '@angular/core'; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import { CollaborateurDTO } from '@shared/api-swagger'; |
||||
import { AuthService } from '@shared/auth/auth.service'; |
||||
import { cles, epTypeRecherche } from '@shared/utils/cles'; |
||||
import { Role } from '@shared/utils/roles'; |
||||
|
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-ep', |
||||
templateUrl: './ep.component.html' |
||||
}) |
||||
export class EpComponent { |
||||
export class EpComponent implements OnInit { |
||||
|
||||
|
||||
role = Role; |
||||
/** |
||||
* Le rôle de l'utilisateur. |
||||
*/ |
||||
userRole : string; |
||||
|
||||
displayedColumnsEPSignes : string[] = ["referent", "statutep","typeep", "dateentretien", "consultation"]; |
||||
displayedColumnsEPReferent : string[] = ["agence", "collaborateur", "datearrivee", "statutep","typeep", "dateentretien", "consultation"]; |
||||
displayedColumnsEPParticipant : string[] = ["referent", "statutep","typeep", "dateentretien", "consultation"]; |
||||
epTypeRecherche : any = epTypeRecherche; |
||||
|
||||
idCollaborateur: string; |
||||
|
||||
|
||||
constructor(private authService: AuthService, private router: Router){ |
||||
this.userRole = this.authService.firstRole; |
||||
} |
||||
|
||||
ngOnInit() { |
||||
this.setIdCollaborateur(); |
||||
} |
||||
|
||||
setIdCollaborateur() { |
||||
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { |
||||
setTimeout( () => this.setIdCollaborateur(), 1000); |
||||
} |
||||
else { |
||||
const collaborateurConnecte : CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); |
||||
this.idCollaborateur = collaborateurConnecte.id; |
||||
} |
||||
} |
||||
|
||||
|
||||
constructor(){} |
||||
ouvrirEP(event) { |
||||
if(event.type == "ep") |
||||
this.router.navigate(["/ep", event.ep.id]); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue