Compare commits
127 Commits
Author | SHA1 | Date |
---|---|---|
Jimmy Boinembalome | ef1754e8a1 | 3 years ago |
Jimmy Boinembalome | 1001965e99 | 3 years ago |
Jimmy Boinembalome | 5315ed8f8d | 3 years ago |
Jimmy Boinembalome | 07de763723 | 3 years ago |
Yanaël GRETTE | 5b4ded0939 | 4 years ago |
Yanaël GRETTE | 3c4f4df19d | 4 years ago |
Yanaël GRETTE | 1c41609db7 | 4 years ago |
Yanaël GRETTE | 283663f9cb | 4 years ago |
Yanaël GRETTE | 9f348c1b7f | 4 years ago |
jboinembalome | 1fc5aa7752 | 4 years ago |
jboinembalome | fed808d26f | 4 years ago |
jboinembalome | 7543d6a953 | 4 years ago |
jboinembalome | ecd95a5545 | 4 years ago |
jboinembalome | c397fec93c | 4 years ago |
jboinembalome | c64889cf85 | 4 years ago |
Yanaël GRETTE | 09059dee66 | 4 years ago |
Yanaël GRETTE | 1c228628f1 | 4 years ago |
Yanaël GRETTE | 2e6b60f5c0 | 4 years ago |
Yanaël GRETTE | bdcb627d52 | 4 years ago |
Yanaël GRETTE | 0a0966f398 | 4 years ago |
Yanaël GRETTE | 68017679e1 | 4 years ago |
Yanaël GRETTE | c0097aac86 | 4 years ago |
Yanaël GRETTE | 67216c5b80 | 4 years ago |
Yanaël GRETTE | d6192d422f | 4 years ago |
Yanaël GRETTE | 155f773b97 | 4 years ago |
Yanaël GRETTE | 0838e86509 | 4 years ago |
Yanaël GRETTE | de956f8bc3 | 4 years ago |
Yanaël GRETTE | ba121e4eec | 4 years ago |
Yanaël GRETTE | 2d8a0b2769 | 4 years ago |
Yanaël GRETTE | 2f8abd0f77 | 4 years ago |
Yanaël GRETTE | 95b714bf96 | 4 years ago |
Yanaël GRETTE | 25cd7554c2 | 4 years ago |
Yanaël GRETTE | 4cfc1c8a13 | 4 years ago |
Yanaël GRETTE | c399bb14fa | 4 years ago |
Yanaël GRETTE | 8a5398658e | 4 years ago |
jboinembalome | f1bd81022f | 4 years ago |
jboinembalome | 9321c05fd1 | 4 years ago |
jboinembalome | 85cd6c2b86 | 4 years ago |
jboinembalome | 3af7f2dda4 | 4 years ago |
Yanaël GRETTE | 330eba64b9 | 4 years ago |
Yanaël GRETTE | f5af77ff30 | 4 years ago |
Yanaël GRETTE | 35abb47e9b | 4 years ago |
Yanaël GRETTE | f33056fd28 | 4 years ago |
jboinembalome | 79cb30e775 | 4 years ago |
jboinembalome | 58c98d78a1 | 4 years ago |
jboinembalome | ca19622837 | 4 years ago |
Yanaël GRETTE | 011bfd8814 | 4 years ago |
Yanaël GRETTE | fa5159a3a9 | 4 years ago |
jboinembalome | ca628f3e5f | 4 years ago |
Yanaël GRETTE | 87e0282c2c | 4 years ago |
jboinembalome | 9e26cfc768 | 4 years ago |
jboinembalome | 9e326fde54 | 4 years ago |
Yanaël GRETTE | f09c3cb8cf | 4 years ago |
jboinembalome | 92eb7861a4 | 4 years ago |
jboinembalome | 0366a9b607 | 4 years ago |
jboinembalome | 805c4f3992 | 4 years ago |
jboinembalome | 29d1314805 | 4 years ago |
jboinembalome | 851ee9e637 | 4 years ago |
jboinembalome | 56b19f8a0b | 4 years ago |
Yanaël GRETTE | 69eaf38f25 | 4 years ago |
Yanaël GRETTE | eace2b936c | 4 years ago |
Yanaël GRETTE | 7aca2a5165 | 4 years ago |
Yanaël GRETTE | 9bb818d684 | 4 years ago |
Yanaël GRETTE | 1771dc67c2 | 4 years ago |
Yanaël GRETTE | 9752339376 | 4 years ago |
Yanaël GRETTE | e3896087fc | 4 years ago |
Yanaël GRETTE | 2f62e3bbf3 | 4 years ago |
Yanaël GRETTE | f28b2d34e1 | 4 years ago |
Yanaël GRETTE | 7427957e9c | 4 years ago |
Yanaël GRETTE | 6406c624c3 | 4 years ago |
Yanaël GRETTE | a7e47f98d2 | 4 years ago |
Yanaël GRETTE | 667b55fcf9 | 4 years ago |
Yanaël GRETTE | 7e30f21ded | 4 years ago |
Yanaël GRETTE | 6e404274c3 | 4 years ago |
Yanaël GRETTE | 43aac7cbfc | 4 years ago |
Yanaël GRETTE | b340fd26ff | 4 years ago |
Yanaël GRETTE | e7516a2188 | 4 years ago |
Yanaël GRETTE | c2ed6550f9 | 4 years ago |
Yanaël GRETTE | 053a0419e1 | 4 years ago |
Yanaël GRETTE | 954f1613ef | 4 years ago |
Yanaël GRETTE | 06d13b43f9 | 4 years ago |
Yanaël GRETTE | 122cbc8116 | 4 years ago |
Yanaël GRETTE | 76b666ccdc | 4 years ago |
Yanaël GRETTE | 0a9d17741c | 4 years ago |
Yanaël GRETTE | 86bd26152b | 4 years ago |
Yanaël GRETTE | 7855d4fcc5 | 4 years ago |
Yanaël GRETTE | 9a1d43fd54 | 4 years ago |
Yanaël GRETTE | 2b1e0123f2 | 4 years ago |
Yanaël GRETTE | 7254fe0677 | 4 years ago |
Yanaël GRETTE | 11d2676efd | 4 years ago |
Yanaël GRETTE | f42748a5f9 | 4 years ago |
Yanaël GRETTE | 4166a9edcf | 4 years ago |
Yanaël GRETTE | b62273401a | 4 years ago |
Yanaël GRETTE | de1cc0fe11 | 4 years ago |
Yanaël GRETTE | 6049ad5431 | 4 years ago |
Yanaël GRETTE | 8d91f16b86 | 4 years ago |
Yanaël GRETTE | 940cdd8801 | 4 years ago |
Yanaël GRETTE | ef2ed5a0b6 | 4 years ago |
Yanaël GRETTE | 765d2aca26 | 4 years ago |
Yanaël GRETTE | 4f8360db34 | 4 years ago |
Yanaël GRETTE | a937aeaafc | 4 years ago |
Yanaël GRETTE | f558516a1a | 4 years ago |
Yanaël GRETTE | 0a70fb0dbb | 4 years ago |
Yanaël GRETTE | 35126aeec8 | 4 years ago |
Yanaël GRETTE | 1692adaf42 | 4 years ago |
Yanaël GRETTE | 56539b4556 | 4 years ago |
Yanaël GRETTE | 559af3456f | 4 years ago |
Yanaël GRETTE | 4441911026 | 4 years ago |
Yanaël GRETTE | 08326f07ac | 4 years ago |
jboinembalome | 087463e3ff | 4 years ago |
jboinembalome | 22520add64 | 4 years ago |
jboinembalome | f14bad4e3e | 4 years ago |
jboinembalome | 198d440f97 | 4 years ago |
jboinembalome | 485d5f111d | 4 years ago |
Yanaël GRETTE | cbd9232269 | 4 years ago |
Yanaël GRETTE | 44072ac899 | 4 years ago |
Yanaël GRETTE | e374063f7b | 4 years ago |
jboinembalome | c7a7e0e87d | 4 years ago |
jboinembalome | af75811436 | 4 years ago |
Yanaël GRETTE | 26557be67a | 4 years ago |
Yanaël GRETTE | ffbac86dfc | 4 years ago |
Yanaël GRETTE | f6e2c6ab79 | 4 years ago |
Yanaël GRETTE | cad23074d6 | 4 years ago |
Yanaël GRETTE | d06122909a | 4 years ago |
Yanaël GRETTE | 8b04b1ae08 | 4 years ago |
Yanaël GRETTE | d7b947c956 | 4 years ago |
Yanaël GRETTE | 03cecbed1e | 4 years ago |
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,37 @@ |
||||
import { Component } from '@angular/core'; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { CollaborateursService } from '@shared/api-swagger/api/api' |
||||
import { AuthService } from '@shared/auth/auth.service'; |
||||
import { Subscription } from 'rxjs'; |
||||
|
||||
import { cles } from "@shared/utils/cles" |
||||
|
||||
@Component({ |
||||
selector: 'app-root', |
||||
templateUrl: './app.component.html', |
||||
styleUrls: ['./app.component.css'] |
||||
styleUrls: ['./app.component.scss'] |
||||
}) |
||||
export class AppComponent { |
||||
|
||||
export class AppComponent implements OnInit { |
||||
title = 'EPAClient'; |
||||
|
||||
constructor() { |
||||
subscriber: Subscription; |
||||
|
||||
|
||||
constructor(private collaborateursService: CollaborateursService, |
||||
private authService: AuthService ) { |
||||
|
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { |
||||
this.subscriber = this.collaborateursService.getCollaborateurByMail(this.authService.mail).subscribe( |
||||
collaborateur => sessionStorage.setItem(cles.sessionKeyConnectee, JSON.stringify(collaborateur)) |
||||
); |
||||
} |
||||
} |
||||
|
||||
ngOnDestroy(): void { |
||||
if(this.subscriber != undefined) |
||||
this.subscriber.unsubscribe(); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,125 @@ |
||||
// ----------------------------------------------------------------------------------------------------- |
||||
// @ Custom color maps |
||||
// ----------------------------------------------------------------------------------------------------- |
||||
$navy-app-theme: ( |
||||
50: #ECECEE, |
||||
100: #C5C6CB, |
||||
200: #9EA1A9, |
||||
300: #7D818C, |
||||
400: #5C616F, |
||||
500: #E89759, |
||||
600: #353A48, |
||||
700: #2D323E, |
||||
800: #262933, |
||||
900: #1E2129, |
||||
A100: #C5C6CB, |
||||
A200: #9EA1A9, |
||||
A400: #5C616F, |
||||
A700: #2D323E, |
||||
contrast: ( |
||||
50: $dark-primary-text, |
||||
100: $dark-primary-text, |
||||
200: $dark-primary-text, |
||||
300: $light-primary-text, |
||||
400: $light-primary-text, |
||||
500: $light-primary-text, |
||||
600: $light-primary-text, |
||||
700: $light-primary-text, |
||||
800: $light-primary-text, |
||||
900: $light-primary-text, |
||||
A100: $dark-primary-text, |
||||
A200: $light-primary-text, |
||||
A400: $light-primary-text, |
||||
A700: $light-primary-text, |
||||
) |
||||
); |
||||
|
||||
$apside-primary-app-theme: ( |
||||
50: #ECECEE, |
||||
100: #C5C6CB, |
||||
200: #9EA1A9, |
||||
300: #7D818C, |
||||
400: #5C616F, |
||||
500: #E89759, |
||||
600: #353A48, |
||||
700: #2D323E, |
||||
800: #262933, |
||||
900: #1E2129, |
||||
A100: #C5C6CB, |
||||
A200: #9EA1A9, |
||||
A400: #5C616F, |
||||
A700: #2D323E, |
||||
contrast: ( |
||||
50: $dark-primary-text, |
||||
100: $dark-primary-text, |
||||
200: $dark-primary-text, |
||||
300: $light-primary-text, |
||||
400: $light-primary-text, |
||||
500: $light-primary-text, |
||||
600: $light-primary-text, |
||||
700: $light-primary-text, |
||||
800: $light-primary-text, |
||||
900: $light-primary-text, |
||||
A100: $dark-primary-text, |
||||
A200: $light-primary-text, |
||||
A400: $light-primary-text, |
||||
A700: $light-primary-text, |
||||
) |
||||
); |
||||
|
||||
// ----------------------------------------------------------------------------------------------------- |
||||
// @ Define the default theme |
||||
// ----------------------------------------------------------------------------------------------------- |
||||
|
||||
// Define the primary, accent and warn palettes |
||||
$default-primary-palette: mat-palette($navy-app-theme); |
||||
$default-accent-palette: mat-palette($mat-light-blue, 600, 400, 700); |
||||
$default-warn-palette: mat-palette($mat-red); |
||||
|
||||
// Create the Material theme object |
||||
$theme: mat-light-theme($default-primary-palette, $default-accent-palette, $default-warn-palette); |
||||
|
||||
// Add ".theme-default" class to the body to activate this theme. |
||||
// Class name must start with "theme-" !!! |
||||
.theme-default { |
||||
|
||||
// Create an Angular Material theme from the $theme map |
||||
@include angular-material-theme($theme); |
||||
} |
||||
|
||||
// ----------------------------------------------------------------------------------------------------- |
||||
// @ Define a blue-gray dark theme |
||||
// ----------------------------------------------------------------------------------------------------- |
||||
|
||||
// Define the primary, accent and warn palettes |
||||
$blue-gray-dark-theme-primary-palette: mat-palette($navy-app-theme); |
||||
$blue-gray-dark-theme-accent-palette: mat-palette($mat-blue-gray); |
||||
$blue-gray-dark-theme-warn-palette: mat-palette($mat-red); |
||||
|
||||
// Create the Material theme object |
||||
$blue-gray-dark-theme: mat-dark-theme($blue-gray-dark-theme-primary-palette, $blue-gray-dark-theme-accent-palette, $blue-gray-dark-theme-warn-palette); |
||||
|
||||
// Add ".theme-blue-gray-dark" class to the body to activate this theme. |
||||
// Class name must start with "theme-" !!! |
||||
.theme-blue-gray-dark { |
||||
|
||||
// Generate the Angular Material theme |
||||
@include angular-material-theme($blue-gray-dark-theme); |
||||
} |
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------- |
||||
// @ Typography |
||||
// ----------------------------------------------------------------------------------------------------- |
||||
|
||||
// Angular Material typography |
||||
$typography: mat-typography-config( |
||||
$font-family: 'Muli, Helvetica Neue, Arial, sans-serif', |
||||
$title: mat-typography-level(20px, 32px, 600), |
||||
$body-2: mat-typography-level(14px, 24px, 600), |
||||
$button: mat-typography-level(14px, 14px, 600), |
||||
$input: mat-typography-level(16px, 1.125, 400) // line-height must be unitless !!! |
||||
); |
||||
|
||||
// Setup the typography |
||||
@include angular-material-typography($typography); |
@ -1,27 +1,5 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1> Liste des collaborateurs </h1> |
||||
|
||||
<mat-table matSort [dataSource]="dataSource"> |
||||
<ng-container matColumnDef="agence"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Agence</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.agence}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="collaborateur"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Collabotareur</mat-header-cell> |
||||
<mat-cell *matCellDef="let row" [routerLink]="['/collaborateurs', row.id]">{{row.prenom}} {{row.nom}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="dateembauche"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Date embauche</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">TODO AUSSI</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="referent"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">TODO</mat-cell> |
||||
</ng-container> |
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> |
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> |
||||
</mat-table> |
||||
<collaborateurs-table [typeRecherche]="typeRecherche" [rechercherParBU]="rechercherParBU" [roles]="roles" [displayedColumns]="displayedColumns" (eventEmitter)="event($event)" ></collaborateurs-table> |
@ -1,95 +1,54 @@ |
||||
import { Component, OnInit, OnDestroy, ViewChild, ViewChildren } from '@angular/core'; |
||||
import { Component } from '@angular/core'; |
||||
|
||||
import { Observable, Subscription } from 'rxjs'; |
||||
|
||||
import {MatTableDataSource} from '@angular/material/table'; |
||||
import {MatPaginator} from '@angular/material/paginator'; |
||||
import {MatSort} from '@angular/material/sort'; |
||||
|
||||
import { CollaborateursService } from "@shared/api-swagger/api/api"; |
||||
|
||||
import { CollaborateurModel } from "@shared/api-swagger/model/models"; |
||||
import { DisplayCollaborateur } from "@shared/displayInfo/displays"; |
||||
import { collaborateurTypeRecherche } from "@shared/utils/cles"; |
||||
import { Router } from '@angular/router'; |
||||
|
||||
/** |
||||
* Composant qui sert à l'affichage de la liste des collaborateurs en fonction de l'agence de son utilitateur. |
||||
* Seuls les commerciaux, RH et assistantes pourront accéder à la liste des collaborateurs. |
||||
* Les données affichées : Agence-Nom Prénom-Date Embauche-Responsable Commercial-Date Prochain EP |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-collaborateurs', |
||||
templateUrl: './collaborateurs.component.html' |
||||
}) |
||||
export class CollaborateursComponent implements OnInit { |
||||
|
||||
collaborateursDisponibles : DisplayCollaborateur[]; |
||||
collaborateursFiltre : DisplayCollaborateur[]; |
||||
private collaborateursDisponiblesSubscription : Subscription; |
||||
|
||||
displayedColumns : string[] = ["agence", "collaborateur", "dateembauche", "referent"]; |
||||
|
||||
dataSource : MatTableDataSource<DisplayCollaborateur>; |
||||
export class CollaborateursComponent { |
||||
|
||||
/** |
||||
* contenu de la recherche. |
||||
*/ |
||||
search = ""; |
||||
* Type de la recherche à indiquer au composant fils qui affiche la liste des collaborateurs |
||||
*/ |
||||
typeRecherche: string = collaborateurTypeRecherche.collaborateurs; |
||||
|
||||
/** |
||||
* Pagination du tableau. |
||||
* Rôle des collaborateurs à récupérer via le service collaborateur, ici nous ne voulons que les collaborateurs (pour le moment...). |
||||
*/ |
||||
@ViewChild(MatPaginator) paginator: MatPaginator; |
||||
|
||||
roles: string[] = ["Collaborateur"]; |
||||
|
||||
/** |
||||
* Tri par les éléments du tableau selon la colonne choisie. |
||||
* Liste des colonnes du tableau à afficher. |
||||
*/ |
||||
@ViewChild(MatSort) sort: MatSort; |
||||
displayedColumns: string[] = ["businessunit", "collaborateur", "datearrivee", "referent"]; |
||||
|
||||
/** |
||||
* Spécifie si la liste des EP est en cours de chargement et d'écriture dans le tableau. |
||||
*/ |
||||
chargement = true; |
||||
constructor(private service: CollaborateursService) {} |
||||
* Indique si la recherche pas BU est activée ou non |
||||
*/ |
||||
rechercherParBU: boolean = true; |
||||
|
||||
constructor(private router: Router) {} |
||||
|
||||
ngOnInit() { |
||||
this. collaborateursDisponiblesSubscription = this.service.getCollaborateurs(undefined,undefined,undefined,1).subscribe( |
||||
collaborateurs => { |
||||
this.initCollaborateur(collaborateurs) |
||||
} |
||||
); |
||||
} |
||||
|
||||
initCollaborateur(collaborateurs:CollaborateurModel[]) { |
||||
this.collaborateursDisponibles = []; |
||||
let collaborateurDisplay : DisplayCollaborateur; |
||||
let today = new Date(); |
||||
console.log(collaborateurs); |
||||
for(let c of collaborateurs) { |
||||
collaborateurDisplay = new DisplayCollaborateur(); |
||||
collaborateurDisplay.id = c.id; |
||||
collaborateurDisplay.prenom = c.prenom; |
||||
collaborateurDisplay.nom = c.nom; |
||||
collaborateurDisplay.agence = c.businessUnit.nom; |
||||
collaborateurDisplay.embauche = c.dateArrivee; |
||||
collaborateurDisplay.anciennete = this.setAnciennete(new Date(c.dateArrivee), today); |
||||
collaborateurDisplay.annee = Math.floor(collaborateurDisplay.anciennete / 31536000000); |
||||
collaborateurDisplay.mois = Math.floor(collaborateurDisplay.anciennete / 2629800000 % 12); |
||||
this.collaborateursDisponibles.push(collaborateurDisplay); |
||||
} |
||||
this.collaborateursFiltre = this.collaborateursDisponibles; |
||||
this.dataSource = new MatTableDataSource(this.collaborateursFiltre); |
||||
this.dataSource.paginator = this.paginator; |
||||
this.dataSource.sort = this.sort; |
||||
} |
||||
|
||||
|
||||
setAnciennete(firstDate, secondDate) { |
||||
return Math.abs(firstDate-secondDate); |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.collaborateursDisponiblesSubscription != undefined) { |
||||
this.collaborateursDisponiblesSubscription.unsubscribe(); |
||||
/** |
||||
* Fonction permettant d'ouvrir les détails d'un référent ou d'un collaborateur en fonction de la case cliquée |
||||
*
|
||||
* @param event Evènement reçu par le composant enfant, contient le type du collaborateur reçu (référent, collaborateur) et les données collaborateur |
||||
*/ |
||||
event(event : any) { |
||||
switch(event.type) { |
||||
case "collaborateur": |
||||
this.router.navigate(["/collaborateurs", event.collaborateur.id]); |
||||
break; |
||||
case "referent": |
||||
this.router.navigate(["/referents", event.collaborateur.id]); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
@ -1,42 +1,3 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<ng-container *ngIf="collaborateur!=undefined"> |
||||
<h2>{{ collaborateur.prenom }} {{ collaborateur.nom }} </h2> |
||||
|
||||
<h3>Agence : {{ collaborateur.businessUnit.nom}}</h3> |
||||
<h3>Date embauche : {{ collaborateur.dateArrivee}}</h3> |
||||
</ng-container> |
||||
<ng-container *ngIf="collaborateur==undefined || !eploaded"> |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf= "eploaded && epEffectues.length==0"> |
||||
<h3> Aucun EP effectué encore </h3> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf= "eploaded && epEffectues.length!=0"> |
||||
<h3>Liste des précédents EP</h3> |
||||
<mat-table [dataSource]="this.dataSource" matSort> |
||||
<ng-container matColumnDef="dateentretien"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Date entretient</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.dateentretien}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="referent"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell> |
||||
<mat-cell *matCellDef="let row"> {{ row.referent.prenom }} {{ row.referent.nom }}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="type"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.type}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="details"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header></mat-header-cell> |
||||
<mat-cell *matCellDef="let row" [routerLink]="['/ep',row.id]"> Voir détails EP </mat-cell> |
||||
</ng-container> |
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> |
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> |
||||
</mat-table> |
||||
</ng-container> |
||||
<affichage-details-collaborateur [idCollaborateur]="idCollaborateur"></affichage-details-collaborateur> |
@ -1,86 +1,20 @@ |
||||
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; |
||||
import { Component } from '@angular/core'; |
||||
|
||||
import { Observable, Subscription } from 'rxjs'; |
||||
import {ActivatedRoute} from '@angular/router'; |
||||
|
||||
import {MatTableDataSource} from '@angular/material/table'; |
||||
import {MatPaginator} from '@angular/material/paginator'; |
||||
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"; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour gérer l'affichage des détails d'un collaborateur avec ses formations et ses EP |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-details-collaborateur', |
||||
templateUrl: './details-collaborateur.component.html' |
||||
}) |
||||
export class DetailsCollaborateurComponent implements OnInit { |
||||
//epCollaborateurIdCollaborateurGet
|
||||
collaborateur: CollaborateurModel; |
||||
private collaborateurSubscription : Subscription; |
||||
private epSubscription : Subscription; |
||||
epEffectues : DisplayEP[]; |
||||
displayedColumns: string[] = ["dateentretien", "referent", "type", "details"]; |
||||
dataSource : MatTableDataSource<DisplayEP>; |
||||
eploaded = false; |
||||
idCollaborateur: any; |
||||
|
||||
/** |
||||
* Pagination du tableau. |
||||
*/ |
||||
@ViewChild(MatPaginator) paginator: MatPaginator; |
||||
export class DetailsCollaborateurComponent { |
||||
|
||||
/** |
||||
* Tri par les éléments du tableau selon la colonne choisie. |
||||
*/ |
||||
@ViewChild(MatSort) sort: MatSort; |
||||
idCollaborateur: string; |
||||
|
||||
constructor(private collaborateusrService:CollaborateursService, private epService:EpService, private route: ActivatedRoute) {} |
||||
|
||||
ngOnInit() { |
||||
constructor(private route: ActivatedRoute) { |
||||
this.idCollaborateur = this.route.snapshot.paramMap.get('id'); |
||||
this.collaborateurSubscription = this.collaborateusrService.getCollaborateurById(this.idCollaborateur).subscribe( |
||||
collaborateur => this.initCollaborateur(collaborateur[0]), |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
initCollaborateur(collaborateur:CollaborateurModel) { |
||||
this.collaborateur = collaborateur; |
||||
this.epSubscription = this.epService.getEPByCollaborateur(this.idCollaborateur).subscribe( |
||||
ep => this.initEP(ep) |
||||
) |
||||
} |
||||
|
||||
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; |
||||
this.eploaded = true; |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.epSubscription!= undefined) { |
||||
this.epSubscription.unsubscribe(); |
||||
} |
||||
if(this.collaborateurSubscription!= undefined) { |
||||
this.collaborateurSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,2 +1,11 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1>Liste des demandes de délégations</h1> |
||||
<h2>Liste de vos demandes de délégations en attente</h2> |
||||
<ng-container *ngIf="chargement"> |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
<ng-container *ngIf="!chargement"> |
||||
<p *ngIf="demandesDelegation.length==0"> |
||||
Aucune demande de délégation en cours. |
||||
</p> |
||||
<app-demande-delegation *ngFor="let demandeDelegation of demandesDelegation" [demandeDelegation]="demandeDelegation" (eventEmitter)="donnerReponse($event)"></app-demande-delegation> |
||||
</ng-container> |
@ -1,15 +1,91 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Component, Inject, OnInit } from '@angular/core'; |
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { CollaborateurDTO, DemandeDelegationDTO, DemandesDelegationService, EtatDemande } from '@shared/api-swagger'; |
||||
import { cles } from '@shared/utils/cles'; |
||||
import { Subscription } from 'rxjs'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher la liste des demandes de délégation reçues |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-demandes-delegation', |
||||
templateUrl: './demandes-delegation.component.html' |
||||
}) |
||||
export class DemandesDelegationComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
idCollaborateurConnecte: string = ""; |
||||
|
||||
chargement: boolean = true; |
||||
|
||||
demandesDelegation: DemandeDelegationDTO[] = []; |
||||
|
||||
demandeDelegationSubscription: Subscription; |
||||
demandeDelegationReponseSubscription: Subscription; |
||||
constructor(private demandeDelegationService: DemandesDelegationService, private matDialog: MatDialog) {} |
||||
|
||||
|
||||
ngOnInit() { |
||||
this.setIdCollaborateurConnecte(); |
||||
} |
||||
|
||||
setIdCollaborateurConnecte() { |
||||
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { |
||||
setTimeout( () => this.setIdCollaborateurConnecte(), 1000); |
||||
} |
||||
else { |
||||
const collaborateurConnecte: CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee));
|
||||
this.idCollaborateurConnecte = collaborateurConnecte.id; |
||||
this.updateListeDemandesDelegation(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Cette fonction permet de mettre à jour l'affichage de la liste des demande de délégation |
||||
*/ |
||||
updateListeDemandesDelegation() { |
||||
this.chargement = false; |
||||
this.demandeDelegationSubscription = this.demandeDelegationService.getDemandesDelegationReferent(this.idCollaborateurConnecte).subscribe( |
||||
demandeDelegations => this.demandesDelegation = demandeDelegations, |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
donnerReponse(event: DemandeDelegationDTO) { |
||||
console.log(event); |
||||
const id: number = event.id; |
||||
this.demandeDelegationReponseSubscription = this.demandeDelegationService.updateDemandeDelegation(event, event.id).subscribe( |
||||
() => { |
||||
let data: any = { |
||||
acceptee: false |
||||
}; |
||||
if(event.etatDemande == EtatDemande.Validee) { |
||||
data.acceptee = true, |
||||
data.ep = event.ep |
||||
} |
||||
this.demandesDelegation = this.demandesDelegation.filter(d => d.id != id); |
||||
this.matDialog.open(DialogValidationReponse, {data:data}); |
||||
}, |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.demandeDelegationSubscription != undefined) { |
||||
this.demandeDelegationSubscription.unsubscribe(); |
||||
} |
||||
if(this.demandeDelegationReponseSubscription != undefined) { |
||||
this.demandeDelegationReponseSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
@Component({ |
||||
selector: "dialog-validation-reponse", |
||||
templateUrl: "./dialog-validation-reponse.html" |
||||
}) |
||||
export class DialogValidationReponse { |
||||
constructor(@Inject(MAT_DIALOG_DATA)public data: any, private matDialog: MatDialogRef<DialogValidationReponse>) {} |
||||
fermer() {this.matDialog.close();} |
||||
} |
@ -1,2 +1,15 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1> Demande delegation </h1> |
||||
<mat-card> |
||||
<mat-card-header> |
||||
<mat-card-title>{{demandeDelegation.ep.collaborateur.nom}} {{demandeDelegation.ep.collaborateur.prenom}}</mat-card-title> |
||||
</mat-card-header> |
||||
<mat-card-content> |
||||
<p>Demande effectuée le {{ demandeDelegation.dateDemande | date: 'dd/MM/yyyy'}} par {{demandeDelegation.ep.referent.nom}} {{demandeDelegation.ep.referent.prenom}} </p> |
||||
<p *ngIf="demandeDelegation.ep.datePrevisionnelle == undefined"> {{demandeDelegation.ep.type}} en attente d'une date</p> |
||||
<p *ngIf="demandeDelegation.ep.datePrevisionnelle != undefined"> {{demandeDelegation.ep.type}} prévu le {{demandeDelegation.ep.datePrevisionnelle | date : 'dd/MM/yyyy'}} </p> |
||||
|
||||
</mat-card-content> |
||||
<mat-card-footer> |
||||
<button mat-raised-button (click)="repondreALaDemande(etatDemande.Validee)" color="primary">Accepter la demande</button> |
||||
<button mat-raised-button (click)="repondreALaDemande(etatDemande.Rejetee)" color="warn">Refuser la demande</button> |
||||
</mat-card-footer> |
||||
</mat-card> |
@ -1,15 +1,117 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { i18nMetaToJSDoc } from '@angular/compiler/src/render3/view/i18n/meta'; |
||||
import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'; |
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { DemandeDelegationDTO, DemandeEPIDTO, EtatDemande } from '@shared/api-swagger'; |
||||
import { BrowserStack } from 'protractor/built/driverProviders'; |
||||
import { Subscription } from 'rxjs'; |
||||
|
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher les détails d'une demande de délégation |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-demande-delegation', |
||||
templateUrl: './demande-delegation.component.html' |
||||
}) |
||||
export class DemandeDelegationComponent implements OnInit { |
||||
@Input() demandeDelegation: DemandeDelegationDTO; |
||||
@Output() eventEmitter: EventEmitter<any> = new EventEmitter<any>(); |
||||
etatDemande: any = EtatDemande; |
||||
|
||||
dialogSubscription: Subscription; |
||||
|
||||
|
||||
|
||||
constructor() {} |
||||
|
||||
|
||||
constructor(private matDialog: MatDialog) {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
accepter() { |
||||
this.repondreALaDemande(EtatDemande.Validee); |
||||
} |
||||
|
||||
|
||||
repondreALaDemande(etatDemande: EtatDemande) { |
||||
const data : any = { |
||||
etatDemande : etatDemande, |
||||
demandeDelegation : this.demandeDelegation |
||||
}; |
||||
const dialogRef: MatDialogRef<DialogReponseDemandeDelegation> = this.matDialog.open(DialogReponseDemandeDelegation, {data: data}) |
||||
|
||||
this.dialogSubscription = dialogRef.afterClosed().subscribe( |
||||
reponse => { |
||||
if(reponse.engistree) { |
||||
this.eventEmitter.emit(reponse.demandeDelegation); |
||||
} |
||||
} |
||||
); |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.dialogSubscription != undefined) { |
||||
this.dialogSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Component({ |
||||
selector: "dialog-reponse-demande-delegation", |
||||
templateUrl: "./dialog-reponse-demande-delegation.html" |
||||
}) |
||||
export class DialogReponseDemandeDelegation { |
||||
|
||||
/** |
||||
* Texte à afficher lors de la réponse à une demande de délégation. Le texte dépend de si la demande va être acceptée ou bien refusée. |
||||
*/ |
||||
texte: string =""; |
||||
|
||||
/** |
||||
* Indique si la réponse est un refus. |
||||
*/ |
||||
estRefus: boolean = false; |
||||
|
||||
raisonRefus: string; |
||||
|
||||
/** |
||||
* Contient l'information indiquant si la réponse a été validé et doit être enregistré ou non et la demande de délégation cible. |
||||
*/ |
||||
reponse: any = { |
||||
engistree: false |
||||
} |
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data, private dialogRef: MatDialogRef<DialogReponseDemandeDelegation>) {
|
||||
switch(data.etatDemande) { |
||||
case EtatDemande.Validee: |
||||
this.texte = "Souhaitez-vous vraiment accepter la demande de délégation et devenir le nouveau référent de l'EP ?"; |
||||
break; |
||||
case EtatDemande.Rejetee: |
||||
this.texte = "Souhaitez-vous vraiment refuser la demande de délégation ?"; |
||||
this.estRefus = true; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
enregistrer() { |
||||
if(this.estRefus && this.raisonRefus == "") |
||||
return; |
||||
let demandeDelegation: DemandeDelegationDTO = this.data.demandeDelegation; |
||||
demandeDelegation.etatDemande = this.data.etatDemande; |
||||
demandeDelegation.raisonRefus = this.raisonRefus; |
||||
this.reponse = { |
||||
engistree: true, |
||||
demandeDelegation: demandeDelegation |
||||
} |
||||
this.fermer(); |
||||
} |
||||
|
||||
|
||||
|
||||
fermer() { |
||||
this.dialogRef.close(this.reponse); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,9 @@ |
||||
<p>{{texte}}</p> |
||||
<div> |
||||
<mat-form-field *ngIf="estRefus" appearance="fill"> |
||||
<mat-label>Raison du refus</mat-label> |
||||
<textarea matInput [(ngModel)]="raisonRefus"></textarea> |
||||
</mat-form-field> |
||||
</div> |
||||
<button mat-raised-button (click)="enregistrer()" color="primary">Enregister la réponse</button> |
||||
<button mat-raised-button (click)="fermer()" color="warn">Annuler</button> |
@ -0,0 +1,4 @@ |
||||
<p>Votre réponse à la demande de délégation a bien été enregistrée</p> |
||||
|
||||
<button *ngIf="data.acceptee" (click)="fermer()" [routerLink]="['/ep', data.ep.id]" mat-raised-button>Accéder à l'EP</button> |
||||
<button mat-raised-button (click)="fermer()">Fermer</button> |
@ -1,2 +1,3 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1>Liste des demandes de formation </h1> |
||||
<demandes-formation-table [displayedColumns]="displayedColumns" (eventEmitter)="afficherDetailDemandeFormation($event)"></demandes-formation-table> |
||||
|
@ -1,15 +1,28 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { DemandeFormationDTO } from '@shared/api-swagger'; |
||||
import { DialogDemandeFormationComponent } from './mat-dialog/dialog-demande-formation.component'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher la liste des demandes de formations |
||||
* Les RH pourront valider ou refuser les demandes |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-demandes-formation', |
||||
templateUrl: './demandes-formation.component.html' |
||||
}) |
||||
export class DemandesFormationComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
displayedColumns : string[] = ["businessunit", "collaborateur", "datedemande", "demanderh", "ep", "etat", "datereponse"];
|
||||
|
||||
constructor(private dialog: MatDialog) {} |
||||
|
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
afficherDetailDemandeFormation(demandeFormation: DemandeFormationDTO) { |
||||
const datas = { data: demandeFormation, width: "80%", height: '80%'}; |
||||
this.dialog.open(DialogDemandeFormationComponent, datas); |
||||
} |
||||
} |
||||
|
@ -1,32 +1,40 @@ |
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
||||
import { FormsModule } from '@angular/forms'; |
||||
import { RouterModule } from '@angular/router'; |
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
||||
|
||||
|
||||
import { NgModule } from "@angular/core"; |
||||
import { CommonModule } from "@angular/common"; |
||||
|
||||
import { MaterialModule } from "@shared/angular-material/angular-material.module"; |
||||
|
||||
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; |
||||
|
||||
import { DemandesFormationComponent } from './demandes-formation.component'; |
||||
import { DialogDemandeFormationComponent } from './mat-dialog/dialog-demande-formation.component'; |
||||
import { DemandeFormationComponent } from './details-demande-formation/demande-formation.component' |
||||
import { NewDemandeFormationComponent } from './new-demande-formation/new-demande-formation.component' |
||||
import { DemandesFormationsRoutingModule } from './demandes-formation.routing.module'; |
||||
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module"; |
||||
|
||||
/** |
||||
* Module demandes formation |
||||
*/ |
||||
@NgModule({ |
||||
declarations: [ DemandesFormationComponent, DemandeFormationComponent, |
||||
declarations: [ DemandesFormationComponent, DialogDemandeFormationComponent, DemandeFormationComponent, |
||||
NewDemandeFormationComponent |
||||
], |
||||
exports: [ |
||||
DemandesFormationComponent |
||||
], |
||||
imports: [ |
||||
CommonModule, |
||||
MaterialModule, |
||||
NavMenuModule, |
||||
DemandesFormationsRoutingModule, |
||||
RouterModule |
||||
MatTablesModule, |
||||
RouterModule, |
||||
FormsModule, |
||||
ReactiveFormsModule |
||||
], |
||||
}) |
||||
export class DemandesFormationModule {} |
||||
|
@ -0,0 +1,31 @@ |
||||
<h3>Détails de la demande</h3> |
||||
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/collaborateurs', collaborateur.id]"> Collaborateur: {{collaborateur.nom}} {{collaborateur.prenom}}</button></p> |
||||
<p> <button mat-stroked-button (click)="fermer()" [routerLink]="['/referents', referent.id]">Référent: {{referent.nom}} {{referent.prenom}}</button></p> |
||||
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/ep',ep.id]">Voir EP effectué le {{ ep.datePrevisionnelle | date: 'dd/MM/yyyy' }} </button></p> |
||||
<p>Libellé : {{ data.libelle}}</p> |
||||
<p>Description: {{ data.description }}</p> |
||||
<p>Demande RH: {{ afficherDemandeRH(data.demandeRH) }}</p> |
||||
<p>Date demande: {{ data.dateDemande | date: 'dd/MM/yyyy' }} </p> |
||||
<p>Etat : {{ afficherEtat(data.etatDemande) }}</p> |
||||
<p *ngIf="data.etatDemande == etatDemande.Rejetee"> Raison du refus : {{data.commentaireRefus}}</p> |
||||
<ng-container *ngIf="data.etatDemande == etatDemande.EnAttente"> |
||||
<button mat-raised-button (click)="repondre()">Répondre à la demande de formation</button> |
||||
<ng-container *ngIf="donnerReponse"> |
||||
<mat-slide-toggle [(ngModel)]="demandeValidee"> |
||||
Demande validée |
||||
</mat-slide-toggle> |
||||
|
||||
<div> |
||||
<mat-form-field *ngIf="!demandeValidee" appearance="fill"> |
||||
<mat-label>Raison du refus</mat-label> |
||||
<textarea matInput [(ngModel)]="commentaireRefus"></textarea> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
<button mat-raised-button (click)="updateDemandeFormation()">Valider le choix</button> |
||||
</ng-container> |
||||
|
||||
</ng-container> |
||||
<button mat-raised-button (click)="fermer()">Fermer</button> |
||||
|
||||
|
@ -0,0 +1,79 @@ |
||||
import { Component, Inject } from "@angular/core"; |
||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; |
||||
import { MatSnackBar } from "@angular/material/snack-bar"; |
||||
import { CollaborateurDTO, EpInformationDTO, DemandesFormationService, DemandeFormationDTO, EtatDemande, afficherEtatDemande } from "@shared/api-swagger"; |
||||
import { Subscription } from "rxjs"; |
||||
|
||||
|
||||
@Component( { |
||||
selector: "dialog-demande-formation", |
||||
templateUrl: "dialog-demande-formation.component.html" |
||||
}) |
||||
export class DialogDemandeFormationComponent { |
||||
ep: EpInformationDTO; |
||||
collaborateur: CollaborateurDTO; |
||||
referent: CollaborateurDTO; |
||||
etatDemande: any = EtatDemande; |
||||
engagementsSubscription: Subscription; |
||||
|
||||
donnerReponse: boolean = false; |
||||
commentaireRefus : string = ""; |
||||
demandeValidee: boolean = true; |
||||
|
||||
|
||||
constructor(private dialogRef : MatDialogRef<DialogDemandeFormationComponent>, @Inject(MAT_DIALOG_DATA) public data : DemandeFormationDTO, private demandesFormationService: DemandesFormationService, |
||||
private snackBar: MatSnackBar){ |
||||
this.ep = data.ep; |
||||
this.collaborateur = data.ep.collaborateur; |
||||
this.referent = data.ep.referent; |
||||
} |
||||
|
||||
updateDemandeFormation() { |
||||
let demandeFormation : DemandeFormationDTO = this.data; |
||||
if(this.demandeValidee) { |
||||
demandeFormation.etatDemande = EtatDemande.Validee; |
||||
} |
||||
else { |
||||
if(this.commentaireRefus.length == 0) { |
||||
this.snackBar.open("Vous devez justifier le refus de la demande de formation.", "Attention", { |
||||
duration: 5000, |
||||
horizontalPosition: "center", |
||||
verticalPosition: "top", |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
demandeFormation.commentaireRefus = this.commentaireRefus; |
||||
demandeFormation.etatDemande = EtatDemande.Rejetee;
|
||||
} |
||||
this.engagementsSubscription = this.demandesFormationService.updateDemandeFormation(demandeFormation, demandeFormation.id).subscribe( |
||||
() => location.reload(), |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
afficherDemandeRH(demandeRH: boolean) { |
||||
if (demandeRH) |
||||
return 'Oui'; |
||||
else
|
||||
return 'Non' |
||||
} |
||||
|
||||
afficherEtat(etat: EtatDemande) { |
||||
return afficherEtatDemande(etat); |
||||
} |
||||
|
||||
fermer() { |
||||
this.dialogRef.close(); |
||||
} |
||||
|
||||
repondre() { |
||||
this.donnerReponse = true; |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.engagementsSubscription != null) { |
||||
this.engagementsSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
@ -1,2 +1,35 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1> Nouvelle demande de formation </h1> |
||||
|
||||
|
||||
<!-- Le formulaire --> |
||||
<form [formGroup]="demandeFormationForm" (ngSubmit)="ajouterDemandeFormation()"> |
||||
<div> |
||||
<!-- Attribut : libelle --> |
||||
<mat-form-field class="input"> |
||||
<input matInput placeholder="Libellé" formControlName="libelle"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div> |
||||
<!-- Attribut : description --> |
||||
<mat-form-field class="input"> |
||||
<input matInput placeholder="Description" formControlName="description"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div> |
||||
<!-- Attribut : origine --> |
||||
<mat-form-field class="input"> |
||||
<mat-label>Origine de la demande</mat-label> |
||||
<mat-select formControlName="origine"> |
||||
<mat-option *ngFor="let o of originesDemandeFormation" [value]="o">{{o.libelle}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
|
||||
<div> |
||||
<button mat-raised-button>Ajouter une demande de formation</button> |
||||
</div> |
||||
</form> |
@ -1,15 +1,80 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Observable, Subscription } from 'rxjs'; |
||||
import { Router } from '@angular/router'; |
||||
import { FormBuilder, FormGroup, FormControl, } from '@angular/forms'; |
||||
|
||||
import { OrigineDemandeFormationDTO, EtatDemande } from "@shared/api-swagger/model/models"; |
||||
|
||||
import { DemandesFormationService } from "@shared/api-swagger/api/api"; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant qui sert à créer une demande de formation pour un collaborateur. |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-new-demande-formation', |
||||
templateUrl: './new-demande-formation.component.html' |
||||
templateUrl: './new-demande-formation.component.html', |
||||
styleUrls: ['./new-demande-formation.component.scss'] |
||||
}) |
||||
export class NewDemandeFormationComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
/** |
||||
* Observable pour enregistrer la nouvelle formation |
||||
*/ |
||||
demandeFormationSubscription: Subscription; |
||||
/** |
||||
* Observable pour récupérer la liste des origines formation |
||||
*/ |
||||
origineDemandeSubscription: Subscription; |
||||
|
||||
|
||||
/** |
||||
* Liste des origines de demande de formation à faire afficher dans une liste déroulante. |
||||
*/ |
||||
originesDemandeFormation: OrigineDemandeFormationDTO[]; |
||||
|
||||
/** |
||||
* FormBuilder qui sera lié au formulaire du template avec les attributs d'une formation |
||||
* C'est dans cet objet qu'est stockée la nouvelle formation |
||||
*/ |
||||
demandeFormationForm = this.fb.group( |
||||
{ |
||||
id:[0], |
||||
libelle: [""], |
||||
description: [], |
||||
demandeRH: [true], |
||||
dateDemande: [new Date()], |
||||
etatDemande: [EtatDemande.EnAttente], |
||||
origine: [""], |
||||
collaborateur: [""],
|
||||
} |
||||
); |
||||
|
||||
constructor(private fb: FormBuilder, private demandesFormationService: DemandesFormationService, private router: Router) { } |
||||
|
||||
ngOnInit() { |
||||
|
||||
this.origineDemandeSubscription = this.demandesFormationService.getOriginesDemandeFormation().subscribe( |
||||
originesDemandeFormation => this.originesDemandeFormation = originesDemandeFormation, |
||||
err => console.log(err) |
||||
);
|
||||
} |
||||
|
||||
ajouterDemandeFormation() { |
||||
this.demandeFormationSubscription = this.demandesFormationService.addDemandeFormation(this.demandeFormationForm.getRawValue()).subscribe( |
||||
response => { |
||||
console.log(response); |
||||
this.router.navigate(['/demandesformation',response["id"]]); |
||||
} |
||||
); |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.demandeFormationSubscription != undefined) { |
||||
this.demandeFormationSubscription.unsubscribe(); |
||||
} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
if(this.origineDemandeSubscription != undefined) { |
||||
this.origineDemandeSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,30 @@ |
||||
<h3>Détails de l'engagement</h3> |
||||
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/collaborateurs', collaborateur.id]"> Collaborateur: {{collaborateur.nom}} {{collaborateur.prenom}}</button></p> |
||||
<p> <button mat-stroked-button (click)="fermer()" [routerLink]="['/referents', referent.id]">Référent: {{referent.nom}} {{referent.prenom}}</button></p> |
||||
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/ep',ep.id]">Voir EP effectué le {{ ep.datePrevisionnelle | date: 'dd/MM/yyyy' }} </button></p> |
||||
<p>Action : {{ data.action}}</p> |
||||
<p>Modalité: {{ data.modalite }}</p> |
||||
<p>Date limite: {{ data.dateLimite | date: 'dd/MM/yyyy' }} </p> |
||||
<p>Etat : {{ afficherEtat(data.etatEngagement) }}</p> |
||||
<p *ngIf="data.etatEngagement == etatEngagement.NonRealisable"> Raison non réalisable : {{data.raisonNonRealisable}}</p> |
||||
<ng-container *ngIf="data.etatEngagement == etatEngagement.EnAttente"> |
||||
<button mat-raised-button (click)="repondre()">Répondre à l'engagement</button> |
||||
<ng-container *ngIf="donnerReponse"> |
||||
<mat-slide-toggle [(ngModel)]="engagementRespecte"> |
||||
Engagement respecté |
||||
</mat-slide-toggle> |
||||
|
||||
<div> |
||||
<mat-form-field *ngIf="!engagementRespecte" appearance="fill"> |
||||
<mat-label>Raison du refus</mat-label> |
||||
<textarea matInput [(ngModel)]="raisonRefus"></textarea> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
<button mat-raised-button (click)="mettreAJourEngagement()">Valider le choix</button> |
||||
</ng-container> |
||||
|
||||
</ng-container> |
||||
<button mat-raised-button (click)="fermer()">Fermer</button> |
||||
|
||||
|
@ -0,0 +1,94 @@ |
||||
import { Component, Inject } from "@angular/core"; |
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; |
||||
import { MatSnackBar } from "@angular/material/snack-bar"; |
||||
import { CollaborateurDTO, EngagementDTO, EngagementsService, EpInformationDTO, EtatEngagement, afficherEtatEngagement } from "@shared/api-swagger"; |
||||
import { Subscription } from "rxjs"; |
||||
|
||||
/** |
||||
* Composant pour afficher la liste des engagements EP |
||||
*/ |
||||
@Component({ |
||||
selector: "app-engagements", |
||||
templateUrl: "./engagements.html" |
||||
}) |
||||
export class EngagementsComponent { |
||||
|
||||
displayedColumns : string[] = ["businessunit", "collaborateur", "action", "dispositif", "modalite", "datelimite", "etat"];
|
||||
constructor(private dialog: MatDialog) {} |
||||
|
||||
afficherDetailsEngagements(engagement: EngagementDTO) { |
||||
const datas = { data: engagement, width: "80%", height: '80%'}; |
||||
this.dialog.open(DialogEngagementsComponent, datas); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Dialog pour afficher les détails d'un engagement et y donner une réponse si possible |
||||
*/ |
||||
@Component( { |
||||
selector: "dialog-engagements", |
||||
templateUrl: "dialog-engagements.html" |
||||
}) |
||||
export class DialogEngagementsComponent { |
||||
ep: EpInformationDTO; |
||||
collaborateur: CollaborateurDTO; |
||||
referent: CollaborateurDTO; |
||||
etatEngagement: any = EtatEngagement; |
||||
engagementsSubscription: Subscription; |
||||
|
||||
/** |
||||
* Indique si l'on souhaite donner une réponse à l'engagement encore en cours ou non |
||||
*/ |
||||
donnerReponse: boolean = false; |
||||
raisonRefus : string = ""; |
||||
engagementRespecte: boolean = true; |
||||
|
||||
|
||||
constructor(private dialogRef : MatDialogRef<DialogEngagementsComponent>, @Inject(MAT_DIALOG_DATA) public data : EngagementDTO, private engagementsService: EngagementsService, |
||||
private snackBar: MatSnackBar){ |
||||
this.ep = data.ep; |
||||
this.collaborateur = data.ep.collaborateur; |
||||
this.referent = data.ep.referent; |
||||
} |
||||
|
||||
mettreAJourEngagement() { |
||||
let engagement : EngagementDTO = this.data; |
||||
if(this.engagementRespecte) { |
||||
engagement.etatEngagement = EtatEngagement.Respecte; |
||||
} |
||||
else { |
||||
if(this.raisonRefus.length == 0) { |
||||
this.snackBar.open("Vous devez justifier le refus de respecter l'engagement.", "Attention", { |
||||
duration: 5000, |
||||
horizontalPosition: "center", |
||||
verticalPosition: "top", |
||||
}); |
||||
return; |
||||
} |
||||
engagement.raisonNonRealisable = this.raisonRefus; |
||||
engagement.etatEngagement = EtatEngagement.NonRealisable;
|
||||
} |
||||
this.engagementsSubscription = this.engagementsService.updateEngagement(engagement, engagement.id).subscribe( |
||||
() => location.reload(), |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
afficherEtat(etat: EtatEngagement) { |
||||
return afficherEtatEngagement(etat); |
||||
} |
||||
|
||||
fermer() { |
||||
this.dialogRef.close(); |
||||
} |
||||
|
||||
repondre() { |
||||
this.donnerReponse = true; |
||||
} |
||||
|
||||
ngOnDestroy() { |
||||
if(this.engagementsSubscription != null) { |
||||
this.engagementsSubscription.unsubscribe(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
|
||||
<h2>Liste des engagements</h2> |
||||
|
||||
<engagements-table [displayedColumns]="displayedColumns" (eventEmitter)="afficherDetailsEngagements($event)"></engagements-table> |
@ -0,0 +1,30 @@ |
||||
import { NgModule } from "@angular/core"; |
||||
import { CommonModule } from "@angular/common"; |
||||
import { RouterModule } from '@angular/router'; |
||||
|
||||
import { MaterialModule } from "@shared/angular-material/angular-material.module"; |
||||
|
||||
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; |
||||
import { DialogEngagementsComponent, EngagementsComponent } from "./engagements.component"; |
||||
import { EngagementsRoutingModule } from "./engagements.routing.module"; |
||||
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module"; |
||||
import { FormsModule } from "@angular/forms"; |
||||
|
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [ |
||||
EngagementsComponent, DialogEngagementsComponent |
||||
], |
||||
exports: [], |
||||
imports: [ |
||||
CommonModule, |
||||
RouterModule,
|
||||
NavMenuModule, |
||||
EngagementsRoutingModule, |
||||
MatTablesModule, |
||||
MaterialModule,
|
||||
FormsModule |
||||
], |
||||
}) |
||||
export class EngagementsModule {} |
@ -0,0 +1,19 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
|
||||
|
||||
import { EngagementsComponent } from "./engagements.component"; |
||||
|
||||
import { AuthGuard } from '@shared/auth/auth.guard'; |
||||
|
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: '', component: EngagementsComponent, pathMatch: 'full', canActivate: [AuthGuard]} |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class EngagementsRoutingModule {} |
@ -0,0 +1,2 @@ |
||||
export * from './engagements.component'; |
||||
export * from './engagements.module'; |
@ -0,0 +1,97 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<div *ngIf="ep!=undefined" class="detailsep"> |
||||
<p> Collaborateur : {{ep.collaborateur.nom}} {{ep.collaborateur.prenom}} ({{ep.collaborateur.businessUnit.nom}}) <button mat-stroked-button [routerLink]="['/collaborateurs',ep.collaborateur.id]">Accéder au détails collaborateur</button></p> |
||||
<p> Référent : {{ep.referent.nom}} {{ep.referent.prenom}} </p> |
||||
<p> Entretien le : {{ep.datePrevisionnelle | date: 'dd/MM/yyyy'}}</p> |
||||
<p> Statut : {{afficherTypeEP(ep.statut)}}</p> |
||||
|
||||
<button mat-raised-button color="primary" title="Valider le déroulement de l'entretien">Valider entretien</button> |
||||
|
||||
<button mat-raised-button color="primary" title="Signer l'EP">Signer</button> |
||||
|
||||
<mat-tab-group mat-align-tabs="start"> |
||||
<mat-tab label="Les objectifs"> |
||||
<ep-objectifs [ep]="ep"></ep-objectifs> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="La saisie"> |
||||
|
||||
<mat-vertical-stepper class="saisie" linear #stepper> |
||||
<mat-step label="Mission/Projet" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
<mat-step label="Compétences générales" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
<mat-step label="Compétences techniques" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
<mat-step label="Apside" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
|
||||
<mat-step label="Demande d'augmentation salaire" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
<mat-step label="Formation effectuée" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
<mat-step label="Evolution du collaborateur" completed="true"> |
||||
|
||||
</mat-step> |
||||
|
||||
</mat-vertical-stepper> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="Les engagements" *ngIf="afficherDemandesFormationEtEngagements()"> |
||||
<ep-engagements [engagements]="ep.engagements"></ep-engagements> |
||||
</mat-tab> |
||||
<mat-tab label="Les demandes de formation" *ngIf="afficherDemandesFormationEtEngagements()"> |
||||
<ep-demandes-formation [demandesFormation]="ep.demandesFormation"></ep-demandes-formation> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="Commentaire assistant"> |
||||
<ep-commentaires-assistant [ep]="ep" [collaborateurConnecte]="collaborateurConnecte"></ep-commentaires-assistant> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="Choix de dates" *ngIf="afficherChoixDates()" > |
||||
<ep-choix-date [rdvsEntretien]="ep.propositionsEntretien"></ep-choix-date> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="Proposition de date" *ngIf="epNonEffectue()"> |
||||
<ep-propositions-dates [choixTypeEntretien]="ep.choixTypeEntretien"></ep-propositions-dates> |
||||
</mat-tab> |
||||
|
||||
<mat-tab label="Demande délégation" *ngIf="epNonEffectue()"> |
||||
<ep-demande-delegation [demande]="ep.demandesDelegation"></ep-demande-delegation> |
||||
</mat-tab> |
||||
<mat-tab label="Les participants"> |
||||
<ep-participants [ep]="ep"></ep-participants> |
||||
</mat-tab> |
||||
|
||||
</mat-tab-group> |
||||
</div> |
||||
<ng-container *ngIf="ep==undefined"> |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
<!-- |
||||
|
||||
<ng-container *ngIf="ep == undefined" > |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="ep != undefined"> |
||||
<p> Collaborateur : {{ep.collaborateur.nom + " " + ep.collaborateur.prenom}}</p> |
||||
<p *ngIf="ep.referent != undefined"> Référent : {{ep.referent.nom + " " + ep.referent.prenom}}</p> |
||||
<p *ngIf="ep.referent == undefined"> Aucun référent pour </p> |
||||
<p> Entretien le : {{ep.datePrevisionnelle }}</p> |
||||
|
||||
|
||||
</ng-container> |
||||
--> |
@ -0,0 +1,4 @@ |
||||
/*.saisie { |
||||
overflow-y: scroll; |
||||
height: 100%; |
||||
}*/ |
@ -0,0 +1,72 @@ |
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { ActivatedRoute } from "@angular/router"; |
||||
import { affichageStatut, EpDTO, EpService, StatutEp, estEPEnCours, estEPSigne, estEPEnAttenteSignatureCollaborateur, estEPEffectue, CollaborateurDTO } from "@shared/api-swagger"; |
||||
import { AuthService } from "@shared/auth/auth.service"; |
||||
import { cles } from "@shared/utils/cles"; |
||||
import { Role } from "@shared/utils/roles"; |
||||
import { Subscription } from "rxjs"; |
||||
|
||||
/** |
||||
* Composant pour afficher les détails d'un EP |
||||
*/ |
||||
@Component({ |
||||
selector : "details-ep", |
||||
templateUrl: "./details-ep.component.html", |
||||
styleUrls: ["./details-ep.component.scss"] |
||||
}) |
||||
export class DetailsEPComponent implements OnInit { |
||||
|
||||
epSubscription : Subscription; |
||||
|
||||
idEp: any; |
||||
|
||||
role : Role; |
||||
roleUtilisateur: string; |
||||
|
||||
collaborateurConnecte : CollaborateurDTO; |
||||
|
||||
ep : EpDTO; |
||||
constructor(private epService : EpService, private route : ActivatedRoute, private authService: AuthService) { |
||||
this.roleUtilisateur = authService.firstRole; |
||||
} |
||||
|
||||
ngOnInit() { |
||||
this.idEp = this.route.snapshot.paramMap.get("id"); |
||||
this.epSubscription = this.epService.getEPById(this.idEp).subscribe( |
||||
ep => { |
||||
this.ep = ep; |
||||
console.log(this.ep); |
||||
}, |
||||
err => console.log(err)
|
||||
); |
||||
this.setCollaborateurConnecte(); |
||||
} |
||||
|
||||
setCollaborateurConnecte() { |
||||
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { |
||||
setTimeout( () => this.setCollaborateurConnecte(), 1000); |
||||
} |
||||
else { |
||||
this.collaborateurConnecte = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); |
||||
|
||||
} |
||||
} |
||||
|
||||
afficherDemandesFormationEtEngagements() { |
||||
return estEPSigne(this.ep.statut) || estEPEnAttenteSignatureCollaborateur(this.ep.statut); |
||||
} |
||||
|
||||
afficherTypeEP(statutEP: StatutEp) { |
||||
return affichageStatut(statutEP); |
||||
} |
||||
|
||||
|
||||
afficherChoixDates() { |
||||
return this.ep.statut == StatutEp.DatesProposees; |
||||
} |
||||
|
||||
epNonEffectue() { |
||||
return estEPEnCours(this.ep.statut) && !estEPEnAttenteSignatureCollaborateur(this.ep.statut) && !estEPEffectue(this.ep.statut); |
||||
} |
||||
|
||||
} |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant permettant de faire la demande d'augmentation de salaire |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-augmentation-salaire', |
||||
templateUrl: './ep-augmentation-salaire.component.html' |
@ -0,0 +1,8 @@ |
||||
<h3>Choisir une date</h3> |
||||
|
||||
<mat-radio-group class="radio-rdv" [(ngModel)]="choixRdv"> |
||||
<mat-radio-button *ngFor="let rdv of rdvsEntretien" [value]="rdv"> |
||||
{{rdv.typeEntretien.libelle}} le {{rdv.dateEntretien | date : 'dd/MM/yyyy à hh:mm'}} |
||||
</mat-radio-button> |
||||
</mat-radio-group> |
||||
<button mat-raised-button color="primary">Valider le choix</button> |
@ -0,0 +1,5 @@ |
||||
.radio-rdv { |
||||
display: flex; |
||||
flex-direction: column; |
||||
margin-bottom: 15px; |
||||
} |
@ -0,0 +1,16 @@ |
||||
import { Component, Input } from '@angular/core'; |
||||
import { RDVEntretienDTO } from '@shared/api-swagger'; |
||||
|
||||
/** |
||||
* Composant qui permet au collaborateur de faire un choix parmi les date proposées |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-choix-date', |
||||
templateUrl: './ep-choix-date.component.html', |
||||
styleUrls: ["ep-choix-date.component.scss"] |
||||
}) |
||||
export class EpChoixDateComponent { |
||||
@Input() rdvsEntretien : Array<RDVEntretienDTO>; |
||||
choixRdv : RDVEntretienDTO; |
||||
constructor() {} |
||||
} |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter
|
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-commentaire-referent', |
||||
templateUrl: './ep-commentaire-referent.component.html' |
@ -0,0 +1,12 @@ |
||||
<h3 *ngIf="nouveauCommentaire">Ajouter un commentaire</h3> |
||||
<h3 *ngIf="!nouveauCommentaire">Modifier un commentaire</h3> |
||||
|
||||
<div> |
||||
<mat-form-field appearance="fill"> |
||||
<mat-label>Commentaire</mat-label> |
||||
<textarea matInput [(ngModel)]="commentaire"></textarea> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<button mat-raised-button color="primary" (click)="enregistrer()">Enregister les modifications</button> |
||||
<button mat-raised-button color="warn" (click)="annuler()">Annuler</button> |
@ -0,0 +1,3 @@ |
||||
<p> Êtes-vous certain de vouloir supprimer votre commentaire ?</p> |
||||
<button mat-raised-button color="warn" (click)="valider(true)">Supprimer</button> |
||||
<button mat-raised-button color="primary" (click)="valider(false)">Annuler</button> |
@ -0,0 +1,31 @@ |
||||
<ng-container *ngIf="ep.commentairesAssistant == undefined || ep.commentairesAssistant.length == 0"> |
||||
Aucun commentaire assistant |
||||
</ng-container> |
||||
|
||||
<button mat-raised-button *ngIf="!aDejaCommente()" (click)="nouveauCommentaire()">Ajouter un commentaire</button> |
||||
|
||||
<ng-container *ngIf="ep.commentairesAssistant != undefined && ep.commentairesAssistant.length != 0"> |
||||
Liste des commentaires assistants : |
||||
<mat-card *ngFor="let commentaire of ep.commentairesAssistant"> |
||||
<p> |
||||
{{commentaire.assistant}} |
||||
<ng-container *ngIf="commentaire.idAssistant == collaborateurConnecte.id"> |
||||
<mat-icon (click)="modifierCommentaire(commentaire)">edit</mat-icon> |
||||
<mat-icon (click)="supprimerCommentaire(commentaire.id)">delete</mat-icon> |
||||
</ng-container> |
||||
</p> |
||||
<p>{{commentaire.commentaire}}</p> |
||||
|
||||
</mat-card> |
||||
<!-- |
||||
<ul> |
||||
<li *ngFor="let commentaire of ep.commentairesAssistant"> |
||||
<p>Assistant : {{commentaire.assistant}}</p> |
||||
<p>{{commentaire.commentaire}}</p> |
||||
</li> |
||||
</ul> |
||||
--> |
||||
</ng-container> |
||||
<mat-card> |
||||
|
||||
</mat-card> |
@ -0,0 +1,131 @@ |
||||
import { analyzeAndValidateNgModules } from '@angular/compiler'; |
||||
import { Component, Inject, Input } from '@angular/core'; |
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { CollaborateurDTO, CommentaireAssistantDTO, EpDTO } from '@shared/api-swagger'; |
||||
import { AuthService } from '@shared/auth/auth.service'; |
||||
import { Subscription } from 'rxjs'; |
||||
|
||||
/** |
||||
* Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-commentaires-assistant', |
||||
templateUrl: './ep-commentaires-assistant.component.html' |
||||
}) |
||||
export class EpCommentairesAssistantComponent { |
||||
|
||||
@Input() ep : EpDTO; |
||||
|
||||
@Input() collaborateurConnecte : CollaborateurDTO; |
||||
|
||||
dialogAjoutModificationSubscription : Subscription; |
||||
dialogSuppressionSubscription : Subscription; |
||||
|
||||
constructor(private matDialog: MatDialog) {} |
||||
|
||||
|
||||
aDejaCommente() { |
||||
return this.ep.commentairesAssistant != undefined && this.ep.commentairesAssistant.some( c => c.idAssistant == this.collaborateurConnecte.id); |
||||
} |
||||
|
||||
nouveauCommentaire() { |
||||
this.ouvrirSaisiCommentaire(undefined); |
||||
} |
||||
|
||||
modifierCommentaire(commentaire : CommentaireAssistantDTO) { |
||||
this.ouvrirSaisiCommentaire(commentaire); |
||||
} |
||||
|
||||
supprimerCommentaire(id : number) { |
||||
const dialogRef: MatDialogRef<DialogEPSupprimerCommentaireAssistant> = this.matDialog.open(DialogEPSupprimerCommentaireAssistant); |
||||
this.dialogSuppressionSubscription = dialogRef.afterClosed().subscribe( |
||||
reponse => { |
||||
if(reponse) |
||||
this.ep.commentairesAssistant = this.ep.commentairesAssistant.filter( c => c.id != id); |
||||
} |
||||
); |
||||
} |
||||
|
||||
ouvrirSaisiCommentaire(data?: any) { |
||||
const dialogRef: MatDialogRef<DialogEPAjouterCommentaireAssistant> = this.matDialog.open(DialogEPAjouterCommentaireAssistant, { data: data}); |
||||
this.dialogAjoutModificationSubscription = dialogRef.afterClosed().subscribe( |
||||
reponse => { |
||||
if(reponse != undefined && reponse.nouveauCommentaire) |
||||
this.ajouterCommentaire(reponse.commentaire); |
||||
} |
||||
); |
||||
} |
||||
|
||||
ajouterCommentaire(commentaire : CommentaireAssistantDTO) { |
||||
commentaire.idAssistant = this.collaborateurConnecte.id; |
||||
commentaire.assistant = this.collaborateurConnecte.nom + " " + this.collaborateurConnecte.prenom; |
||||
if(this.ep.commentairesAssistant == undefined) { |
||||
this.ep.commentairesAssistant = []; |
||||
} |
||||
this.ep.commentairesAssistant.push(commentaire); |
||||
} |
||||
|
||||
|
||||
ngOnDestroy() { |
||||
this.dialogAjoutModificationSubscription?.unsubscribe(); |
||||
this.dialogSuppressionSubscription?.unsubscribe(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Composant pour faire afficher un pop up pour l'ajout d'un commentaire assistant |
||||
*/ |
||||
@Component( { |
||||
selector: "dialog-ep-ajouter-commentaire", |
||||
templateUrl: "./dialog-ep-ajouter-commentaire-assistant.html" |
||||
}) |
||||
export class DialogEPAjouterCommentaireAssistant { |
||||
commentaire : string = ""; |
||||
nouveauCommentaire : boolean = true; |
||||
commentaireDTO : CommentaireAssistantDTO; |
||||
|
||||
constructor(private dialogRef : MatDialogRef<DialogEPAjouterCommentaireAssistant>, @Inject(MAT_DIALOG_DATA) public data: CommentaireAssistantDTO) { |
||||
if(data != undefined) { |
||||
this.commentaireDTO = data; |
||||
this.commentaire = this.commentaireDTO.commentaire; |
||||
this.nouveauCommentaire = false; |
||||
} |
||||
} |
||||
|
||||
enregistrer() { |
||||
if(this.nouveauCommentaire) { |
||||
this.commentaireDTO = { |
||||
idAssistant : "", |
||||
commentaire : this.commentaire |
||||
} |
||||
} |
||||
else { |
||||
this.commentaireDTO.commentaire = this.commentaire; |
||||
} |
||||
const reponse : any = { |
||||
nouveauCommentaire: this.nouveauCommentaire, |
||||
commentaire : this.commentaireDTO |
||||
} |
||||
this.dialogRef.close(reponse); |
||||
}
|
||||
|
||||
annuler() { |
||||
this.dialogRef.close(undefined); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Composant pour afficher un pop permettant la validation ou non de la suppression d'un commentaire |
||||
*/ |
||||
@Component( { |
||||
selector: "dialog-ep-supprimer-commentaire-assistant", |
||||
templateUrl: "./dialog-ep-supprimer-commentaire-assistant.html" |
||||
}) |
||||
export class DialogEPSupprimerCommentaireAssistant { |
||||
constructor( private dialogRef: MatDialogRef<DialogEPSupprimerCommentaireAssistant>) {} |
||||
|
||||
valider(reponse : boolean) { |
||||
this.dialogRef.close(reponse); |
||||
} |
||||
} |
||||
|
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Ce composant sert peut-ête à rien... |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-consultation', |
||||
templateUrl: './ep-consultation.component.html' |
@ -0,0 +1,15 @@ |
||||
<ng-container *ngIf="demande == undefined"> |
||||
<h3>Aucune demande de délégation en cours</h3> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="demande != undefined"> |
||||
<h3>Demande de délégation en cours :</h3> |
||||
<p> Receveur : {{demande.referent.nom}} {{demande.referent.prenom}}</p> |
||||
<p> Date de la demande : {{demande.dateDemande | date: 'dd/MM/yyyy'}}</p> |
||||
<p> Raison de la demande : {{demande.raisonDemande }}</p> |
||||
<p> {{afficherEtatDemande(demande.etatDemande)}}</p> |
||||
<ng-container *ngIf="demande.etatDemande == etatDemande.Rejetee" > |
||||
<p> Date réponse : {{demande.dateReponse | date: 'dd/MM/yyyy'}}</p> |
||||
<p> Raison refus : {{demande.raisonRefus}} </p> |
||||
</ng-container> |
||||
</ng-container> |
@ -0,0 +1,22 @@ |
||||
import { Component, Input} from '@angular/core'; |
||||
import { AfficherEtatDemandeDelegation, DemandeDelegationDTO, EpDTO, EtatDemande } from '@shared/api-swagger'; |
||||
|
||||
/** |
||||
* Composant pour faire une demande de délégation et voir la dernière en cours |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-demande-delegation', |
||||
templateUrl: './ep-demande-delegation.component.html' |
||||
}) |
||||
export class EpDemandeDelegationComponent{ |
||||
|
||||
etatDemande : any = EtatDemande; |
||||
|
||||
@Input() demande: DemandeDelegationDTO; |
||||
constructor() {} |
||||
|
||||
afficherEtatDemande(etat: EtatDemande) { |
||||
return AfficherEtatDemandeDelegation(etat); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,2 @@ |
||||
<h3 *ngIf="demandesFormation == undefined || demandesFormation == []">Aucune demande de formation</h3> |
||||
<demandes-formation-table *ngIf="demandesFormation != undefined && demandesFormation.length != 0" [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [demandesFormation]="demandesFormation" ></demandes-formation-table> |
@ -0,0 +1,19 @@ |
||||
import { Component, Input } from '@angular/core'; |
||||
import { DemandeFormationDTO } from '@shared/api-swagger'; |
||||
|
||||
/** |
||||
* Composant pour ajouter et voir les demandes de formation |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-demandes-formation', |
||||
templateUrl: './ep-demandes-formation.component.html' |
||||
}) |
||||
export class EpDemandesFormationComponent { |
||||
@Input() demandesFormation : Array<DemandeFormationDTO>; |
||||
estAffichageEP : boolean = true; |
||||
displayedColumns : Array<string> = ["libelle", "description", "etat", "demanderh"]; |
||||
|
||||
constructor() {} |
||||
|
||||
|
||||
} |
@ -0,0 +1,8 @@ |
||||
<ng-container *ngIf="engagements == undefined || engagements.length == 0"> |
||||
<h3>Aucun engagements pris</h3> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="engagements != undefined && engagements.length != 0"> |
||||
<engagements-table [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [engagementsSaisis]="engagements"></engagements-table> |
||||
</ng-container> |
||||
|
@ -0,0 +1,15 @@ |
||||
import { Component, Input } from "@angular/core"; |
||||
import { EngagementDTO } from "@shared/api-swagger"; |
||||
|
||||
@Component({ |
||||
selector: "ep-engagements", |
||||
templateUrl: "./ep-engagements.component.html" |
||||
}) |
||||
export class EpEngagementsCompenent { |
||||
@Input()engagements : EngagementDTO[]; |
||||
|
||||
displayedColumns : string[] = ["action", "dispositif", "modalite", "datelimite", "etat"]; |
||||
estAffichageEP : boolean = true; |
||||
|
||||
constructor(){} |
||||
} |
@ -0,0 +1,21 @@ |
||||
<ng-container *ngIf="ep.objectifs != undefined && ep.objectifs != []"> |
||||
<h3>Nouveaux objectifs</h3> |
||||
<ul> |
||||
<li *ngFor= "let objectif of ep.objectifs; let index = index" > |
||||
Objectif {{index +1}} : {{objectif.libelle}} |
||||
|
||||
</li> |
||||
</ul> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="ep.objectifsPrecedent != undefined && ep.objectifsPrecedent != []"> |
||||
<h3>Objectifs précédents</h3> |
||||
<ul> |
||||
<li *ngFor= "let objectif of ep.objectifsPrecedent; let index = index"> |
||||
<p [ngClass]="objectif.statutObjectif"> Objectif {{index +1}} : {{objectif.libelle}} ({{afficherStatutObjectif(objectif.statutObjectif)}})</p> |
||||
<p *ngIf="objectif.commentaire != undefined && objectif.commentaire != ''"> Commentaire : {{objectif.commentaire}}</p> |
||||
</li> |
||||
</ul> |
||||
</ng-container> |
||||
|
||||
|
@ -0,0 +1,14 @@ |
||||
li { |
||||
margin-bottom: 1%; |
||||
} |
||||
.Atteint { |
||||
color: green |
||||
} |
||||
|
||||
.NonAtteint{ |
||||
color: red |
||||
} |
||||
|
||||
.Partiel { |
||||
color: orange |
||||
} |
@ -0,0 +1,19 @@ |
||||
import { Component, Input } from "@angular/core"; |
||||
import { afficherStatutObjectif, EpDTO, StatutObjectif } from "@shared/api-swagger"; |
||||
|
||||
|
||||
@Component({ |
||||
selector : "ep-objectifs", |
||||
templateUrl: "ep-objectifs.component.html", |
||||
styleUrls: ["ep-objectifs.component.scss"] |
||||
}) |
||||
export class EpObjectifsComponent { |
||||
|
||||
@Input() ep : EpDTO; |
||||
|
||||
constructor(){} |
||||
|
||||
afficherStatutObjectif(statut: StatutObjectif) { |
||||
return afficherStatutObjectif(statut); |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
<ng-container *ngIf="ep.participants == undefined || ep.participants == []"> |
||||
<h3> Aucun participant</h3> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="ep.participants != undefined && ep.participants != []"> |
||||
<ul> |
||||
<li *ngFor=" let participant of ep.participants"> |
||||
{{participant.participant}} |
||||
</li> |
||||
</ul> |
||||
</ng-container> |
@ -0,0 +1,16 @@ |
||||
import { Component, Input, OnInit } from '@angular/core'; |
||||
import { EpDTO } from '@shared/api-swagger'; |
||||
|
||||
/** |
||||
* Composant pour afficher la liste des participants de l'EP |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-participants', |
||||
templateUrl: './ep-participants.component.html' |
||||
}) |
||||
export class EpParticipantsComponent { |
||||
|
||||
@Input() ep : EpDTO; |
||||
|
||||
constructor() {} |
||||
} |
@ -0,0 +1,39 @@ |
||||
<h3>Proposer au moins une date</h3> |
||||
|
||||
<mat-chip-list> |
||||
Préférences du collaborateur : |
||||
<mat-chip *ngFor="let choix of choixTypeEntretien; let index = index"> |
||||
N°{{index+1}} {{choix.libelle}} |
||||
</mat-chip> |
||||
</mat-chip-list> |
||||
|
||||
<ng-container *ngIf="propositionsRdvEntretien.length != nbPropositionMax "> |
||||
<div> |
||||
<mat-form-field> |
||||
<input matInput [(ngModel)]="dateProposee" [ngxMatDatetimePicker]="dateProposeePicker" placeholder="Proposer une date" [min]="dateMin"> |
||||
<mat-datepicker-toggle matSuffix [for]="dateProposeePicker"> </mat-datepicker-toggle> |
||||
<ngx-mat-datetime-picker #dateProposeePicker></ngx-mat-datetime-picker> |
||||
</mat-form-field> |
||||
|
||||
<mat-form-field appearance="fill"> |
||||
<mat-label>Choisir le type d'entretien</mat-label> |
||||
<mat-select [(value)]="choixEntretien"> |
||||
<mat-option></mat-option> |
||||
<mat-option *ngFor="let choix of choixTypeEntretien; let index = index" [value]="choix">N°{{index+1}} {{choix.libelle}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<p *ngIf="choixEntretien != undefined">Choix : {{choixEntretien.libelle}}</p> |
||||
</div> |
||||
<div> |
||||
<button mat-raised-button (click)="enregistrerChoix()">Ajouter proposition</button> |
||||
</div> |
||||
</ng-container> |
||||
|
||||
<ul> |
||||
<li *ngFor="let proposition of propositionsRdvEntretien; let index = index"> |
||||
Proposition {{index+1}} : {{proposition.typeEntretien.libelle.toLowerCase()}} le {{proposition.dateEntretien | date : "dd/MM/yyyy à hh:mm"}} |
||||
<mat-icon (click)="annulerProposition(proposition)">delete</mat-icon> |
||||
</li> |
||||
</ul> |
||||
|
||||
<button mat-raised-button color="primary">Valider les dates proposés</button> |
@ -0,0 +1,42 @@ |
||||
import { Component, Input } from '@angular/core'; |
||||
import { RDVEntretienDTO, TypeEntretienDTO } from '@shared/api-swagger'; |
||||
|
||||
/** |
||||
* Composant permettant au référent de proposer ses dates d'EP à partir des préférences de lieu d'entretien du collaborateur |
||||
*/ |
||||
@Component({ |
||||
selector: 'ep-propositions-dates', |
||||
templateUrl: './ep-propositions-dates.component.html' |
||||
}) |
||||
export class EpPropositionsDatesComponent { |
||||
nbPropositionMax = 3; |
||||
dateMin: Date; |
||||
dateProposee: Date; |
||||
choixEntretien : TypeEntretienDTO; |
||||
|
||||
@Input() choixTypeEntretien : Array<TypeEntretienDTO>; |
||||
|
||||
propositionsRdvEntretien : Array<RDVEntretienDTO> = []; |
||||
constructor() { |
||||
this.dateMin = new Date(); |
||||
this.dateMin.setDate( this.dateMin.getDate() +1); |
||||
} |
||||
|
||||
enregistrerChoix() { |
||||
if(this.dateProposee != undefined && this.choixEntretien != undefined) { |
||||
let rdv : RDVEntretienDTO = { |
||||
dateEntretien : this.dateProposee, |
||||
typeEntretien : this.choixEntretien |
||||
}; |
||||
this.propositionsRdvEntretien.push(rdv); |
||||
this.dateProposee = undefined; |
||||
this.choixEntretien = undefined; |
||||
} |
||||
} |
||||
|
||||
annulerProposition(proposition:RDVEntretienDTO) { |
||||
this.propositionsRdvEntretien = this.propositionsRdvEntretien.filter( p => p!= proposition); |
||||
} |
||||
|
||||
|
||||
} |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour vérifier que la signature des deux parties |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-signature', |
||||
templateUrl: './ep-signature.component.html' |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher le document EPA des six ans |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-epa-six-ans', |
||||
templateUrl: './epa-six-ans.component.html' |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher le document EPA |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-epa', |
||||
templateUrl: './epa.component.html' |
@ -1,7 +1,8 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
* Composant pour faire afficher le document EPS |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-eps', |
||||
templateUrl: './eps.component.html' |
@ -1 +0,0 @@ |
||||
<h1>Consultation choix date</h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-choix-date', |
||||
templateUrl: './ep-choix-date.component.html' |
||||
}) |
||||
export class EpChoixDateComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
@ -1 +0,0 @@ |
||||
<h1>Consultation commentaire assistant</h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-commentaire-assistant', |
||||
templateUrl: './ep-commentaire-assistant.component.html' |
||||
}) |
||||
export class EpCommentaireAssistantComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
@ -1 +0,0 @@ |
||||
<h1>Consultation demande delegation</h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-demande-delegation', |
||||
templateUrl: './ep-demande-delegation.component.html' |
||||
}) |
||||
export class EpDemandeDelegationComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
@ -1 +0,0 @@ |
||||
<h1>Consultation demandes formation</h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-demandes-formation', |
||||
templateUrl: './ep-demandes-formation.component.html' |
||||
}) |
||||
export class EpDemandesFormationComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
@ -1 +0,0 @@ |
||||
<h1>Consultation participants </h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-ep-participants', |
||||
templateUrl: './ep-participants.component.html' |
||||
}) |
||||
export class EpParticipantsComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
@ -1,2 +0,0 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1>New participant </h1> |
@ -1,15 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
/** |
||||
*/ |
||||
@Component({ |
||||
selector: 'app-new-participant', |
||||
templateUrl: './new-participant.component.html' |
||||
}) |
||||
export class NewParticipantComponent implements OnInit { |
||||
|
||||
constructor() {} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue