rajah 11 ヶ月 前
コミット
274be777ff
24 ファイル変更98 行追加99 行削除
  1. 16 0
      package-lock.json
  2. 1 0
      package.json
  3. 26 22
      src/app/app.routes.ts
  4. 2 4
      src/app/composants/account-details/account-details.component.ts
  5. 2 4
      src/app/composants/account-update/account-update.component.ts
  6. 2 4
      src/app/composants/categorie-create/categorie-create.component.ts
  7. 2 4
      src/app/composants/categorie-details/categorie-details.component.ts
  8. 1 3
      src/app/composants/categorie-list/categorie-list.component.ts
  9. 2 4
      src/app/composants/categorie-update/categorie-update.component.ts
  10. 17 3
      src/app/composants/menu/menu.component.html
  11. 3 1
      src/app/composants/menu/menu.component.ts
  12. 2 4
      src/app/composants/participant-create/participant-create.component.ts
  13. 2 4
      src/app/composants/participant-details/participant-details.component.ts
  14. 1 3
      src/app/composants/participant-list/participant-list.component.ts
  15. 2 4
      src/app/composants/participant-update/participant-update.component.ts
  16. 2 4
      src/app/composants/production-create/production-create.component.ts
  17. 2 4
      src/app/composants/production-details/production-details.component.ts
  18. 1 3
      src/app/composants/production-list/production-list.component.ts
  19. 2 4
      src/app/composants/production-update/production-update.component.ts
  20. 2 4
      src/app/composants/production-upload/production-upload.component.ts
  21. 2 4
      src/app/composants/variable-create/variable-create.component.ts
  22. 1 3
      src/app/composants/variable-details/variable-details.component.ts
  23. 3 5
      src/app/composants/variable-list/variable-list.component.ts
  24. 2 4
      src/app/composants/variable-update/variable-update.component.ts

+ 16 - 0
package-lock.json

@@ -19,6 +19,7 @@
         "@fortawesome/fontawesome-free": "^6.7.2",
         "@ng-select/ng-select": "^14.2.2",
         "@popperjs/core": "^2.11.8",
+        "@types/jquery": "^3.5.32",
         "bootstrap": "^5.3.3",
         "file-saver": "^2.0.5",
         "jquery": "^3.7.1",
@@ -5026,6 +5027,15 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/@types/jquery": {
+      "version": "3.5.32",
+      "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.32.tgz",
+      "integrity": "sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/sizzle": "*"
+      }
+    },
     "node_modules/@types/json-schema": {
       "version": "7.0.15",
       "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -5114,6 +5124,12 @@
         "@types/send": "*"
       }
     },
+    "node_modules/@types/sizzle": {
+      "version": "2.3.9",
+      "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz",
+      "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==",
+      "license": "MIT"
+    },
     "node_modules/@types/sockjs": {
       "version": "0.3.36",
       "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz",

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "@fortawesome/fontawesome-free": "^6.7.2",
     "@ng-select/ng-select": "^14.2.2",
     "@popperjs/core": "^2.11.8",
+    "@types/jquery": "^3.5.32",
     "bootstrap": "^5.3.3",
     "file-saver": "^2.0.5",
     "jquery": "^3.7.1",

+ 26 - 22
src/app/app.routes.ts

@@ -1,5 +1,9 @@
+
+import { BrowserModule } from '@angular/platform-browser';
 import { NgModule } from '@angular/core';
+import { FormsModule } from '@angular/forms';
 import { Routes, RouterModule } from '@angular/router';
+
 //import { MenuComponent } from './composants/menu/menu.component';    
 import { HomeComponent } from './composants/home/home.component';    
 import { LoginComponent } from './composants/login/login.component';    
@@ -26,31 +30,31 @@ import { ProductionUploadComponent } from './composants/production-upload/produc
 
 export const routes: Routes = [  
   {path: '', redirectTo: 'home', pathMatch: 'full'},
-  {path: 'home', component: HomeComponent },
-  {path: 'login', component: LoginComponent },
-  {path: 'account-details', component: AccountDetailsComponent },
-  {path: 'account-update', component: AccountUpdateComponent },
-  {path: 'variable-list', component: VariableListComponent /*, canActivate: [LoggedGuard]*/},
-  {path: 'variable-create', component: VariableCreateComponent /*, canActivate: [LoggedGuard]*/},
-  {path: 'variable-details/:numeroVariable', component: VariableDetailsComponent /*, canActivate: [LoggedGuard]*/},
-  {path: 'variable-update/:numeroVariable', component: VariableUpdateComponent /*, canActivate: [LoggedGuard]*/},
-  {path: 'categorie-list', component: CategorieListComponent },
-  {path: 'categorie-create', component: CategorieCreateComponent },
-  {path: 'categorie-details/:numeroCategorie', component: CategorieDetailsComponent },
-  {path: 'categorie-update/:numeroCategorie', component: CategorieUpdateComponent },
-  {path: 'participant-list', component: ParticipantListComponent },
-  {path: 'participant-create', component: ParticipantCreateComponent },
-  {path: 'participant-details/:numeroParticipant', component: ParticipantDetailsComponent },
-  {path: 'participant-update/:numeroParticipant', component: ParticipantUpdateComponent },
-  {path: 'production-list', component: ProductionListComponent },
-  {path: 'production-create', component: ProductionCreateComponent },
-  {path: 'production-details/:numeroProduction', component: ProductionDetailsComponent },
-  {path: 'production-update/:numeroProduction', component: ProductionUpdateComponent },
-  {path: 'production-upload/:numeroProduction', component: ProductionUploadComponent },
+  {path: 'home', component: HomeComponent, runGuardsAndResolvers: 'always' },
+  {path: 'login', component: LoginComponent, runGuardsAndResolvers: 'always' },
+  {path: 'account-details', component: AccountDetailsComponent, runGuardsAndResolvers: 'always' },
+  {path: 'account-update', component: AccountUpdateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'variable-list', component: VariableListComponent /*, canActivate: [LoggedGuard]*/, runGuardsAndResolvers: 'always'},
+  {path: 'variable-create', component: VariableCreateComponent /*, canActivate: [LoggedGuard]*/, runGuardsAndResolvers: 'always'},
+  {path: 'variable-details/:numeroVariable', component: VariableDetailsComponent /*, canActivate: [LoggedGuard]*/, runGuardsAndResolvers: 'always'},
+  {path: 'variable-update/:numeroVariable', component: VariableUpdateComponent /*, canActivate: [LoggedGuard]*/, runGuardsAndResolvers: 'always'},
+  {path: 'categorie-list', component: CategorieListComponent, runGuardsAndResolvers: 'always' },
+  {path: 'categorie-create', component: CategorieCreateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'categorie-details/:numeroCategorie', component: CategorieDetailsComponent, runGuardsAndResolvers: 'always' },
+  {path: 'categorie-update/:numeroCategorie', component: CategorieUpdateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'participant-list', component: ParticipantListComponent, runGuardsAndResolvers: 'always' },
+  {path: 'participant-create', component: ParticipantCreateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'participant-details/:numeroParticipant', component: ParticipantDetailsComponent, runGuardsAndResolvers: 'always' },
+  {path: 'participant-update/:numeroParticipant', component: ParticipantUpdateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'production-list', component: ProductionListComponent, runGuardsAndResolvers: 'always' },
+  {path: 'production-create', component: ProductionCreateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'production-details/:numeroProduction', component: ProductionDetailsComponent, runGuardsAndResolvers: 'always' },
+  {path: 'production-update/:numeroProduction', component: ProductionUpdateComponent, runGuardsAndResolvers: 'always' },
+  {path: 'production-upload/:numeroProduction', component: ProductionUploadComponent, runGuardsAndResolvers: 'always' },
 ];
 
 @NgModule({
-  imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' })],                                                                                                                                                                                                                                                                                                          
+  imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' }), BrowserModule, FormsModule],                                                                                                                                                                                                                                                                                                          
   exports: [RouterModule]
 })
 

+ 2 - 4
src/app/composants/account-details/account-details.component.ts

@@ -12,7 +12,7 @@ export class AccountDetailsComponent implements OnInit, AfterViewInit
  
   participant: Participant = new Participant();
   
-  constructor(private accountService : AccountService, private router: Router) { }
+  constructor(private accountService : AccountService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit() 
   {
@@ -24,8 +24,6 @@ export class AccountDetailsComponent implements OnInit, AfterViewInit
  
   updateProfil() { this.router.navigate(['/account-update']); }
   
-  goToHome(){ this.router.navigate(['/'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToHome(){ this.router.navigate(['/'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }

+ 2 - 4
src/app/composants/account-update/account-update.component.ts

@@ -14,7 +14,7 @@ export class AccountUpdateComponent implements OnInit, AfterViewInit
  
   participant: Participant = new Participant();
   
-  constructor(private accountService : AccountService, private router: Router) { }
+  constructor(private accountService : AccountService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit() { this.accountService.getProfil().subscribe(data => { this.participant = data; }); }
   
@@ -22,8 +22,6 @@ export class AccountUpdateComponent implements OnInit, AfterViewInit
 
   updateConfirmed() { if (this.participantForm.valid) { this.accountService.updateProfil(this.participant).subscribe(() => { this.goToHome(); }); } }
 
-  goToHome(){ this.router.navigate(['/'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToHome(){ this.router.navigate(['/'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }

+ 2 - 4
src/app/composants/categorie-create/categorie-create.component.ts

@@ -13,7 +13,7 @@ export class CategorieCreateComponent implements OnInit, AfterViewInit
 
   categorie: Categorie = new Categorie();
   
-  constructor(private categorieService: CategorieService, private router: Router) { }
+  constructor(private categorieService: CategorieService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { }
 
@@ -23,8 +23,6 @@ export class CategorieCreateComponent implements OnInit, AfterViewInit
 
   addCategorie() { if (this.categorieForm.valid) { this.saveCategorie(); } }
 
-  goToListCategorie() {this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListCategorie() {this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 2 - 4
src/app/composants/categorie-details/categorie-details.component.ts

@@ -14,7 +14,7 @@ export class CategorieDetailsComponent implements OnInit, AfterViewInit
 
   categorie: Categorie = new Categorie();
   
-  constructor(private categorieService: CategorieService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private categorieService: CategorieService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   {
@@ -27,8 +27,6 @@ export class CategorieDetailsComponent implements OnInit, AfterViewInit
  
   updateCategorie(id: number) { this.router.navigate(['/categorie-update', id]); }
   
-  goToListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }

+ 1 - 3
src/app/composants/categorie-list/categorie-list.component.ts

@@ -19,10 +19,8 @@ export class CategorieListComponent implements OnInit, AfterViewInit
 
   private retreiveDatas() { this.categorieService.getListCategorie().subscribe(data => { this.categories = data; }); }
 
-  goToRefreshListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToRefreshListCategorie(){ window.location.reload(); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
   goToNewCategorie(){ this.router.navigate(['/categorie-create']); }
 
   formCategorie(id: number) { this.router.navigate(['/categorie-details', id]); }

+ 2 - 4
src/app/composants/categorie-update/categorie-update.component.ts

@@ -15,7 +15,7 @@ export class CategorieUpdateComponent implements OnInit, AfterViewInit
   
   categorie: Categorie = new Categorie();
   
-  constructor(private categorieService: CategorieService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private categorieService: CategorieService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   {
@@ -29,8 +29,6 @@ export class CategorieUpdateComponent implements OnInit, AfterViewInit
 
   deleteConfirmed() { this.categorieService.deleteCategorie(this.numeroCategorie).subscribe(() => { this.goToListCategorie(); }); }
 
-  goToListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 17 - 3
src/app/composants/menu/menu.component.html

@@ -15,7 +15,7 @@
   <ul class="nav nav-pills nav-flush flex-column text-center">
 	 	<li><a routerLink="/home" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Accueil" placement="right" container="body"><i class="fa-solid fa-home"></i></a></li>
 		<li><a routerLink="/account-details" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Compte" placement="right" container="body"><i class="fa-solid fa-user"></i></a></li>
-		<li><a (click)="signOut()" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
+		<li><a routerLinkActive="active" data-bs-toggle="modal" data-bs-target="#modalDeconnecter" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
 		<li><a routerLink="/event-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Planning" placement="right" container="body"><i class="fa-solid fa-clock"></i></a></li>
 		<li><a routerLink="/webcam-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Caméras" placement="right" container="body"><i class="fa-solid fa-eye"></i></a></li>
 		
@@ -35,7 +35,7 @@
   <ul class="nav nav-pills nav-flush flex-column text-center">
 	 	<li><a routerLink="/home" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Accueil" placement="right" container="body"><i class="fa-solid fa-home"></i></a></li>
 		<li><a routerLink="/account-details" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Compte" placement="right" container="body"><i class="fa-solid fa-user"></i></a></li>
-		<li><a (click)="signOut()" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
+		<li><a routerLinkActive="active" data-bs-toggle="modal" data-bs-target="#modalDeconnecter" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
 		<li><a routerLink="/event-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Planning" placement="right" container="body"><i class="fa-solid fa-clock"></i></a></li>
 		<li><a routerLink="/webcam-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Caméras" placement="right" container="body"><i class="fa-solid fa-eye"></i></a></li>
 		
@@ -55,7 +55,7 @@
   <ul class="nav nav-pills nav-flush flex-column text-center">
 	 	<li><a routerLink="/home" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Accueil" placement="right" container="body"><i class="fa-solid fa-home"></i></a></li>
 		<li><a routerLink="/account-details" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Compte" placement="right" container="body"><i class="fa-solid fa-user"></i></a></li>
-		<li><a (click)="signOut()" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
+		<li><a routerLinkActive="active" data-bs-toggle="modal" data-bs-target="#modalDeconnecter" class="nav-link rounded-0 bg-gradient" tooltip="Logout" placement="right" container="body"><i class="fa-solid fa-right-from-bracket"></i></a></li>
 		<li><a routerLink="/event-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Planning" placement="right" container="body"><i class="fa-solid fa-clock"></i></a></li>
 		<li><a routerLink="/webcam-list" routerLinkActive="active" class="nav-link rounded-0 bg-gradient" tooltip="Caméras" placement="right" container="body"><i class="fa-solid fa-eye"></i></a></li>
 		
@@ -73,4 +73,18 @@
 	</ul>
 </div>
 
+}
+@if (this.logged) {
+
+<div class="modal fade" id="modalDeconnecter" tabindex="-1" aria-labelledby="modalDeconnecterTitre" aria-hidden="false">
+	<div class="modal-dialog modal-dialog-centered" role="document">
+		<div class="modal-content">
+			<div class="modal-body">Voulez-vous vous déconnecter ?</div>
+			<div class="modal-footer">
+				<button type="button" class="btn bg-gradient btn-secondary btn-sm" data-bs-dismiss="modal">Annuler</button>
+				<button type="button" class="btn bg-gradient btn-warning btn-sm" (click)="deconnexion()" data-bs-dismiss="modal">Confirmer</button>
+			</div>
+		</div>
+	</div>
+</div>
 }

+ 3 - 1
src/app/composants/menu/menu.component.ts

@@ -22,6 +22,8 @@ export class MenuComponent implements OnInit
     this.role = this.accountService.getRole();
   }
   
-  signOut() { this.accountService.signOut(); this.router.navigate(['/home']); } 
+  deconnexion() { this.accountService.signOut(); window.location.reload(); } 
   
+  getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+
 }

+ 2 - 4
src/app/composants/participant-create/participant-create.component.ts

@@ -17,7 +17,7 @@ export class ParticipantCreateComponent implements OnInit, AfterViewInit
   
   participant: Participant = new Participant();
   
-  constructor(private participantService: ParticipantService, private router: Router) { }
+  constructor(private participantService: ParticipantService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { }
   
@@ -27,8 +27,6 @@ export class ParticipantCreateComponent implements OnInit, AfterViewInit
 
   addParticipant() { if (this.participantForm.valid) { this.saveParticipant(); } }
 
-  goToListParticipant() {this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListParticipant() {this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 2 - 4
src/app/composants/participant-details/participant-details.component.ts

@@ -17,7 +17,7 @@ export class ParticipantDetailsComponent implements OnInit, AfterViewInit
 
   participant: Participant = new Participant();
   
-  constructor(private participantService: ParticipantService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private participantService: ParticipantService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   {
@@ -30,8 +30,6 @@ export class ParticipantDetailsComponent implements OnInit, AfterViewInit
  
   updateParticipant(id: number) { this.router.navigate(['/participant-update', id]); }
   
-  goToListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }

+ 1 - 3
src/app/composants/participant-list/participant-list.component.ts

@@ -30,9 +30,7 @@ export class ParticipantListComponent implements OnInit, AfterViewInit
   	return nbjours;
   }
   
-  goToRefreshListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToRefreshListParticipant(){ window.location.reload(); }
 
   goToNewParticipant(){ this.router.navigate(['/participant-create']); }
 

+ 2 - 4
src/app/composants/participant-update/participant-update.component.ts

@@ -19,7 +19,7 @@ export class ParticipantUpdateComponent implements OnInit, AfterViewInit
   
   participant: Participant = new Participant();
   
-  constructor(private participantService: ParticipantService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private participantService: ParticipantService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   {
@@ -33,8 +33,6 @@ export class ParticipantUpdateComponent implements OnInit, AfterViewInit
 
   deleteConfirmed() { this.participantService.deleteParticipant(this.numeroParticipant).subscribe(() => { this.goToListParticipant(); }); }
 
-  goToListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }

+ 2 - 4
src/app/composants/production-create/production-create.component.ts

@@ -20,7 +20,7 @@ export class ProductionCreateComponent implements OnInit, AfterViewInit
   
   production: Production = new Production();
   
-  constructor(private productionService: ProductionService, private participantService: ParticipantService, private router: Router) { }
+  constructor(private productionService: ProductionService, private participantService: ParticipantService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { this.retreiveParticipants(); }
   
@@ -65,8 +65,6 @@ export class ProductionCreateComponent implements OnInit, AfterViewInit
 
   addProduction() { if (this.productionForm.valid) { this.saveProduction(); } }
 
-  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 2 - 4
src/app/composants/production-details/production-details.component.ts

@@ -16,7 +16,7 @@ export class ProductionDetailsComponent implements OnInit, AfterViewInit
   
   production: ProductionShort = new ProductionShort();
   
-  constructor(private productionService: ProductionService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private productionService: ProductionService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   { 
@@ -31,8 +31,6 @@ export class ProductionDetailsComponent implements OnInit, AfterViewInit
   
   updateProduction(id: number) { this.router.navigate(['/production-update', id]); }
 
-  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 1 - 3
src/app/composants/production-list/production-list.component.ts

@@ -23,9 +23,7 @@ export class ProductionListComponent implements OnInit, AfterViewInit
 
   private retreiveDatas() { this.productionService.getListProduction().subscribe(data => { this.productions = data; }); }
 
-  goToRefreshListProduction(){ this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToRefreshListProduction(){ window.location.reload(); }
 
   goToNewProduction(){ this.router.navigate(['/production-create']); }
 

+ 2 - 4
src/app/composants/production-update/production-update.component.ts

@@ -22,7 +22,7 @@ export class ProductionUpdateComponent implements OnInit, AfterViewInit
   
   numeroProduction: number = 0;
 
-  constructor(private productionService: ProductionService, private participantService: ParticipantService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private productionService: ProductionService, private participantService: ParticipantService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   { 
@@ -56,8 +56,6 @@ export class ProductionUpdateComponent implements OnInit, AfterViewInit
 
   deleteConfirmed() { this.productionService.deleteProduction(this.numeroProduction).subscribe(() => { this.goToListProduction(); }); }
 
-  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 2 - 4
src/app/composants/production-upload/production-upload.component.ts

@@ -14,7 +14,7 @@ export class ProductionUploadComponent implements OnInit, AfterViewInit
   
   numeroProduction: number = 0;
 
-  constructor(private productionService: ProductionService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private productionService: ProductionService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   { 
@@ -45,8 +45,6 @@ export class ProductionUploadComponent implements OnInit, AfterViewInit
 
   addProductionFile() { this.saveProduction(); }
 
-  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 2 - 4
src/app/composants/variable-create/variable-create.component.ts

@@ -16,7 +16,7 @@ export class VariableCreateComponent implements OnInit, AfterViewInit
   
   variable: Variable = new Variable();
   
-  constructor(private variableService: VariableService, private router: Router) { }
+  constructor(private variableService: VariableService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { }
   
@@ -26,8 +26,6 @@ export class VariableCreateComponent implements OnInit, AfterViewInit
 
   addVariable() { if (this.variableForm.valid) { this.saveVariable(); } }
 
-  goToListVariable() {this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
+  goToListVariable() {this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
   
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
-
 }

+ 1 - 3
src/app/composants/variable-details/variable-details.component.ts

@@ -27,8 +27,6 @@ export class VariableDetailsComponent implements OnInit, AfterViewInit
  
   updateVariable(id: number) { this.router.navigate(['/variable-update', id]); }
   
-  goToListVariable(){ this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToListVariable(){ window.location.reload(); }
 
 }

+ 3 - 5
src/app/composants/variable-list/variable-list.component.ts

@@ -13,7 +13,7 @@ export class VariableListComponent implements OnInit, AfterViewInit
   
   variables: Variable[] = [];
 
-  constructor(private variableService: VariableService, private router: Router) { }
+  constructor(private variableService: VariableService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { this.retreiveDatas(); this.retreiveParticipants(); }
   
@@ -22,11 +22,9 @@ export class VariableListComponent implements OnInit, AfterViewInit
   private retreiveDatas() { this.variableService.getListVariable().subscribe(data => { this.variables = data; }); }
   private retreiveParticipants() { this.variableService.getOptionListVariableType().subscribe(data => { this.types = data; }); }
 
-  filtrageParType(event: any) { this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000), 'type': event.target.value } }); }
+  filtrageParType(event: any) { this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000), 'type': event.target.value } }); }
   
-  goToRefreshListVariable(){ this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToRefreshListVariable(){ window.location.reload(); }
 
   goToNewVariable(){ this.router.navigate(['/variable-create']); }
 

+ 2 - 4
src/app/composants/variable-update/variable-update.component.ts

@@ -16,7 +16,7 @@ export class VariableUpdateComponent implements OnInit, AfterViewInit
   
   variable: Variable = new Variable();
   
-  constructor(private variableService: VariableService, private route: ActivatedRoute, private router: Router) { }
+  constructor(private variableService: VariableService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void 
   {
@@ -30,8 +30,6 @@ export class VariableUpdateComponent implements OnInit, AfterViewInit
 
   deleteConfirmed() { this.variableService.deleteVariable(this.numeroVariable).subscribe(() => { this.goToListVariable(); }); }
 
-  goToListVariable(){ this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.getRandomInteger(1, 100000) } }); }
-
-  private getRandomInteger(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; }
+  goToListVariable(){ this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 
 }