Răsfoiți Sursa

dev en cours

rajah 11 luni în urmă
părinte
comite
3355b1b456

+ 11 - 8
src/app/composants/account-details/account-details.component.html

@@ -167,6 +167,7 @@
 		</div>
 }
 
+@if (this.journees.dodosurplace) {
 		<div class="form-group row">
 			<div class="col-sm-4"></div>
 			<div class="col-sm-8">
@@ -175,16 +176,18 @@
 				</div>
 			</div>
 		</div>
+}
 
-		<!-- <div class="form-group row">
-				<div class="col-sm-4"></div>
-				<div class="col-sm-8">
-					<div class="form-check form-switch">
-						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled>
-						<label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
-					</div>
+@if (this.journees.amigabus) {
+		<div class="form-group row">
+			<div class="col-sm-4"></div>
+			<div class="col-sm-8">
+				<div class="form-check form-switch">
+					<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled><label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
 				</div>
-			</div> -->
+			</div>
+		</div>
+}
 
 		<div class="form-group row">
 			<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Commentaire</span></label>

+ 11 - 8
src/app/composants/account-update/account-update.component.html

@@ -154,6 +154,7 @@
 		</div>
 }
 
+@if (this.journees.dodosurplace) {
 		<div class="form-group row">
 			<div class="col-sm-4"></div>
 			<div class="col-sm-8">
@@ -162,16 +163,18 @@
 				</div>
 			</div>
 		</div>
+}
 
-		<!-- <div class="form-group row">
-				<div class="col-sm-4"></div>
-				<div class="col-sm-8">
-					<div class="form-check form-switch">
-						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled>
-						<label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
-					</div>
+@if (this.journees.amigabus) {
+		<div class="form-group row">
+			<div class="col-sm-4"></div>
+			<div class="col-sm-8">
+				<div class="form-check form-switch">
+					<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled><label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
 				</div>
-			</div> -->
+			</div>
+		</div>
+}
 
 		<div class="form-group row">
 			<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Commentaire</span></label>

+ 7 - 4
src/app/composants/participant-create/participant-create.component.html

@@ -172,6 +172,7 @@
 			</div>
 }
 
+@if (this.journees.dodosurplace) {
 			<div class="form-group row">
 				<div class="col-sm-4"></div>
 				<div class="col-sm-8">
@@ -180,16 +181,18 @@
 					</div>
 				</div>
 			</div>
+}
 
-			<!-- <div class="form-group row">
+@if (this.journees.amigabus) {
+			<div class="form-group row">
 				<div class="col-sm-4"></div>
 				<div class="col-sm-8">
 					<div class="form-check form-switch">
-						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus">
-						<label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
+						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus"><label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
 					</div>
 				</div>
-			</div> -->
+			</div>
+}
 
 			<div class="form-group row">
 				<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Commentaire</span></label>

+ 12 - 9
src/app/composants/participant-details/participant-details.component.html

@@ -20,7 +20,7 @@
 				<input type="text" class="form-control form-control-sm field-separate" id="dateModification" name="dateModification" [(ngModel)]="participant.dateModification" disabled>
 			</div>
 		</div>
-		
+
 		<div class="form-group row">
 			<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Profil</span></label>
 			<div class="col-sm-8">
@@ -178,6 +178,7 @@
 		</div>
 }
 
+@if (this.journees.dodosurplace) {
 		<div class="form-group row">
 			<div class="col-sm-4"></div>
 			<div class="col-sm-8">
@@ -186,16 +187,18 @@
 				</div>
 			</div>
 		</div>
+}
 
-		<!-- <div class="form-group row">
-				<div class="col-sm-4"></div>
-				<div class="col-sm-8">
-					<div class="form-check form-switch">
-						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled>
-						<label class="form-check-label" for="useAmigabus"><span i18n>Vient en Amigabus</span></label>
-					</div>
+@if (this.journees.amigabus) {
+		<div class="form-group row">
+			<div class="col-sm-4"></div>
+			<div class="col-sm-8">
+				<div class="form-check form-switch">
+					<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus" disabled><label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
 				</div>
-			</div> -->
+			</div>
+		</div>
+}
 
 		<div class="form-group row">
 			<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Commentaire</span></label>

+ 11 - 8
src/app/composants/participant-update/participant-update.component.html

@@ -194,6 +194,7 @@
 		</div>
 }
 
