Check sur l'ajout de sauts
et retrie du table des DZ sur le set/unset de favoris
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -52,10 +52,18 @@ export class ListOfDzsComponent implements OnInit {
|
|||||||
|
|
||||||
public setToFavorite(dropzone: DropZoneResp) {
|
public setToFavorite(dropzone: DropZoneResp) {
|
||||||
dropzone.isFavorite = this.serviceApi.SetFavoriteDropZone(dropzone);
|
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) {
|
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() {
|
openDialogToAdd() {
|
||||||
|
|||||||
@@ -76,9 +76,13 @@ export class NewJumpComponent implements OnInit {
|
|||||||
public isValidatedForm(): boolean {
|
public isValidatedForm(): boolean {
|
||||||
return (
|
return (
|
||||||
this.selectedDz !== undefined &&
|
this.selectedDz !== undefined &&
|
||||||
|
this.selectedDz.id !== undefined &&
|
||||||
this.selectedGear !== undefined &&
|
this.selectedGear !== undefined &&
|
||||||
|
this.selectedGear.id !== undefined &&
|
||||||
this.selectedAircraft !== undefined &&
|
this.selectedAircraft !== undefined &&
|
||||||
|
this.selectedAircraft.id !== undefined &&
|
||||||
this.selectedJumpType !== undefined &&
|
this.selectedJumpType !== undefined &&
|
||||||
|
this.selectedJumpType.id !== undefined &&
|
||||||
this.exitAltitude !== undefined &&
|
this.exitAltitude !== undefined &&
|
||||||
isNumber(this.exitAltitude) &&
|
isNumber(this.exitAltitude) &&
|
||||||
this.deployAltitude !== undefined &&
|
this.deployAltitude !== undefined &&
|
||||||
|
|||||||
Reference in New Issue
Block a user