diff --git a/src/app/shared/api-swagger/api/ep.service.ts b/src/app/shared/api-swagger/api/ep.service.ts index 588b64d..bd33c66 100644 --- a/src/app/shared/api-swagger/api/ep.service.ts +++ b/src/app/shared/api-swagger/api/ep.service.ts @@ -210,25 +210,27 @@ export class EpService { * @param numPage Numéro de la page du tableau à afficher * @param parPage Nombre d’élément maximum à afficher dans le tableau * @param texte Texte permettant de filtrer les données + * @param epObligatoire Récupérer la liste des EP obligatoires * @param tri Colonne du tableau sur lequel le tri devra être effectué * @param dateDebut Date à partir de laquelle les données son récupérées * @param dateFin Date jusqu'à laquelle les données sont récupérées * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable>; - public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable>>; - public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable>>; - public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable { - - - - - - - - - + public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable>; + public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable>>; + public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable>>; + public getEPEnCours(idBUs?: Array, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable { + + + + + + + + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (idBUs) { idBUs.forEach((element) => { @@ -247,6 +249,9 @@ export class EpService { if (texte !== undefined && texte !== null) { queryParameters = queryParameters.set('texte', texte); } + if (epObligatoire !== undefined && epObligatoire !== null) { + queryParameters = queryParameters.set('epObligatoire', epObligatoire); + } if (tri !== undefined && tri !== null) { queryParameters = queryParameters.set('tri', tri); } @@ -391,20 +396,22 @@ export class EpService { * Récupérer le nombre total d’EP en cours. * @param idBUs liste des ids des BU auxquelles les données sont rattachées * @param texte Texte permettant de filtrer les données + * @param epObligatoire Récupérer la liste des EP obligatoires * @param dateDebut Date à partir de laquelle les données son récupérées * @param dateFin Date jusqu'à laquelle les données sont récupérées * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getEPEnCoursCount(idBUs?: Array, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable; - public getEPEnCoursCount(idBUs?: Array, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable>; - public getEPEnCoursCount(idBUs?: Array, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable>; - public getEPEnCoursCount(idBUs?: Array, texte?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable { - - - - - + public getEPEnCoursCount(idBUs?: Array, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable; + public getEPEnCoursCount(idBUs?: Array, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable>; + public getEPEnCoursCount(idBUs?: Array, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable>; + public getEPEnCoursCount(idBUs?: Array, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable { + + + + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (idBUs) { idBUs.forEach((element) => { @@ -414,6 +421,9 @@ export class EpService { if (texte !== undefined && texte !== null) { queryParameters = queryParameters.set('texte', texte); } + if (epObligatoire !== undefined && epObligatoire !== null) { + queryParameters = queryParameters.set('epObligatoire', epObligatoire); + } if (dateDebut !== undefined && dateDebut !== null) { queryParameters = queryParameters.set('dateDebut', dateDebut.toISOString()); } 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 b55c183..483ff2a 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.html +++ b/src/app/shared/mat-tables/ep-table/ep-table.html @@ -50,7 +50,15 @@ - + + +
+ + EP obligatoires + +
+ + 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 ce79668..757cf4b 100644 --- a/src/app/shared/mat-tables/ep-table/ep-table.ts +++ b/src/app/shared/mat-tables/ep-table/ep-table.ts @@ -1,4 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; +import { MatSlideToggleChange } from "@angular/material/slide-toggle"; import { MatTableDataSource } from "@angular/material/table"; import { affichageStatut, BusinessUnitDTO, CollaborateurDTO, EpInformationDTO, EpService, estEnAttente, StatutEp, TypeEp } from "@shared/api-swagger"; import { cles, epTypeRecherche } from "@shared/utils/cles"; @@ -11,6 +12,7 @@ import { Subscription } from "rxjs"; export class EpTableComponent implements OnInit{ chargement: boolean = true; + epTypeRecherche :any = epTypeRecherche; /** * * Ordre de tri à envoyer au serveur (true : croissant, false : décroissantà). @@ -57,6 +59,11 @@ export class EpTableComponent implements OnInit{ */ private busIds: Array = []; + /** + * Permet d'indiquer si l'on ne récupère que les EP obligatoires ou non (lors de la récupération des EP en cours uniquement) + */ + epObligatoires: boolean = false; + dateDebut : Date; dateFin: Date; @@ -149,10 +156,11 @@ export class EpTableComponent implements OnInit{ } getEPEnCours() { - this.epSubscription = this.epService.getEPEnCours(this.busIds, this.asc, this.numPage, this.parPage, this.search, this.tri, this.dateDebut, this.dateFin).subscribe( + console.log(this.epObligatoires); + this.epSubscription = this.epService.getEPEnCours(this.busIds, this.asc, this.numPage, this.parPage, this.search, this.epObligatoires, this.tri, this.dateDebut, this.dateFin).subscribe( eps => { this.dataSource = new MatTableDataSource(eps); - this.epCountSubscription = this.epService.getEPEnCoursCount(this.busIds, this.search, this.dateDebut, this.dateFin).subscribe( + this.epCountSubscription = this.epService.getEPEnCoursCount(this.busIds,this.search, this.epObligatoires, this.dateDebut, this.dateFin).subscribe( count => { console.log(count); this.taille = count @@ -186,6 +194,11 @@ export class EpTableComponent implements OnInit{ ); } + updateToggle(event :MatSlideToggleChange) { + this.epObligatoires = event.checked; + this.updateDonneesTableau(); + } + /** * création de la liste des business unit du collaborateur connecté pour afficher les checkboxes */