rajah 11 miesięcy temu
rodzic
commit
e17bb69559

+ 1 - 1
src/app/composants/account-update/account-update.component.ts

@@ -32,7 +32,7 @@ export class AccountUpdateComponent implements OnInit, AfterViewInit
 
   ngAfterViewInit() { }
 
-  updateConfirmed() { if (this.participantForm.valid) { this.accountService.updateProfil(this.participant).subscribe(() => { this.goToHome(); }); } }
+  updateConfirmed() { if (this.participantForm.valid) { this.accountService.updateProfil(this.participant).subscribe(); this.goToHome(); } }
 
   goToHome(){ this.router.navigate(['/'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 

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

@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
 import { MenuComponent } from '../menu/menu.component';
 import { Categorie } from '../../interfaces/categorie';
 import { CategorieService } from '../../services/categorie.service';
-import { FormsModule, NgForm } from '@angular/forms'; 
+import { FormsModule, NgForm } from '@angular/forms';
 
 @Component({ selector: 'app-categorie-create', imports: [FormsModule, MenuComponent], templateUrl: './categorie-create.component.html', styleUrl: './categorie-create.component.css'})
 
@@ -12,17 +12,17 @@ export class CategorieCreateComponent implements OnInit, AfterViewInit
   @ViewChild('formRef') categorieForm!: NgForm;
 
   categorie: Categorie = new Categorie();
-  
+
   constructor(private categorieService: CategorieService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { }
 
   ngAfterViewInit() { }
 
-  private saveCategorie() { this.categorieService.createCategorie(this.categorie).subscribe({ next: () => { this.goToListCategorie(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+  private saveCategorie() { this.categorieService.createCategorie(this.categorie).subscribe(); this.goToListCategorie(); }
 
   addCategorie() { if (this.categorieForm.valid) { this.saveCategorie(); } }
 
   goToListCategorie() {this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 7 - 7
src/app/composants/categorie-update/categorie-update.component.ts

@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 import { MenuComponent } from '../menu/menu.component';
 import { Categorie } from '../../interfaces/categorie';
 import { CategorieService } from '../../services/categorie.service';
-import { FormsModule, NgForm } from '@angular/forms'; 
+import { FormsModule, NgForm } from '@angular/forms';
 
 @Component({ selector: 'app-categorie-update', imports: [FormsModule, MenuComponent], templateUrl: './categorie-update.component.html', styleUrl: './categorie-update.component.css' })
 
@@ -12,12 +12,12 @@ export class CategorieUpdateComponent implements OnInit, AfterViewInit
   @ViewChild('formRef') categorieForm!: NgForm;
 
   numeroCategorie: number = 0;
-  
+
   categorie: Categorie = new Categorie();
-  
+
   constructor(private categorieService: CategorieService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
-  ngOnInit(): void 
+  ngOnInit(): void
   {
     this.numeroCategorie = this.route.snapshot.params['numeroCategorie'];
     this.categorieService.getByIdCategorie(this.numeroCategorie).subscribe(data => { this.categorie = data; });
@@ -25,10 +25,10 @@ export class CategorieUpdateComponent implements OnInit, AfterViewInit
 
   ngAfterViewInit() { }
 
-  updateConfirmed() { if (this.categorieForm.valid) { this.categorieService.updateCategorie(this.numeroCategorie, this.categorie).subscribe(() => { this.goToListCategorie(); }); } }
+  updateConfirmed() { if (this.categorieForm.valid) { this.categorieService.updateCategorie(this.numeroCategorie, this.categorie).subscribe(); this.goToListCategorie(); } }
 
-  deleteConfirmed() { this.categorieService.deleteCategorie(this.numeroCategorie).subscribe(() => { this.goToListCategorie(); }); }
+  deleteConfirmed() { this.categorieService.deleteCategorie(this.numeroCategorie).subscribe(); this.goToListCategorie(); }
 
   goToListCategorie(){ this.router.navigate(['/categorie-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 1 - 1
src/app/composants/participant-create/participant-create.component.ts

@@ -32,7 +32,7 @@ export class ParticipantCreateComponent implements OnInit, AfterViewInit
 
   ngAfterViewInit() { }
 
-  private saveParticipant() { this.participantService.createParticipant(this.participant).subscribe({ next: () => { this.goToListParticipant(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+  private saveParticipant() { this.participantService.createParticipant(this.participant).subscribe(); this.goToListParticipant(); }
 
   addParticipant() { if (this.participantForm.valid) { this.saveParticipant(); } }
 

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

@@ -36,9 +36,9 @@ export class ParticipantUpdateComponent implements OnInit, AfterViewInit
 
   ngAfterViewInit() { }
 
-  updateConfirmed() { if (this.participantForm.valid) { this.participantService.updateParticipant(this.numeroParticipant, this.participant).subscribe(() => { this.goToListParticipant(); }); } }
+  updateConfirmed() { if (this.participantForm.valid) { this.participantService.updateParticipant(this.numeroParticipant, this.participant).subscribe(); this.goToListParticipant(); } }
 
-  deleteConfirmed() { this.participantService.deleteParticipant(this.numeroParticipant).subscribe(() => { this.goToListParticipant(); }); }
+  deleteConfirmed() { this.participantService.deleteParticipant(this.numeroParticipant).subscribe(); this.goToListParticipant(); }
 
   goToListParticipant(){ this.router.navigate(['/participant-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
 

+ 19 - 19
src/app/composants/production-create/production-create.component.ts

@@ -5,66 +5,66 @@ import { ProductionService } from '../../services/production.service';
 import { ParticipantShort } from '../../interfaces/participant';
 import { ParticipantService } from '../../services/participant.service';
 import { Router } from '@angular/router';
-import { FormsModule, NgForm } from '@angular/forms'; 
+import { FormsModule, NgForm } from '@angular/forms';
 
 @Component({ selector: 'app-production-create', imports: [FormsModule, MenuComponent], templateUrl: './production-create.component.html', styleUrl: './production-create.component.css' })
 
-export class ProductionCreateComponent implements OnInit, AfterViewInit 
+export class ProductionCreateComponent implements OnInit, AfterViewInit
 {
-  
+
   participants: ParticipantShort[] = [];
 
   types: ProductionEnum[] = ProductionTypeList;
-  
+
   @ViewChild('formRef') productionForm!: NgForm;
-  
+
   production: Production = new Production();
-  
+
   constructor(private productionService: ProductionService, private participantService: ParticipantService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { this.retreiveParticipants(); }
-  
+
   ngAfterViewInit() { }
 
   private retreiveParticipants() { this.participantService.getOptionListParticipant().subscribe(data => { this.participants = data; }); }
 
-  onArchiveSelected(event: any) 
-  { 
+  onArchiveSelected(event: any)
+  {
     const et = event.target;
     const reader = new FileReader();
 
-    if (et.files && et.files.length > 0) 
+    if (et.files && et.files.length > 0)
     {
       const file = et.files[0];
- 
+
       this.production.nomArchive = file.name;
       this.production.numeroVersion = 1;
-      
+
       reader.onloadend = async (e: any) => { if (e.target.result) { this.production.archive = e.target.result; } }
 
       reader.readAsDataURL(file);
 		}
   }
 
-  onVignetteSelected(event: any) 
-  { 
+  onVignetteSelected(event: any)
+  {
     const et = event.target;
     const reader = new FileReader();
 
-    if (et.files && et.files.length > 0) 
+    if (et.files && et.files.length > 0)
     {
       const file = et.files[0];
-     
+
       reader.onloadend = async (e: any) => { if (e.target.result) { this.production.vignette = e.target.result; } }
 
       reader.readAsDataURL(file);
 		}
   }
- 
-  private saveProduction() { this.productionService.createProduction(this.production).subscribe({ next: () => { this.goToListProduction(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+
+  private saveProduction() { this.productionService.createProduction(this.production).subscribe(); this.goToListProduction(); }
 
   addProduction() { if (this.productionForm.valid) { this.saveProduction(); } }
 
   goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 16 - 16
src/app/composants/production-update/production-update.component.ts

@@ -5,57 +5,57 @@ import { ProductionShort, ProductionEnum, ProductionTypeList } from '../../inter
 import { ProductionService } from '../../services/production.service';
 import { ParticipantShort } from '../../interfaces/participant';
 import { ParticipantService } from '../../services/participant.service';
-import { FormsModule, NgForm } from '@angular/forms'; 
+import { FormsModule, NgForm } from '@angular/forms';
 
 @Component({ selector: 'app-production-update', imports: [FormsModule, MenuComponent], templateUrl: './production-update.component.html', styleUrl: './production-update.component.css' })
 
 export class ProductionUpdateComponent implements OnInit, AfterViewInit
 {
-  
+
   participants: ParticipantShort[] = [];
 
   types: ProductionEnum[] = ProductionTypeList;
-  
+
   @ViewChild('formRef') productionForm!: NgForm;
-  
+
   production: ProductionShort = new ProductionShort();
-  
+
   numeroProduction: number = 0;
 
   constructor(private productionService: ProductionService, private participantService: ParticipantService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
-  ngOnInit(): void 
-  { 
+  ngOnInit(): void
+  {
     this.retreiveParticipants();
     this.numeroProduction = this.route.snapshot.params['numeroProduction'];
     this.productionService.getByIdProduction(this.numeroProduction).subscribe(data => { this.production = data; });
   }
-  
+
   ngAfterViewInit() { }
 
   private retreiveParticipants() { this.participantService.getOptionListParticipant().subscribe(data => { this.participants = data; }); }
 
-  onVignetteSelected(event: any) 
-  { 
+  onVignetteSelected(event: any)
+  {
     const et = event.target;
     const reader = new FileReader();
 
-    if (et.files && et.files.length > 0) 
+    if (et.files && et.files.length > 0)
     {
       const file = et.files[0];
-     
+
       reader.onloadend = async (e: any) => { if (e.target.result) { this.production.vignette = e.target.result; } }
 
       reader.readAsDataURL(file);
 		}
   }
- 
-  private saveProduction() { this.productionService.updateProduction(this.numeroProduction, this.production).subscribe({ next: () => { this.goToListProduction(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+
+  private saveProduction() { this.productionService.updateProduction(this.numeroProduction, this.production).subscribe(); this.goToListProduction(); }
 
   updateConfirmed() { if (this.productionForm.valid) { this.saveProduction(); } }
 
-  deleteConfirmed() { this.productionService.deleteProduction(this.numeroProduction).subscribe(() => { this.goToListProduction(); }); }
+  deleteConfirmed() { this.productionService.deleteProduction(this.numeroProduction).subscribe(); this.goToListProduction(); }
 
   goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 13 - 13
src/app/composants/production-upload/production-upload.component.ts

@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 import { MenuComponent } from '../menu/menu.component';
 import { ProductionFile } from '../../interfaces/production';
 import { ProductionService } from '../../services/production.service';
-import { FormsModule } from '@angular/forms'; 
+import { FormsModule } from '@angular/forms';
 
 @Component({ selector: 'app-production-upload', imports: [FormsModule, MenuComponent], templateUrl: './production-upload.component.html', styleUrl: './production-upload.component.css' })
 
@@ -11,40 +11,40 @@ export class ProductionUploadComponent implements OnInit, AfterViewInit
 {
 
   production: ProductionFile = new ProductionFile();
-  
+
   numeroProduction: number = 0;
 
   constructor(private productionService: ProductionService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
-  ngOnInit(): void 
-  { 
+  ngOnInit(): void
+  {
     this.numeroProduction = this.route.snapshot.params['numeroProduction'];
     this.productionService.getByIdProductionFile(this.numeroProduction).subscribe(data => { this.production = data; });
   }
-  
+
   ngAfterViewInit() { }
 
-  onArchiveSelected(event: any) 
-  { 
+  onArchiveSelected(event: any)
+  {
     const et = event.target;
     const reader = new FileReader();
 
-    if (et.files && et.files.length > 0) 
+    if (et.files && et.files.length > 0)
     {
       const file = et.files[0];
- 
+
       this.production.nomArchive = file.name;
-      
+
       reader.onloadend = async (e: any) => { if (e.target.result) { this.production.archive = e.target.result; } }
 
       reader.readAsDataURL(file);
 		}
   }
- 
-  private saveProduction() { this.productionService.uploadProductionFile(this.numeroProduction, this.production).subscribe({ next: () => { this.goToListProduction(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+
+  private saveProduction() { this.productionService.uploadProductionFile(this.numeroProduction, this.production).subscribe(); this.goToListProduction(); }
 
   addProductionFile() { this.saveProduction(); }
 
   goToListProduction() {this.router.navigate(['/production-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 6 - 6
src/app/composants/variable-create/variable-create.component.ts

@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
 import { Variable } from '../../interfaces/variable';
 import { VariableService } from '../../services/variable.service';
 import { MenuComponent } from '../menu/menu.component';
-import { FormsModule, NgForm, NgModel } from '@angular/forms'; 
+import { FormsModule, NgForm, NgModel } from '@angular/forms';
 
 @Component({ selector: 'app-variable-create', imports: [FormsModule, MenuComponent], templateUrl: './variable-create.component.html', styleUrl: './variable-create.component.css' })
 
@@ -13,19 +13,19 @@ export class VariableCreateComponent implements OnInit, AfterViewInit
   @ViewChild('formRef') variableForm!: NgForm;
   @ViewChild('typeRef') typeField!: NgModel;
   @ViewChild('codeRef') codeField!: NgModel;
-  
+
   variable: Variable = new Variable();
-  
+
   constructor(private variableService: VariableService, private router: Router, private menu: MenuComponent) { }
 
   ngOnInit(): void { }
-  
+
   ngAfterViewInit() { }
 
-  private saveVariable() { this.variableService.createVariable(this.variable).subscribe({ next: () => { this.goToListVariable(); }, error: (err: any) => { console.log(err); }, complete: () => { } }); }
+  private saveVariable() { this.variableService.createVariable(this.variable).subscribe(); this.goToListVariable(); }
 
   addVariable() { if (this.variableForm.valid) { this.saveVariable(); } }
 
   goToListVariable() {this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
-  
+
 }

+ 7 - 7
src/app/composants/variable-update/variable-update.component.ts

@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 import { MenuComponent } from '../menu/menu.component';
 import { Variable } from '../../interfaces/variable';
 import { VariableService } from '../../services/variable.service';
-import { FormsModule, NgForm } from '@angular/forms'; 
+import { FormsModule, NgForm } from '@angular/forms';
 
 @Component({ selector: 'app-variable-update', imports: [FormsModule, MenuComponent], templateUrl: './variable-update.component.html', styleUrl: './variable-update.component.css' })
 
@@ -13,22 +13,22 @@ export class VariableUpdateComponent implements OnInit, AfterViewInit
   @ViewChild('formRef') variableForm!: NgForm;
 
   numeroVariable: number = 0;
-  
+
   variable: Variable = new Variable();
-  
+
   constructor(private variableService: VariableService, private route: ActivatedRoute, private router: Router, private menu: MenuComponent) { }
 
-  ngOnInit(): void 
+  ngOnInit(): void
   {
     this.numeroVariable = this.route.snapshot.params['numeroVariable'];
     this.variableService.getByIdVariable(this.numeroVariable).subscribe(data => { this.variable = data; });
   }
-  
+
   ngAfterViewInit() { }
 
-  updateConfirmed() { if (this.variableForm.valid) { this.variableService.updateVariable(this.numeroVariable, this.variable).subscribe(() => { this.goToListVariable(); }); } }
+  updateConfirmed() { if (this.variableForm.valid) { this.variableService.updateVariable(this.numeroVariable, this.variable).subscribe(); this.goToListVariable(); } }
 
-  deleteConfirmed() { this.variableService.deleteVariable(this.numeroVariable).subscribe(() => { this.goToListVariable(); }); }
+  deleteConfirmed() { this.variableService.deleteVariable(this.numeroVariable).subscribe(; this.goToListVariable(); }
 
   goToListVariable(){ this.router.navigate(['/variable-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }