Possibilité d'éditer un saut (sur 3 infos)

Indication d'un saut est spécial.
This commit is contained in:
Sébastien André
2021-04-21 15:18:40 +02:00
parent 69c49ab011
commit a2ea873ae3
11 changed files with 110 additions and 42 deletions

View File

@@ -8,6 +8,7 @@ import { JumpResp } from '../../models/jump';
import { JumpService } from '../../services/jump.service';
import { ServiceComm } from '../../services/service-comm.service';
import { JumpInfosComponent } from "../jump-infos/jump-infos.component";
import { AddAction } from '../../models/add-action.enum';
@Component({
selector: 'app-list-of-jumps',
@@ -34,12 +35,18 @@ export class ListOfJumpsComponent implements OnInit {
public dialog: MatDialog) { }
ngOnInit() {
this.serviceComm.refreshRequest.subscribe(action => {
if (action === AddAction.Jump) {
this.dialog.closeAll();
this.getListOfJumps();
}
});
this.serviceComm.UpdatedComponentTitle('List of jumps');
this.getListOfJumps();
}
getListOfJumps() {
this.listOfJumps = this.serviceApi.getListOfJumps();
this.listOfJumps = this.serviceApi.GetListOfJumps();
this.listOfJumps.subscribe(data => {
setTimeout(() => {
data.sort((a, b) => b.jumpDate.getTime() - a.jumpDate.getTime());
@@ -50,10 +57,16 @@ export class ListOfJumpsComponent implements OnInit {
});
}
openDialog(item: JumpResp) {
this.dialog.open(JumpInfosComponent, {
data: item
});
openDialog(item: JumpResp, editMode: boolean) {
this.dialog.open(JumpInfosComponent,
{ data: { "jump": item, "editMode": editMode},
maxHeight: "400px",
minWidth: "350px"
});
}
toShow(item: JumpResp) {
return item.withCutaway === true || item.notes != undefined;
}
delete(item: JumpResp) {