From c0097aac86819295c7ecb6da798473c017e31ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Fri, 5 Mar 2021 12:30:56 +0100 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=20de=20commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collaborateur-routing.module.ts | 0 .../collaborateurs.component.ts | 7 +++- .../collaborateurs/collaborateurs.module.ts | 4 +- .../collaborateurs.routing.module.ts | 3 -- .../details-collaborateur.component.html | 38 +------------------ .../details-collaborateur.component.ts | 3 +- .../demandes-delegation.component.ts | 12 ++++-- .../demande-delegation.component.ts | 37 ++++++++++++------ src/app/engagements/engagements.component.ts | 10 ++++- src/app/ep/details-ep/details-ep.component.ts | 3 ++ src/app/ep/ep-signes/ep-signes.component.ts | 7 +++- src/app/ep/ep.component.ts | 7 +++- .../edit-formation.component.ts | 3 +- src/app/formations/formations.component.ts | 3 +- .../new-formation/new-formation.component.ts | 2 +- .../details-note/details-note.component.ts | 7 +++- .../modifier-note/modifier-note.component.ts | 8 ++++ src/app/notes/notes.component.html | 4 +- src/app/notes/notes.component.ts | 30 ++++++++------- .../nouvelle-note/nouvelle-note.component.ts | 18 ++++++++- .../assignation-referent.component.html | 4 +- .../assignation-referent.component.ts | 27 ++++++++----- .../affichage-details-collaborateur.ts | 2 +- ...log-assignation-rapide-collaborateurs.html | 2 +- .../dialog-assignation-rapide.component.ts | 16 ++++---- .../prochain-ep/prochain-ep.component.html | 24 ++++++------ .../prochain-ep/prochain-ep.component.ts | 4 +- .../collaborateurs.table.html | 8 ++-- .../collaborateurs.table.ts | 27 +++++++------ .../engagements-table/engagements-table.html | 2 +- .../engagements-table/engagements-table.ts | 10 ++--- .../shared/mat-tables/ep-table/ep-table.html | 8 ++-- .../shared/mat-tables/ep-table/ep-table.ts | 20 +++++----- .../formations-table/formations.table.html | 4 +- .../formations-table/formations.table.ts | 18 ++++----- 35 files changed, 213 insertions(+), 169 deletions(-) delete mode 100644 src/app/collaborateurs/collaborateur-routing.module.ts diff --git a/src/app/collaborateurs/collaborateur-routing.module.ts b/src/app/collaborateurs/collaborateur-routing.module.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/collaborateurs/collaborateurs.component.ts b/src/app/collaborateurs/collaborateurs.component.ts index c9fddfd..a1ea1ef 100644 --- a/src/app/collaborateurs/collaborateurs.component.ts +++ b/src/app/collaborateurs/collaborateurs.component.ts @@ -6,8 +6,6 @@ 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', @@ -37,6 +35,11 @@ export class CollaborateursComponent { constructor(private router: Router) {} + /** + * 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": diff --git a/src/app/collaborateurs/collaborateurs.module.ts b/src/app/collaborateurs/collaborateurs.module.ts index 6ebb1a0..c0d69bd 100644 --- a/src/app/collaborateurs/collaborateurs.module.ts +++ b/src/app/collaborateurs/collaborateurs.module.ts @@ -17,9 +17,7 @@ import { MatTablesModule } from "@shared/mat-tables/mat-tables.module"; import { CollaborateursRoutingModule } from "./collaborateurs.routing.module"; import { AffichageDetailsCollaborateurModule } from "@shared/affichage-details-collaboarteur/affichage-details-collaborateur.module"; -/** - * Module collaborateur. - */ + @NgModule({ declarations: [ CollaborateursComponent, DetailsCollaborateurComponent, diff --git a/src/app/collaborateurs/collaborateurs.routing.module.ts b/src/app/collaborateurs/collaborateurs.routing.module.ts index e4eeb3f..48955fe 100644 --- a/src/app/collaborateurs/collaborateurs.routing.module.ts +++ b/src/app/collaborateurs/collaborateurs.routing.module.ts @@ -13,9 +13,6 @@ import { AuthGuard } from '../shared/auth/auth.guard'; import { Role } from '../shared/utils/roles'; -/** - * Routes du module collaborateur - */ const routes: Routes = [ { path:paths_collaborateurs.formations, component: FormationsCollaboateurComponent, canActivate: [AuthGuard] }, { path:paths_collaborateurs.evaluation, component: EvaluationComponent, canActivate: [AuthGuard] }, diff --git a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html index ae6883f..1058056 100644 --- a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html +++ b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html @@ -1,39 +1,3 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts index 5a40066..e26fe7d 100644 --- a/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts +++ b/src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts @@ -4,7 +4,7 @@ import {ActivatedRoute} from '@angular/router'; /** - * Composant pour gérer l'affichage des détails d'un collaborateur et de ses EP + * Composant pour gérer l'affichage des détails d'un collaborateur avec ses formations et ses EP */ @Component({ selector: 'app-details-collaborateur', @@ -13,6 +13,7 @@ import {ActivatedRoute} from '@angular/router'; export class DetailsCollaborateurComponent { idCollaborateur: string; + constructor(private route: ActivatedRoute) { this.idCollaborateur = this.route.snapshot.paramMap.get('id'); } diff --git a/src/app/demandes-delegation/demandes-delegation.component.ts b/src/app/demandes-delegation/demandes-delegation.component.ts index 3b4b25c..6e5fb21 100644 --- a/src/app/demandes-delegation/demandes-delegation.component.ts +++ b/src/app/demandes-delegation/demandes-delegation.component.ts @@ -5,7 +5,8 @@ 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' @@ -25,12 +26,12 @@ export class DemandesDelegationComponent implements OnInit { ngOnInit() { - this.recupererIdCollaborateurConencte(); + this.setIdCollaborateurConnecte(); } - recupererIdCollaborateurConencte() { + setIdCollaborateurConnecte() { if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { - setTimeout( () => this.recupererIdCollaborateurConencte(), 1000); + setTimeout( () => this.setIdCollaborateurConnecte(), 1000); } else { const collaborateurConnecte: CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); @@ -39,6 +40,9 @@ export class DemandesDelegationComponent implements OnInit { } } + /** + * 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( diff --git a/src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.ts b/src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.ts index 2a6aea0..4dd74a8 100644 --- a/src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.ts +++ b/src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.ts @@ -7,7 +7,8 @@ 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' @@ -62,9 +63,21 @@ export class DemandeDelegationComponent implements OnInit { }) 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 } @@ -81,18 +94,18 @@ export class DialogReponseDemandeDelegation { } } -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 + 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(); } - this.fermer(); -} diff --git a/src/app/engagements/engagements.component.ts b/src/app/engagements/engagements.component.ts index d139521..ccb2a55 100644 --- a/src/app/engagements/engagements.component.ts +++ b/src/app/engagements/engagements.component.ts @@ -4,7 +4,9 @@ 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" @@ -20,6 +22,9 @@ export class EngagementsComponent { } } +/** + * 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" @@ -31,6 +36,9 @@ export class DialogEngagementsComponent { 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; diff --git a/src/app/ep/details-ep/details-ep.component.ts b/src/app/ep/details-ep/details-ep.component.ts index 4c0d0c9..73fb2e3 100644 --- a/src/app/ep/details-ep/details-ep.component.ts +++ b/src/app/ep/details-ep/details-ep.component.ts @@ -5,6 +5,9 @@ import { AuthService } from "@shared/auth/auth.service"; 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", diff --git a/src/app/ep/ep-signes/ep-signes.component.ts b/src/app/ep/ep-signes/ep-signes.component.ts index 1cc84ca..0e197b4 100644 --- a/src/app/ep/ep-signes/ep-signes.component.ts +++ b/src/app/ep/ep-signes/ep-signes.component.ts @@ -3,7 +3,7 @@ import { Router } from '@angular/router'; import { epTypeRecherche } from '@shared/utils/cles'; /** - * Composant qui permet la consultation de la liste des EP signés collaborateur + * Composant qui permet la consultation de la liste des EP signés */ @Component({ selector: 'app-ep-signes', @@ -17,6 +17,11 @@ export class EpSignesComponent { constructor(private router: Router){} + /** + * Evènement permettant de choisir si l'on souhaite ouvrir les détails du collaborateur, du référent ou bien de l'EP + * + * @param event Evènement reçu par le composant enfant, contient le type de l'évènement (référent, ep, collaborateur) et les données ep + */ eventEmitter(event: any) { switch(event.type) { case "collaborateur": diff --git a/src/app/ep/ep.component.ts b/src/app/ep/ep.component.ts index f6baab8..f0ad9aa 100644 --- a/src/app/ep/ep.component.ts +++ b/src/app/ep/ep.component.ts @@ -6,7 +6,9 @@ import { cles, epTypeRecherche } from '@shared/utils/cles'; import { Role } from '@shared/utils/roles'; - +/** + * Composant pour faire afficher les EP signés, référent et participants du connecté + */ @Component({ selector: 'app-ep', templateUrl: './ep.component.html' @@ -36,6 +38,7 @@ export class EpComponent implements OnInit { this.setIdCollaborateur(); } + setIdCollaborateur() { if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) { setTimeout( () => this.setIdCollaborateur(), 1000); @@ -47,7 +50,7 @@ export class EpComponent implements OnInit { } - ouvrirEP(event) { + ouvrirEP(event : any) { if(event.type == "ep") this.router.navigate(["/ep", event.ep.id]); } diff --git a/src/app/formations/edit-formation/edit-formation.component.ts b/src/app/formations/edit-formation/edit-formation.component.ts index 3a7fb34..8a3dbbb 100644 --- a/src/app/formations/edit-formation/edit-formation.component.ts +++ b/src/app/formations/edit-formation/edit-formation.component.ts @@ -14,7 +14,8 @@ import { FormationDTO, ModeFormationDTO, TypeFormationDTO, StatutFormationDTO, O import { FormationsService } from '@shared/api-swagger/api/api'; /** - */ + * Composant pour modifier une formation + */ @Component({ selector: 'app-edit-formation', templateUrl: './edit-formation.component.html', diff --git a/src/app/formations/formations.component.ts b/src/app/formations/formations.component.ts index bf31dcd..ac34711 100644 --- a/src/app/formations/formations.component.ts +++ b/src/app/formations/formations.component.ts @@ -1,7 +1,8 @@ import { Component } from '@angular/core'; /** - */ + * Composant pour faire afficher la liste des formations liées à l'agence du connecté + */ @Component({ selector: 'app-formations', templateUrl: './formations.component.html' diff --git a/src/app/formations/new-formation/new-formation.component.ts b/src/app/formations/new-formation/new-formation.component.ts index 2a6393d..3ec98a9 100644 --- a/src/app/formations/new-formation/new-formation.component.ts +++ b/src/app/formations/new-formation/new-formation.component.ts @@ -8,7 +8,7 @@ import { FormationDTO, ModeFormationDTO, TypeFormationDTO, StatutFormationDTO, O import { FormationsService } from "@shared/api-swagger/api/api"; /** - * Composant pour l'ajout d'une nouvelle formation + * Composant pour ajotuer une nouvelle formation */ @Component({ selector: 'app-new-formation', diff --git a/src/app/notes/details-note/details-note.component.ts b/src/app/notes/details-note/details-note.component.ts index af5d92f..38efc9d 100644 --- a/src/app/notes/details-note/details-note.component.ts +++ b/src/app/notes/details-note/details-note.component.ts @@ -4,7 +4,9 @@ import { ActivatedRoute, Router } from "@angular/router"; import { DetailsNoteDTO, NotesService } from "@shared/api-swagger"; import { Subscription } from "rxjs"; - +/** + * Composant pour faire afficher les détails d'une note d'un manager ou d'un RA + */ @Component({ selector: "app-details-note", templateUrl: "./details-note.component.html" @@ -27,6 +29,9 @@ export class DetailsNoteComponent implements OnInit{ } } + /** + * Permet d'ouvrir un popup pour effectuer la validation de la suppresion d'une note + */ supprimerNote() { this.dialog.open(DialogSuppressionNoteComponent, { data: this.note}) } diff --git a/src/app/notes/modifier-note/modifier-note.component.ts b/src/app/notes/modifier-note/modifier-note.component.ts index 0aae99f..a72dfe0 100644 --- a/src/app/notes/modifier-note/modifier-note.component.ts +++ b/src/app/notes/modifier-note/modifier-note.component.ts @@ -6,6 +6,10 @@ import { ActivatedRoute, Router } from "@angular/router"; import { CollaborateurDTO, DetailsNoteDTO, NotesService } from "@shared/api-swagger"; import { Subscription } from "rxjs"; + +/** + * Composant pour modifier une note + */ @Component({ selector: "modifier-note", templateUrl: "./modifier-note.component.html" @@ -14,6 +18,7 @@ export class ModifierNoteComponent implements OnInit{ chercherNoteSubscription: Subscription; + modifierNoteSubscription: Subscription; dialogSubscription: Subscription; @@ -22,6 +27,9 @@ export class ModifierNoteComponent implements OnInit{ id: any; + /** + * Form lié à la note qui devra être mise à jour + */ noteForm: FormGroup; constructor(private noteService: NotesService, private fb: FormBuilder, private router: Router, diff --git a/src/app/notes/notes.component.html b/src/app/notes/notes.component.html index 8fb8563..4d3610f 100644 --- a/src/app/notes/notes.component.html +++ b/src/app/notes/notes.component.html @@ -21,7 +21,7 @@ - + Collaborateur @@ -49,7 +49,7 @@ [pageIndex]="numPage-1" [pageSize]="parPage" [pageSizeOptions]="pageOption" - (page)="updatePageInfo($event)"> + (page)="updatePaginationTableau($event)"> diff --git a/src/app/notes/notes.component.ts b/src/app/notes/notes.component.ts index d7d459c..45750ce 100644 --- a/src/app/notes/notes.component.ts +++ b/src/app/notes/notes.component.ts @@ -28,7 +28,7 @@ export class NotesComponent implements OnInit { notesSubscriber: Subscription; notesCountSubscriber: Subscription; - id: string; + idCollaborateur: string; dataSource: MatTableDataSource; @@ -40,7 +40,7 @@ export class NotesComponent implements OnInit { setSearch() { this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } resetSearch() { @@ -49,40 +49,42 @@ export class NotesComponent implements OnInit { } ngOnInit() { - this.recupererId(); + this.setIdCollaborateur(); } - recupererId() { + setIdCollaborateur() { if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined){ - setTimeout( () => this.recupererId(), 1000); + setTimeout( () => this.setIdCollaborateur(), 1000); } else { const collaborateurConnecte : CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); - this.id = collaborateurConnecte.id; + this.idCollaborateur = collaborateurConnecte.id; this.chargement = false; - this.updateDataSource(); + this.updateDonneesTableau(); } } - updateDataSource() { - this.notesSubscriber = this.notesService.getNotesAuteur(this.id, this.asc, this.numPage, this.parPage, this.search, this.tri).subscribe( + updateDonneesTableau() { + this.notesSubscriber = this.notesService.getNotesAuteur(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri).subscribe( notes => { console.log(notes); this.dataSource = new MatTableDataSource(notes);}, err => console.log(err) ); - this.notesCountSubscriber = this.notesService.getNotesAuteurCount(this.id, this.asc, this.numPage, this.parPage, this.search, this.tri).subscribe( + this.notesCountSubscriber = this.notesService.getNotesAuteurCount(this.idCollaborateur, this.asc, this.numPage, this.parPage, this.search, this.tri).subscribe( count => this.taille = count, err => console.log(err) ); } - updatePageInfo(event){ + + updatePaginationTableau(event :any){ this.parPage = event.pageSize; this.numPage = event.pageIndex+1; - this.updateDataSource(); + this.updateDonneesTableau(); } - triTableau(e) { + + trierTableau(e :any) { this.tri = e.active; switch(e.direction) { case "asc": @@ -92,7 +94,7 @@ export class NotesComponent implements OnInit { this.asc = false; break; } - this.updateDataSource(); + this.updateDonneesTableau(); } diff --git a/src/app/notes/nouvelle-note/nouvelle-note.component.ts b/src/app/notes/nouvelle-note/nouvelle-note.component.ts index a9eacf4..bea0856 100644 --- a/src/app/notes/nouvelle-note/nouvelle-note.component.ts +++ b/src/app/notes/nouvelle-note/nouvelle-note.component.ts @@ -6,6 +6,8 @@ import { CollaborateurDTO, DetailsNoteDTO, NotesService } from "@shared/api-swag import { cles, collaborateurTypeRecherche } from "@shared/utils/cles"; import { Subscription } from "rxjs"; + + @Component({ selector: "nouvelle-note", templateUrl: "./nouvelle-note.component.html" @@ -18,6 +20,9 @@ export class NouvelleNoteComponent { collaborateurChoisi: CollaborateurDTO; + /** + * Form lié à la note à ajouter + */ noteForm = this.fb.group( { titre: [""], @@ -48,6 +53,9 @@ export class NouvelleNoteComponent { ); } + /** + * Permet d'ouvrir un popup qui va permettre de choisir le collaborateur lié à la note + */ choixCollaborateur() { const datas = { data: this.collaborateurChoisi, width: "80%", height: '80%'}; const dialogRef = this.dialog.open(DialogChoixCollaborateurNoteComponent, datas); @@ -89,12 +97,20 @@ export class DialogChoixCollaborateurNoteComponent { this.dialogRef.close(); } + + /** + * Enregister le choix du collaborateur de la note + */ enregistrerChoix() { if(this.collaborateurChoisi != undefined) { this.dialogRef.close(this.collaborateurChoisi); } } - + + /** + * Evènement permettant de mettre à jour le collaborateur de la note avec le collaborateur reçu par le composant enfant + * @param event Evènement reçu du composant enfant + */ choisirCollaborateur(event : any) { this.collaborateurChoisi = event.collaborateur; diff --git a/src/app/referents/assignation-referent/assignation-referent.component.html b/src/app/referents/assignation-referent/assignation-referent.component.html index 645b1e0..3527038 100644 --- a/src/app/referents/assignation-referent/assignation-referent.component.html +++ b/src/app/referents/assignation-referent/assignation-referent.component.html @@ -6,7 +6,7 @@

Veuillez sélectionner un référent

Référent sélectionné : {{referentChoisi.nom}} {{referentChoisi.prenom}}

- +
@@ -26,7 +26,7 @@
- + diff --git a/src/app/referents/assignation-referent/assignation-referent.component.ts b/src/app/referents/assignation-referent/assignation-referent.component.ts index 2d57ad3..329e64f 100644 --- a/src/app/referents/assignation-referent/assignation-referent.component.ts +++ b/src/app/referents/assignation-referent/assignation-referent.component.ts @@ -23,7 +23,6 @@ export class AssignationReferentComponent { referentChoisi : CollaborateurDTO = undefined; rolesReferents : string[] = ["Manager", "RA", "CP", "TL"]; - typeRechercheReferent: string = collaborateurTypeRecherche.referents; @@ -36,13 +35,13 @@ export class AssignationReferentComponent { collaborateursSelectionnes: CollaborateurDTO[] = []; /** - * Liste des colonnes du tableau à afficher pour les référents. - */ + * Liste des colonnes à afficher lors du choix du référent + */ displayedColumnsReferent : string[] = ["businessunit", "collaborateur"]; /** - * Liste des colonnes du tableau à afficher. - */ + * Liste des colonnes à afficher lors du choix des collaborateurs + */ displayedColumnsCollaborateurs : string[] = ["businessunit", "collaborateur", "datearrivee", "referent"]; collaborateurSubscription: Subscription; @@ -53,13 +52,17 @@ export class AssignationReferentComponent { private snackBar: MatSnackBar) { } - choixReferent(event: any) { + + selectionnerReferent(event: any) { console.log(event); this.referentChoisi = event.collaborateur; - this.setCollaborateurEP(); + this.setCollaborateursEP(); } - setCollaborateurEP() { + /** + * Récupérer la liste des collaborateurs EP du référent sélectionné + */ + setCollaborateursEP() { this.collaborateurSubscription = this.collaborateurService.getCollaborateursByReferent(this.referentChoisi.id).subscribe( collaborateurs => { this.collaborateursEP = collaborateurs; @@ -69,7 +72,12 @@ export class AssignationReferentComponent { ); } - ajoutCollaborateur(event:any) { + + /** + * Permet de sélectionner un collaborateur et de l'ajouter ou l'enlever de la liste des collaborateurs à ajouter si il n'est pas déjà un collaborateur EP du référent + * @param event contient le collaborateur qui a été récupéré + */ + selectionnerCollaborateur(event:any) { if(event.type != "collaborateur") return; if(event.collaborateur.id == this.referentChoisi.id) { @@ -95,6 +103,7 @@ export class AssignationReferentComponent { this.collaborateursSelectionnes = this.collaborateursSelectionnes.filter(c => c.id != collaborateur.id); } + mettreAJourReferentEP() { const referentEP :ReferentEPDTO = { idReferent: this.referentChoisi.id, diff --git a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts index 00d7745..8e5bd23 100644 --- a/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts +++ b/src/app/shared/affichage-details-collaboarteur/affichage-details-collaborateur.ts @@ -62,7 +62,7 @@ export class AffichageDetailsCollaborateurComponent implements OnInit{ } } - ouvrirEP(event) { + ouvrirEP(event :any) { if(event.type == "ep") this.router.navigate(["/ep", event.ep.id]); } diff --git a/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide-collaborateurs.html b/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide-collaborateurs.html index 17b30c6..62b2fac 100644 --- a/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide-collaborateurs.html +++ b/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide-collaborateurs.html @@ -14,4 +14,4 @@

Veuillez sélectionner au moins un collaborateur

- + diff --git a/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide.component.ts b/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide.component.ts index d319898..3212dba 100644 --- a/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide.component.ts +++ b/src/app/shared/affichage-details-collaboarteur/dialog-assignation-rapide/dialog-assignation-rapide.component.ts @@ -31,7 +31,7 @@ export class DialogAssignationRapideReferentComponent { this.referentChoisi = data.referent; } - selectionnerReferent(event) { + selectionnerReferent(event :any) { this.referentChoisi = event.collaborateur; } @@ -100,8 +100,11 @@ export class DialogAssignationRapideCollaborateursComponent implements OnInit{ ); } - - ajoutCollaborateur(event:any) { + /** + * Permet de sélectionner un collaborateur et de l'ajouter ou l'enlever de la liste des collaborateurs à ajouter si il n'est pas déjà un collaborateur EP du référent + * @param event contient le collaborateur qui a été récupéré + */ + selectionnerCollaborateur(event:any) { if(event.type != "collaborateur") return; if(event.collaborateur.id == this.data.id) { @@ -126,12 +129,7 @@ export class DialogAssignationRapideCollaborateursComponent implements OnInit{ enleverCollaborateur(collaborateur: CollaborateurDTO) { this.collaborateursSelectionnes = this.collaborateursSelectionnes.filter(c => c.id != collaborateur.id); } - - ajouterCollaborateur(event) { - if(event.type == "collaborateur") { - - } - } + mettreAJourReferentEP() { const referentEP : ReferentEPDTO = { diff --git a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html index aca3d0c..22529d9 100644 --- a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html +++ b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.html @@ -2,29 +2,29 @@ - +

Aucun prochain EP n'a été trouvé

- - -

Prochain {{ep.type}} disponible pour saisie le {{ ep.dateDisponibilite | date: "dd/MM/yyyy" }}

+ + +

Prochain {{prochainEP.type}} disponible pour saisie le {{ prochainEP.dateDisponibilite | date: "dd/MM/yyyy" }}

- -

{{ep.type}} : {{ afficherStatutEP(ep.statut) }}

-

Disponible depuis le {{ ep.dateDisponibilite | date : "dd/MM/yyyy" }}

-

Date d'entretien le {{ ep.datePrevisionnelle | date : "dd/MM/yyyy" }}

- -

Référent EP : {{ep.referent.nom}} {{ep.referent.prenom}}

+ +

{{prochainEP.type}} : {{ afficherStatutEP(prochainEP.statut) }}

+

Disponible depuis le {{ prochainEP.dateDisponibilite | date : "dd/MM/yyyy" }}

+

Date d'entretien le {{ prochainEP.datePrevisionnelle | date : "dd/MM/yyyy" }}

+ +

Référent EP : {{prochainEP.referent.nom}} {{prochainEP.referent.prenom}}

- +

Il n'y a actuellement aucun référent pour cet EP

- +
diff --git a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts index 379deb4..f9d586e 100644 --- a/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts +++ b/src/app/shared/affichage-details-collaboarteur/prochain-ep/prochain-ep.component.ts @@ -16,7 +16,7 @@ export class ProchainEpComponent implements OnInit { chargement: boolean = true; - ep : EpInformationDTO; + prochainEP : EpInformationDTO; epSubscription: Subscription; @@ -28,7 +28,7 @@ export class ProchainEpComponent implements OnInit { this.epSubscription = this.epService.getProchainEPCollaborateur(this.idCollaborateur).subscribe( ep => { console.log(ep); - this.ep = ep; + this.prochainEP = ep; this.chargement = false; }, err => { diff --git a/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.html b/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.html index f2543a0..1d86bfe 100644 --- a/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.html +++ b/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.html @@ -22,7 +22,7 @@ Date de début - + clear @@ -31,7 +31,7 @@ Date de fin - + clear @@ -46,7 +46,7 @@ - + Agence {{ row.businessUnit.nom }} @@ -79,7 +79,7 @@ [pageIndex]="numPage-1" [pageSize]="parPage" [pageSizeOptions]="pageOption" - (page)="updatePageInfo($event)"> + (page)="updatePaginationTableau($event)">
\ No newline at end of file diff --git a/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.ts b/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.ts index ee38876..94188a3 100644 --- a/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.ts +++ b/src/app/shared/mat-tables/collaborateurs-table/collaborateurs.table.ts @@ -160,7 +160,7 @@ export class CollaborateursTableComponent implements OnInit { * Mettre à jour les informations à afficher dans la tableau. * Devra se faire à l'ouverture de la page, au changement de page ou du nombre d'éléments à afficher, au moment d'un tri ou encore lors de l'utilisation de la barre de recherche. */ - updateDataSource() { + updateDonneesTableau() { switch(this.typeRecherche) { case collaborateurTypeRecherche.collaborateurs: case collaborateurTypeRecherche.referents: @@ -215,17 +215,17 @@ export class CollaborateursTableComponent implements OnInit { this.dateDebut = undefined; if(val == 2) this.dateFin = undefined; - this.updateDataSource(); + this.updateDonneesTableau(); } /** * Mettre à jour le nomre d'élément à afficher par page et le numéro de la page * @param event évènement de la pagination */ - updatePageInfo(event){ + updatePaginationTableau(event){ this.parPage = event.pageSize; this.numPage = event.pageIndex+1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -233,7 +233,7 @@ export class CollaborateursTableComponent implements OnInit { */ setSearch() { this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } @@ -250,7 +250,7 @@ export class CollaborateursTableComponent implements OnInit { * Trier le tableau en fonction de l'évènement de la colonne * @param e évènement du tri */ - triTableau(e) { + trierTableau(e) { this.tri = e.active; switch(e.direction) { case "asc": @@ -260,7 +260,7 @@ export class CollaborateursTableComponent implements OnInit { this.asc = false; break; } - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -276,12 +276,17 @@ export class CollaborateursTableComponent implements OnInit { for(let bu of this.bus) { this.busIds.push(bu.id); } - this.updateDataSource(); + this.updateDonneesTableau(); this.chargement = false; } } - - setClassCouleurLigne(collaborateur: CollaborateurDTO) { + + /** + * Permettre d'ajouter une classe à la ligne afin de choisir la couleur de cette même ligne + * + * @param collaborateur le collaborateur de la ligne du tableau + */ + setClassCouleurLigne(collaborateur: CollaborateurDTO) { if(this.contientCollaborateur(this.collaborateursAjouts,collaborateur)) { return "collaborateurAjoute"; } @@ -308,7 +313,7 @@ export class CollaborateursTableComponent implements OnInit { this.busIds = this.busIds.filter( (id) => id != bu.id); } this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** diff --git a/src/app/shared/mat-tables/engagements-table/engagements-table.html b/src/app/shared/mat-tables/engagements-table/engagements-table.html index e4b8bbd..81c5855 100644 --- a/src/app/shared/mat-tables/engagements-table/engagements-table.html +++ b/src/app/shared/mat-tables/engagements-table/engagements-table.html @@ -73,7 +73,7 @@ [pageIndex]="numPage-1" [pageSize]="parPage" [pageSizeOptions]="pageOption" - (page)="updatePageInfo($event)"> + (page)="updatePaginationTableau($event)">
diff --git a/src/app/shared/mat-tables/engagements-table/engagements-table.ts b/src/app/shared/mat-tables/engagements-table/engagements-table.ts index 7450212..d43a687 100644 --- a/src/app/shared/mat-tables/engagements-table/engagements-table.ts +++ b/src/app/shared/mat-tables/engagements-table/engagements-table.ts @@ -104,7 +104,7 @@ export class EngagementTableComponent implements OnInit { } - updateDataSource() { + updateDonneesTableau() { if(this.busIds.length == 0 || this.etatsEngagements.length == 0) { this.taille = 0; this.dataSource = new MatTableDataSource(undefined); @@ -138,14 +138,14 @@ export class EngagementTableComponent implements OnInit { for(let bu of this.bus) { this.busIds.push(bu.id); } - this.updateDataSource(); + this.updateDonneesTableau(); this.chargement = false; } } setSearch() { this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } resetSearch() { @@ -157,10 +157,10 @@ export class EngagementTableComponent implements OnInit { * Mettre à jour le nomre d'élément à afficher par page et le numéro de la page * @param event évènement de la pagination */ - updatePageInfo(event){ + updatePaginationTableau(event){ this.parPage = event.pageSize; this.numPage = event.pageIndex+1; - this.updateDataSource(); + this.updateDonneesTableau(); } updateEtatsEngagement(event:boolean, etat:EtatEngagement) { diff --git a/src/app/shared/mat-tables/ep-table/ep-table.html b/src/app/shared/mat-tables/ep-table/ep-table.html index 7b08a9a..b55c183 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.html +++ b/src/app/shared/mat-tables/ep-table/ep-table.html @@ -36,7 +36,7 @@ Date de début - + clear @@ -45,14 +45,14 @@ Date de fin - + clear
- + Business Unit @@ -120,7 +120,7 @@ [pageIndex]="numPage-1" [pageSize]="parPage" [pageSizeOptions]="pageOption" - (page)="updatePageInfo($event)" + (page)="updatePaginationTableau($event)" > diff --git a/src/app/shared/mat-tables/ep-table/ep-table.ts b/src/app/shared/mat-tables/ep-table/ep-table.ts index 5138072..e07943d 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.ts +++ b/src/app/shared/mat-tables/ep-table/ep-table.ts @@ -94,7 +94,7 @@ export class EpTableComponent implements OnInit{ }); } - updateDataSource() { + updateDonneesTableau() { switch(this.typeRechercheEP) { case epTypeRecherche.EPEnCours: this.getEPEnCours(); @@ -199,7 +199,7 @@ export class EpTableComponent implements OnInit{ /*for(let bu of this.bus) { this.busIds.push(bu.id); }*/ - this.updateDataSource(); + this.updateDonneesTableau(); this.chargement = false; } } @@ -213,17 +213,17 @@ export class EpTableComponent implements OnInit{ this.dateDebut = undefined; if(val == 2) this.dateFin = undefined; - this.updateDataSource(); + this.updateDonneesTableau(); } /** * Mettre à jour le nomre d'élément à afficher par page et le numéro de la page * @param event évènement de la pagination */ - updatePageInfo(event){ + updatePaginationTableau(event){ this.parPage = event.pageSize; this.numPage = event.pageIndex+1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -231,7 +231,7 @@ export class EpTableComponent implements OnInit{ */ setSearch() { this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -255,7 +255,7 @@ export class EpTableComponent implements OnInit{ this.busIds = []; this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -272,14 +272,14 @@ export class EpTableComponent implements OnInit{ this.busIds = this.busIds.filter( (id) => id != bu.id); } this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } /** * Trier le tableau en fonction de l'évènement de la colonne * @param e évènement du tri */ - triTableau(e) { + trierTableau(e) { this.tri = e.active; switch(e.direction) { case "asc": @@ -289,7 +289,7 @@ export class EpTableComponent implements OnInit{ this.asc = false; break; } - this.updateDataSource(); + this.updateDonneesTableau(); } diff --git a/src/app/shared/mat-tables/formations-table/formations.table.html b/src/app/shared/mat-tables/formations-table/formations.table.html index ce58390..d9438e0 100644 --- a/src/app/shared/mat-tables/formations-table/formations.table.html +++ b/src/app/shared/mat-tables/formations-table/formations.table.html @@ -26,7 +26,7 @@ - + Intitulé {{ row.intitule }} @@ -76,7 +76,7 @@ [pageIndex]="numPage-1" [pageSize]="parPage" [pageSizeOptions]="pageOption" - (page)="updatePageInfo($event)" + (page)="updatePaginationTableau($event)" > diff --git a/src/app/shared/mat-tables/formations-table/formations.table.ts b/src/app/shared/mat-tables/formations-table/formations.table.ts index 17ddf19..4beca06 100644 --- a/src/app/shared/mat-tables/formations-table/formations.table.ts +++ b/src/app/shared/mat-tables/formations-table/formations.table.ts @@ -111,7 +111,7 @@ export class FormationsTableComponent implements OnInit { * Mettre à jour les informations à afficher dans la tableau. * Devra se faire à l'ouverture de la page, au changement de page ou du nombre d'éléments à afficher, au moment d'un tri ou encore lors de l'utilisation de la barre de recherche. */ - updateDataSource() { + updateDonneesTableau() { this.updateFormations(); } @@ -156,7 +156,7 @@ export class FormationsTableComponent implements OnInit { else { this.collaborateurConnecte = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); this.idAgence = this.collaborateurConnecte.businessUnit.agence.id; - this.updateDataSource(); + this.updateDonneesTableau(); this.chargement = false; } } @@ -165,10 +165,10 @@ export class FormationsTableComponent implements OnInit { * Mettre à jour le nomre d'élément à afficher par page et le numéro de la page * @param event évènement de la pagination */ - updatePageInfo(event){ + updatePaginationTableau(event){ this.parPage = event.pageSize; this.numPage = event.pageIndex+1; - this.updateDataSource(); + this.updateDonneesTableau(); } @@ -177,7 +177,7 @@ export class FormationsTableComponent implements OnInit { */ setSearch() { this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } @@ -194,7 +194,7 @@ export class FormationsTableComponent implements OnInit { * Trier le tableau en fonction de l'évènement de la colonne * @param e évènement du tri */ - triTableau(e) { + trierTableau(e) { this.tri = e.active; switch(e.direction) { case "asc": @@ -204,7 +204,7 @@ export class FormationsTableComponent implements OnInit { this.asc = false; break; } - this.updateDataSource(); + this.updateDonneesTableau(); } /** @@ -220,7 +220,7 @@ export class FormationsTableComponent implements OnInit { this.idStatuts = []; this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } @@ -238,7 +238,7 @@ export class FormationsTableComponent implements OnInit { this.idStatuts = this.idStatuts.filter(id => id != statut.id); } this.numPage = 1; - this.updateDataSource(); + this.updateDonneesTableau(); } /**