Ajout d'un loading sur la page Summary
This commit is contained in:
@@ -10,5 +10,6 @@
|
|||||||
<WebStackScaffolding_LayoutPageFile />
|
<WebStackScaffolding_LayoutPageFile />
|
||||||
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
||||||
<NameOfLastUsedPublishProfile>skydiveLogsApi - Web Deploy</NameOfLastUsedPublishProfile>
|
<NameOfLastUsedPublishProfile>skydiveLogsApi - Web Deploy</NameOfLastUsedPublishProfile>
|
||||||
|
<ShowAllFiles>false</ShowAllFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -43,10 +43,10 @@ export class NewJumpComponent implements OnInit {
|
|||||||
private serviceDropzone: DropzoneService,
|
private serviceDropzone: DropzoneService,
|
||||||
private serviceGear: GearService,
|
private serviceGear: GearService,
|
||||||
private dateService: DateService
|
private dateService: DateService
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.serviceComm.UpdatedComponentTitle("Add a new jump");
|
this.serviceComm.UpdatedComponentTitle('Add a new jump');
|
||||||
|
|
||||||
this.endDate = new Date();
|
this.endDate = new Date();
|
||||||
this.beginDate = this.dateService.AddDays(new Date(), -1);
|
this.beginDate = this.dateService.AddDays(new Date(), -1);
|
||||||
@@ -136,6 +136,6 @@ export class NewJumpComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public allDatasLoaded(): boolean {
|
public allDatasLoaded(): boolean {
|
||||||
return this.countDatasLoaded == 4;
|
return this.countDatasLoaded === 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
<div>
|
<div *ngIf="allDatasLoaded() else loading">
|
||||||
|
<div>
|
||||||
<label>Total jumps</label>
|
<label>Total jumps</label>
|
||||||
Total Total
|
Total Total
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>Total cutaways</label>
|
<label>Total cutaways</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>Last jump</label>
|
<label>Last jump</label>
|
||||||
Date and location
|
Date and location
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>Jumps in the last month</label>
|
<label>Jumps in the last month</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>Jumps in the last year</label>
|
<label>Jumps in the last year</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>By DZ</label>
|
<label>By DZ</label>
|
||||||
<table mat-table [dataSource]="dsNbJumpByDz">
|
<table mat-table [dataSource]="dsNbJumpByDz">
|
||||||
<ng-container matColumnDef="label">
|
<ng-container matColumnDef="label">
|
||||||
@@ -32,9 +33,9 @@
|
|||||||
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>By aircraft</label>
|
<label>By aircraft</label>
|
||||||
<table mat-table [dataSource]="dsNbJumpByAircraft">
|
<table mat-table [dataSource]="dsNbJumpByAircraft">
|
||||||
<ng-container matColumnDef="label">
|
<ng-container matColumnDef="label">
|
||||||
@@ -46,9 +47,9 @@
|
|||||||
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>By gear</label>
|
<label>By gear</label>
|
||||||
<table mat-table [dataSource]="dsNbJumpByGear">
|
<table mat-table [dataSource]="dsNbJumpByGear">
|
||||||
<ng-container matColumnDef="label">
|
<ng-container matColumnDef="label">
|
||||||
@@ -60,9 +61,9 @@
|
|||||||
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>By jump type</label>
|
<label>By jump type</label>
|
||||||
<table mat-table [dataSource]="dsNbJumpByType">
|
<table mat-table [dataSource]="dsNbJumpByType">
|
||||||
<ng-container matColumnDef="label">
|
<ng-container matColumnDef="label">
|
||||||
@@ -74,9 +75,9 @@
|
|||||||
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<label>By year</label>
|
<label>By year</label>
|
||||||
<table mat-table [dataSource]="dsNbJumpByYear">
|
<table mat-table [dataSource]="dsNbJumpByYear">
|
||||||
<ng-container matColumnDef="label">
|
<ng-container matColumnDef="label">
|
||||||
@@ -88,4 +89,9 @@
|
|||||||
|
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ng-template #loading>
|
||||||
|
<mat-progress-spinner [mode]="'indeterminate'"></mat-progress-spinner>
|
||||||
|
</ng-template>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export class SummaryComponent implements OnInit {
|
|||||||
public dsNbJumpByGear;
|
public dsNbJumpByGear;
|
||||||
public dsNbJumpByType;
|
public dsNbJumpByType;
|
||||||
public dsNbJumpByYear;
|
public dsNbJumpByYear;
|
||||||
|
private countDatasLoaded: number;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private serviceApi: StatsService,
|
private serviceApi: StatsService,
|
||||||
@@ -22,24 +23,34 @@ export class SummaryComponent implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.countDatasLoaded = 0;
|
||||||
this.serviceComm.UpdatedComponentTitle('Summary');
|
this.serviceComm.UpdatedComponentTitle('Summary');
|
||||||
|
|
||||||
const statsResult = this.serviceApi.getStatsOfJumps();
|
const statsResult = this.serviceApi.getStatsOfJumps();
|
||||||
|
|
||||||
statsResult.statsByDz.subscribe(data => {
|
statsResult.statsByDz.subscribe(data => {
|
||||||
this.dsNbJumpByDz = new MatTableDataSource(data);
|
this.dsNbJumpByDz = new MatTableDataSource(data);
|
||||||
|
this.countDatasLoaded++;
|
||||||
});
|
});
|
||||||
statsResult.statsByAircraft.subscribe(data => {
|
statsResult.statsByAircraft.subscribe(data => {
|
||||||
this.dsNbJumpByAircraft = new MatTableDataSource(data);
|
this.dsNbJumpByAircraft = new MatTableDataSource(data);
|
||||||
|
this.countDatasLoaded++;
|
||||||
});
|
});
|
||||||
statsResult.statsByGear.subscribe(data => {
|
statsResult.statsByGear.subscribe(data => {
|
||||||
this.dsNbJumpByGear = new MatTableDataSource(data);
|
this.dsNbJumpByGear = new MatTableDataSource(data);
|
||||||
|
this.countDatasLoaded++;
|
||||||
});
|
});
|
||||||
statsResult.statsByJumpType.subscribe(data => {
|
statsResult.statsByJumpType.subscribe(data => {
|
||||||
this.dsNbJumpByType = new MatTableDataSource(data);
|
this.dsNbJumpByType = new MatTableDataSource(data);
|
||||||
|
this.countDatasLoaded++;
|
||||||
});
|
});
|
||||||
statsResult.statsByYear.subscribe(data => {
|
statsResult.statsByYear.subscribe(data => {
|
||||||
this.dsNbJumpByYear = new MatTableDataSource(data);
|
this.dsNbJumpByYear = new MatTableDataSource(data);
|
||||||
|
this.countDatasLoaded++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public allDatasLoaded(): boolean {
|
||||||
|
return this.countDatasLoaded === 5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user