Fix css
Fix the page view
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</mat-form-field>
|
||||
</p>
|
||||
|
||||
<button mat-button color="warn" type="submit">
|
||||
<button mat-icon-button color="warn" type="submit">
|
||||
<mat-icon>file_upload</mat-icon>
|
||||
Upload image
|
||||
</button>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{jumpType.name}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<button mat-button *ngIf="selectedJumpType" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="selectedJumpType" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="selectedJumpType=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
@@ -28,7 +28,7 @@
|
||||
{{aircraft.name}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<button mat-button *ngIf="selectedAircraft" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="selectedAircraft" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="selectedAircraft=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
@@ -45,7 +45,7 @@
|
||||
favorite</mat-icon>
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<button mat-button *ngIf="selectedDz" matSuffix mat-icon-button aria-label="Clear" (click)="resetDz()">
|
||||
<button *ngIf="selectedDz" matSuffix mat-icon-button aria-label="Clear" (click)="resetDz()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
@@ -58,7 +58,7 @@
|
||||
{{gear.name}} ({{gear.mainCanopy}})
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<button mat-button *ngIf="selectedGear" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="selectedGear" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="selectedGear=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
@@ -82,14 +82,14 @@
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{ 'NewJump_ExitAlt' | translate }}" [(ngModel)]="exitAltitude" name="exitAltitude" type="number">
|
||||
<button mat-button *ngIf="exitAltitude" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="exitAltitude" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="exitAltitude=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{ 'NewJump_DeployAlt' | translate }}" [(ngModel)]="deployAltitude" name="deployAltitude" type="number">
|
||||
<button mat-button *ngIf="deployAltitude" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="deployAltitude" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="deployAltitude=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{ 'NewJump_Count' | translate }}" [(ngModel)]="countOfJumps" name="countOfJumps" type="number">
|
||||
<button mat-button *ngIf="countOfJumps" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="countOfJumps" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="countOfJumps=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<textarea matInput placeholder="{{ 'NewJump_Comments' | translate }}" [(ngModel)]="comments" name="comments" type="text"></textarea>
|
||||
<button mat-button *ngIf="comments" matSuffix mat-icon-button aria-label="Clear"
|
||||
<button *ngIf="comments" matSuffix mat-icon-button aria-label="Clear"
|
||||
(click)="comments=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
|
||||
@@ -1,12 +1,48 @@
|
||||
<div class="content">
|
||||
|
||||
<form class="formNewJumps" (ngSubmit)="onFormSubmit()" *ngIf="notLoadingToDisplay() else loading">
|
||||
<form class="formNewJumps" (ngSubmit)="onFormSubmit()" *ngIf="notLoadingToDisplay() else loading">
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'NewTunnelFlight_ChooseTunnel' | translate }}</mat-label>
|
||||
<input type="text" matInput [matAutocomplete]="autoDropZone" [(ngModel)]="selectedTunnel"
|
||||
(ngModelChange)="onChangeTunnel($event)" name="selectedTunnel">
|
||||
<mat-autocomplete #autoDropZone="matAutocomplete" [displayWith]="displayNameFn">
|
||||
<mat-option *ngFor="let tunnel of listOfFilteredTunnel" [value]="tunnel">
|
||||
{{tunnel.name}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<button *ngIf="selectedTunnel" matSuffix mat-icon-button aria-label="Clear" (click)="resetTunnel()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
||||
<br />
|
||||
<button mat-raised-button color="accent" *ngIf="isValidatedForm()">{{ 'NewJump_Submit' | translate }}</button>
|
||||
</form>
|
||||
|
||||
<ng-template #loading>
|
||||
<mat-progress-spinner [mode]="'indeterminate'"></mat-progress-spinner>
|
||||
</ng-template>
|
||||
<mat-form-field>
|
||||
<input matInput [matDatepicker]="flightDateDp" [(ngModel)]="flightDate" name="flightDate" disabled>
|
||||
<mat-datepicker-toggle matSuffix [for]="flightDateDp"></mat-datepicker-toggle>
|
||||
<mat-datepicker #flightDateDp disabled="false"></mat-datepicker>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{ 'NewTunnelFlight_Minutes' | translate }}" [(ngModel)]="minutesOfFlight"
|
||||
name="minutesOfFlight" type="number">
|
||||
<button *ngIf="minutesOfFlight" matSuffix mat-icon-button aria-label="Clear" (click)="minutesOfFlight=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<textarea matInput placeholder="{{ 'NewTunnelFlight_Comments' | translate }}" [(ngModel)]="comments"
|
||||
name="comments" type="text"></textarea>
|
||||
<button *ngIf="comments" matSuffix mat-icon-button aria-label="Clear" (click)="comments=undefined">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
||||
<br />
|
||||
<button mat-raised-button color="accent" *ngIf="isValidatedForm()">{{ 'NewTunnelFlight_Submit' | translate
|
||||
}}</button>
|
||||
</form>
|
||||
|
||||
<ng-template #loading>
|
||||
<mat-progress-spinner [mode]="'indeterminate'"></mat-progress-spinner>
|
||||
</ng-template>
|
||||
</div>
|
||||
@@ -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