Fix css
Fix the page view
This commit is contained in:
@@ -36,11 +36,11 @@ class PickDateAdapter extends NativeDateAdapter {
|
||||
]
|
||||
})
|
||||
export class NewTunnelFlightComponent implements OnInit {
|
||||
public beginDate: Date;
|
||||
public endDate: Date;
|
||||
public flightDate: Date;
|
||||
public minutesOfFlight: number;
|
||||
public selectedTunnel: TunnelResp;
|
||||
public listOfTunnel: Array<TunnelResp>;
|
||||
public listOfFilteredTunnel: Array<TunnelResp>;
|
||||
public resetForm: boolean;
|
||||
public comments: string;
|
||||
private countDatasLoaded: number;
|
||||
@@ -49,7 +49,6 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceTunnel: TunnelService,
|
||||
private serviceTunnelFlight: TunnelFlightService,
|
||||
private dateService: DateService,
|
||||
private translateService: TranslateService,
|
||||
private statsService: StatsService) { }
|
||||
|
||||
@@ -70,7 +69,7 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
this.pendingAddRequest = true;
|
||||
|
||||
this.serviceTunnelFlight.addFlight(this.selectedTunnel.id,
|
||||
this.beginDate,
|
||||
this.flightDate,
|
||||
this.minutesOfFlight,
|
||||
this.comments)
|
||||
.subscribe(() => {
|
||||
@@ -95,12 +94,14 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
this.serviceTunnel.getListOfTunnels().subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfTunnel = data;
|
||||
this.listOfFilteredTunnel = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
public notLoadingToDisplay(): boolean {
|
||||
return !(this.pendingAddRequest || this.countDatasLoaded !== 1);
|
||||
// return !(this.pendingAddRequest || this.countDatasLoaded > 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
@@ -110,12 +111,29 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
}
|
||||
|
||||
private initForm() {
|
||||
this.endDate = new Date();
|
||||
this.endDate.setHours(0, 0, 0, 0);
|
||||
this.beginDate = this.dateService.AddDays(this.endDate, -1);
|
||||
this.flightDate = new Date();
|
||||
this.flightDate.setHours(0, 0, 0, 0);
|
||||
|
||||
this.minutesOfFlight = 1;
|
||||
this.selectedTunnel = undefined;
|
||||
this.comments = undefined;
|
||||
}
|
||||
|
||||
public resetTunnel() {
|
||||
this.selectedTunnel = undefined;
|
||||
this.onChangeTunnel('');
|
||||
}
|
||||
|
||||
public onChangeTunnel(event: any) {
|
||||
let filterValue: string;
|
||||
|
||||
if (event.id === undefined) {
|
||||
filterValue = event.toLowerCase();
|
||||
|
||||
this.listOfFilteredTunnel = this.listOfTunnel;
|
||||
this.listOfFilteredTunnel = this.listOfFilteredTunnel.filter((option) =>
|
||||
option.name.toLowerCase().includes(filterValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user