diff --git a/src/app/components/shared/helpers-jump/jump-table.component.html b/src/app/components/shared/helpers-jump/jump-table.component.html index 23fd3db..ff1939f 100644 --- a/src/app/components/shared/helpers-jump/jump-table.component.html +++ b/src/app/components/shared/helpers-jump/jump-table.component.html @@ -48,14 +48,14 @@ Lieu - {{element.lieu}} + {{element.lieu}} - {{element.oaci}} - + Aeronef - {{element.aeronef}} + {{element.aeronef}} - {{element.imat}} - + Hauteur @@ -103,14 +103,14 @@ Voile - {{element.voile}} + {{element.voile}} - {{element.taille}} - + Categorie - {{element.categorie}} + {{element.categorie}} - {{element.module}} - + + + + Zone + + {{element.zone}} + + + + + @@ -176,18 +187,7 @@ - - - Zone - - {{element.zone}} - - - - - - - + Video diff --git a/src/app/components/shared/helpers-jump/jump-table.component.ts b/src/app/components/shared/helpers-jump/jump-table.component.ts index fd1a843..aad8ccc 100644 --- a/src/app/components/shared/helpers-jump/jump-table.component.ts +++ b/src/app/components/shared/helpers-jump/jump-table.component.ts @@ -47,11 +47,17 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe public jump: Jump = {} as Jump; public jumps!: MatTableDataSource; public jumpsCount = 0; - public displayedColumns: string[] = [ + /* public displayedColumns: string[] = [ 'numero', 'date', 'lieu', 'oaci', 'aeronef', 'imat', 'hauteur', 'voile', 'taille', 'categorie', 'module', 'participants', 'programme', 'accessoires', 'zone', 'video', 'actions' + ];*/ + public displayedColumns: string[] = [ + 'numero', 'date', 'lieu', 'aeronef', + 'hauteur', 'voile', 'categorie', + 'participants', 'zone', 'accessoires', + 'video', 'actions' ]; //public displayedColumns: string[] = jumpColumns.map((col) => col.key) public columnsSchema: Array = jumpColumns; @@ -101,7 +107,7 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe this.loading = true; this._query = this.config; this.runQuery(); - console.log('ngOnChanges event in jump-table component'); + //console.log('ngOnChanges event in jump-table component'); } ngOnDestroy() { @@ -113,7 +119,7 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe if (this.jumpRefresh != this._jumpTableService.jumpRefresh) { this.jumpRefresh = this._jumpTableService.jumpRefresh; this.runQuery(); - console.log('table has been refreshed in jump-table component'); + //console.log('table has been refreshed in jump-table component'); } } @@ -175,11 +181,11 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe data: jump }); dialogRef.afterClosed().pipe(take(1)) - .subscribe(result => { - if (result != undefined) { - this._onEdit(result); - } - }); + .subscribe(result => { + if (result != undefined) { + this._onEdit(result); + } + }); } getErrorMessage() { @@ -201,19 +207,19 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe try { this.isDeleting = true; this._jumpsService.destroy(slug) - .pipe(take(1)) - .subscribe({ - next: () => { - this._resetErrors(); - this._openSnackBar(`Le saut a été supprimé !`, 'OK'); - this.runQuery(); - this.tableRefresh = !this.tableRefresh; - this._jumpTableService.updateTableRefresh(this.tableRefresh); - }, - error: (err) => { - this.errors = err; - } - }); + .pipe(take(1)) + .subscribe({ + next: () => { + this._resetErrors(); + this._openSnackBar(`Le saut a été supprimé !`, 'OK'); + this.runQuery(); + this.tableRefresh = !this.tableRefresh; + this._jumpTableService.updateTableRefresh(this.tableRefresh); + }, + error: (err) => { + this.errors = err; + } + }); } catch (error) { console.error(error); } @@ -222,22 +228,21 @@ export class JumpTableComponent implements OnChanges, OnDestroy, AfterContentChe private _onEdit(jump: Jump): void { try { this.isSubmitting = true; - console.log(jump); this._jumpsService.update(jump) - .pipe(take(1)) - .subscribe({ - next: (jump) => { - this._resetErrors(); - this._openSnackBar(`Le saut n°${jump.numero} a été mis à jour !`, 'OK'); - this.runQuery(); - this.tableRefresh = !this.tableRefresh; - this._jumpTableService.updateTableRefresh(this.tableRefresh); - }, - error: (err) => { - this.errors = err; - this.isSubmitting = false; - } - }); + .pipe(take(1)) + .subscribe({ + next: (jump) => { + this._resetErrors(); + this._openSnackBar(`Le saut n°${jump.numero} a été mis à jour !`, 'OK'); + this.runQuery(); + this.tableRefresh = !this.tableRefresh; + this._jumpTableService.updateTableRefresh(this.tableRefresh); + }, + error: (err) => { + this.errors = err; + this.isSubmitting = false; + } + }); } catch (error) { console.error(error); }