+@if (this.journees.dodosurplace) {
 		<div class="form-group row">
 			<div class="col-sm-4"></div>
 			<div class="col-sm-8">
@@ -202,16 +203,18 @@
 				</div>
 			</div>
 		</div>
+}
 
-		<!-- <div class="form-group row">
-				<div class="col-sm-4"></div>
-				<div class="col-sm-8">
-					<div class="form-check form-switch">
-						<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus">
-						<label class="form-check-label" for="useAmigabus"><span i18n>Vient en Amigabus</span></label>
-					</div>
+@if (this.journees.amigabus) {
+		<div class="form-group row">
+			<div class="col-sm-4"></div>
+			<div class="col-sm-8">
+				<div class="form-check form-switch">
+					<input class="form-check-input field-separate" type="checkbox" id="useAmigabus" name="useAmigabus" [(ngModel)]="participant.useAmigabus"><label class="form-check-label" for="useAmigabus"><small><span i18n>Vient en Amigabus</span></small></label>
 				</div>
-			</div> -->
+			</div>
+		</div>
+}
 
 		<div class="form-group row">
 			<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Commentaire</span></label>

+ 12 - 1
src/app/composants/production-list/production-list.component.html

@@ -3,11 +3,22 @@
 <div class="card shadow rounded-bottom-0">
 	<div class="card-header"><span i18n>Liste des productions</span></div>
 	<div class="card-header">
-		<div class="row">
+		<div class="row justify-content-between">
 			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListProduction()" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;<span i18n>Actualiser</span></button>
 				<button type="button" (click)="goToNewProduction()" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-plus"></i>&nbsp;<span i18n>Créer</span></button>
 			</div>
+			<div class="form-group col-sm-2 label-nobr">
+				<div class="input-group input-group-sn">
+					<button type="button" class="btn bg-gradient btn-secondary btn-sm field-separate" disabled><span i18n>Filtrer par type</span></button>
+					<select class="form-select form-select-sm field-separate" id="select_type" [(ngModel)]="typeFiltre" (change)="filtrageParType($event)">
+						<option> </option>
+						@for (type of types; track type) {
+						<option [value]="type.key">{{ type.value }}</option>
+						}
+					</select>
+				</div>
+			</div>
 		</div>
 	</div>
 </div>

+ 6 - 2
src/app/composants/production-list/production-list.component.ts

@@ -5,20 +5,24 @@ import { ProductionShort, ProductionEnum, ProductionTypeList } from '../../inter
 import { ProductionService } from '../../services/production.service';
 import { saveAs } from 'file-saver';
 import { TooltipModule } from 'ngx-bootstrap/tooltip';
+import { FormsModule, NgForm } from '@angular/forms';
 
-@Component({ selector: 'app-production-list', imports: [TooltipModule, MenuComponent], templateUrl: './production-list.component.html', styleUrl: './production-list.component.css' })
+@Component({ selector: 'app-production-list', imports: [FormsModule, TooltipModule, MenuComponent], templateUrl: './production-list.component.html', styleUrl: './production-list.component.css' })
 
 export class ProductionListComponent implements OnInit
 {
   productions: ProductionShort[] = [];
 
   types: ProductionEnum[] = ProductionTypeList;
+  typeFiltre: string = "";
 
   constructor(private productionService: ProductionService, private router: Router) { }
 
   ngOnInit() { this.retreiveDatas(); }
 
-  private retreiveDatas() { this.productionService.getListProduction().subscribe(data => { this.productions = data; }); }
+  private retreiveDatas() { this.productionService.getListProduction(this.typeFiltre).subscribe(data => { this.productions = data; }); }
+
+  filtrageParType(event: any) { this.typeFiltre = event.target.value; this.goToRefreshListProduction(); }
 
   goToRefreshListProduction(){ this.retreiveDatas(); }
 

+ 1 - 1
src/app/composants/variable-list/variable-list.component.ts

@@ -24,7 +24,7 @@ export class VariableListComponent implements OnInit
 
   filtrageParType(event: any) { this.typeFiltre = event.target.value; this.goToRefreshListVariable(); }
 
-  goToRefreshListVariable() { this.retreiveDatas(); this.retreiveTypes(); }
+  goToRefreshListVariable() { this.retreiveTypes(); this.retreiveDatas();  }
 
   goToNewVariable() { this.router.navigate(['/variable-create']); }
 

+ 4 - 1
src/app/composants/webcam-list/webcam-list.component.ts

@@ -1,4 +1,5 @@
 import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
 import { timer } from 'rxjs';
 
 import { MenuComponent } from '../menu/menu.component';
@@ -14,7 +15,7 @@ export class WebcamListComponent implements OnInit
 
   webcamu: Webcam = new Webcam();
 
-  constructor(private webcamService: WebcamService) { }
+  constructor(private webcamService: WebcamService, private router: Router) { }
 
   ngOnInit()
   {
@@ -27,6 +28,8 @@ export class WebcamListComponent implements OnInit
 
   updaterVues()
   {
+    if ((this.router.url !== '/webcam-list')) { return; }
+
     for (var i = 0; i < this.webcams.length; i++)
     {
       this.webcamu = new Webcam();

+ 3 - 3
src/app/interfaces/categorie.ts

@@ -1,7 +1,7 @@
-export class Categorie 
+export class Categorie
 {
-  dateCreation: string = "";
-  dateModification: string = "";
+  dateCreation?: string;
+  dateModification?: string;
   numeroCategorie: number = 0;
   libelle: string = "";
   numeroOrdre: number = 1;

+ 2 - 0
src/app/interfaces/divers.ts

@@ -15,4 +15,6 @@ export class Journees
   jour2Long: string = "";
   jour3Court: string = "";
   jour3Long: string = "";
+  amigabus: boolean = false;
+  dodosurplace: boolean = false;
 }

+ 2 - 2
src/app/interfaces/participant.ts

@@ -29,8 +29,8 @@ export const ParticipantModePaiementList: ParticipantEnum[] =
 
 export class Participant
 {
-  dateCreation: string = "";
-  dateModification: string = "";
+  dateCreation?: string;
+  dateModification?: string;
   numeroParticipant: number = 0;
   role: string = "USER";
   nom: string = "";

+ 2 - 2
src/app/interfaces/production.ts

@@ -30,8 +30,8 @@ export class Production
 
 export class ProductionShort
 {
-  dateCreation: string = "";
-  dateModification: string = "";
+  dateCreation?: string;
+  dateModification?: string;
   numeroProduction: number = 0;
   adresseIP: string = "";
   type: string = "AUTRE";

+ 3 - 3
src/app/interfaces/variable.ts

@@ -1,7 +1,7 @@
-export class Variable 
+export class Variable
 {
-  dateCreation: string = "";
-  dateModification: string = "";
+  dateCreation?: string;
+  dateModification?: string;
   numeroVariable: number = 0;
   type: string = "";
   code: string = "";

+ 15 - 8
src/app/services/production.service.ts

@@ -1,27 +1,34 @@
 import { Injectable } from '@angular/core';
-import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'
+import { HttpClient, HttpParams, HttpHeaders, HttpResponse } from '@angular/common/http'
 import { Observable } from 'rxjs';
 import { Environnement } from '../env';
 import { Production, ProductionShort, ProductionFile } from '../interfaces/production';
 
 @Injectable({ providedIn: 'root' })
 
-export class ProductionService 
+export class ProductionService
 {
 
   private baseURL = Environnement.apiUrl + "production";
 
   constructor(private httpClient: HttpClient) { }
-  
-  getListProduction(): Observable<ProductionShort[]>{ return this.httpClient.get<ProductionShort[]>(`${this.baseURL}/list`); }
+
+  getListProduction(filtreType: string): Observable<ProductionShort[]>
+  {
+    let params = new HttpParams();
+
+    if (filtreType !== null) { params = params.append('type', filtreType); }
+
+    return this.httpClient.get<ProductionShort[]>(`${this.baseURL}/list`, { params: params });
+  }
 
   getProductionFile(id: number): Observable<HttpResponse<Blob>>
   {
     let headers = new HttpHeaders();
-    
+
     headers = headers.append('Accept', 'application/zip');
 
-    return this.httpClient.get(`${this.baseURL}/file/${id}`, { headers: headers, observe: 'response', responseType: 'blob' }); 
+    return this.httpClient.get(`${this.baseURL}/file/${id}`, { headers: headers, observe: 'response', responseType: 'blob' });
   }
 
   createProduction(production: Production): Observable<Object>{ return this.httpClient.post(`${this.baseURL}/create`, production); }
@@ -35,5 +42,5 @@ export class ProductionService
   uploadProductionFile(id: number, production: ProductionFile): Observable<Object>{ return this.httpClient.put(`${this.baseURL}/upload/${id}`, production); }
 
   deleteProduction(id: number): Observable<Object>{ return this.httpClient.delete(`${this.baseURL}/delete/${id}`); }
-  
-}
+
+}