Check sur l'ajout de sauts
et retrie du table des DZ sur le set/unset de favoris
This commit is contained in:
@@ -52,10 +52,18 @@ export class ListOfDzsComponent implements OnInit {
|
||||
|
||||
public setToFavorite(dropzone: DropZoneResp) {
|
||||
dropzone.isFavorite = this.serviceApi.SetFavoriteDropZone(dropzone);
|
||||
const data = this.dataSourceTable.data;
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
|
||||
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
}
|
||||
|
||||
public removeToFavorite(dropzone: DropZoneResp) {
|
||||
dropzone.isFavorite = this.serviceApi.RemoveFavoriteDropZone(dropzone);
|
||||
dropzone.isFavorite = !this.serviceApi.RemoveFavoriteDropZone(dropzone);
|
||||
const data = this.dataSourceTable.data;
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
|
||||
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
}
|
||||
|
||||
openDialogToAdd() {
|
||||
|
||||
@@ -76,9 +76,13 @@ export class NewJumpComponent implements OnInit {
|
||||
public isValidatedForm(): boolean {
|
||||
return (
|
||||
this.selectedDz !== undefined &&
|
||||
this.selectedDz.id !== undefined &&
|
||||
this.selectedGear !== undefined &&
|
||||
this.selectedGear.id !== undefined &&
|
||||
this.selectedAircraft !== undefined &&
|
||||
this.selectedAircraft.id !== undefined &&
|
||||
this.selectedJumpType !== undefined &&
|
||||
this.selectedJumpType.id !== undefined &&
|
||||
this.exitAltitude !== undefined &&
|
||||
isNumber(this.exitAltitude) &&
|
||||
this.deployAltitude !== undefined &&
|
||||
|
||||
Reference in New Issue
Block a user