petit merge

develop
Yanaël GRETTE 4 years ago
commit bdcb627d52
  1. 26
      src/app/shared/api-swagger/api/ep.service.ts
  2. 8
      src/app/shared/mat-tables/ep-table/ep-table.html
  3. 17
      src/app/shared/mat-tables/ep-table/ep-table.ts

@ -210,16 +210,18 @@ 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<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable<Array<EpInformationDTO>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<EpInformationDTO>>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<EpInformationDTO>>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, tri?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable<Array<EpInformationDTO>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<EpInformationDTO>>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<EpInformationDTO>>>;
public getEPEnCours(idBUs?: Array<number>, asc?: boolean, numPage?: number, parPage?: number, texte?: string, epObligatoire?: boolean, tri?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
@ -247,6 +249,9 @@ export class EpService {
if (texte !== undefined && texte !== null) {
queryParameters = queryParameters.set('texte', <any>texte);
}
if (epObligatoire !== undefined && epObligatoire !== null) {
queryParameters = queryParameters.set('epObligatoire', <any>epObligatoire);
}
if (tri !== undefined && tri !== null) {
queryParameters = queryParameters.set('tri', <any>tri);
}
@ -391,15 +396,17 @@ export class EpService {
* Récupérer le nombre total dEP 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&#x27;à 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<number>, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable<number>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<number>>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<number>>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'body', reportProgress?: boolean): Observable<number>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<number>>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<number>>;
public getEPEnCoursCount(idBUs?: Array<number>, texte?: string, epObligatoire?: boolean, dateDebut?: Date, dateFin?: Date, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
@ -414,6 +421,9 @@ export class EpService {
if (texte !== undefined && texte !== null) {
queryParameters = queryParameters.set('texte', <any>texte);
}
if (epObligatoire !== undefined && epObligatoire !== null) {
queryParameters = queryParameters.set('epObligatoire', <any>epObligatoire);
}
if (dateDebut !== undefined && dateDebut !== null) {
queryParameters = queryParameters.set('dateDebut', <any>dateDebut.toISOString());
}

@ -52,6 +52,14 @@
</mat-form-field>
</ng-container>
<div>
<mat-slide-toggle *ngIf="typeRechercheEP == epTypeRecherche.EPEnCours " (change)="updateToggle($event)" color="primary" [checked]="epObligatoires">
EP obligatoires
</mat-slide-toggle>
</div>
<mat-table matSort [dataSource]="dataSource" (matSortChange)="trierTableau($event)" matSortDirection="asc">
<ng-container matColumnDef="agence">
<mat-header-cell *matHeaderCellDef mat-sort-header disableClear>

@ -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<number> = [];
/**
* 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
*/

Loading…
Cancel
Save