Update with NPM
Fix css and function name
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ServiceComm } from "../services/service-comm.service";
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ServiceComm } from '../services/service-comm.service';
|
||||
|
||||
@Component({
|
||||
selector: "app-root",
|
||||
templateUrl: "./app.component.html",
|
||||
styleUrls: ["./app.component.css"]
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
title = "app";
|
||||
title = 'app';
|
||||
showMenu = false;
|
||||
|
||||
constructor(private serviceComm: ServiceComm) {}
|
||||
constructor(private serviceComm: ServiceComm) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.componentTitle.subscribe(title => (this.title = title));
|
||||
|
||||
@@ -97,7 +97,7 @@ const appRoutes: Routes = [
|
||||
ServiceComm,
|
||||
DateService,
|
||||
RequestCache,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: CachingInterceptor, multi: true }
|
||||
// { provide: HTTP_INTERCEPTORS, useClass: CachingInterceptor, multi: true }
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ListOfAircraftsComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('List of aircrafts');
|
||||
this.serviceComm.UpdatedComponentTitle('List of aircrafts');
|
||||
this.getListOfAircrafts();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.type}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -35,7 +35,7 @@ export class ListOfDzsComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('List of DZs');
|
||||
this.serviceComm.UpdatedComponentTitle('List of DZs');
|
||||
this.getListOfDropZones();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.reserveCanopy}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { MatPaginator, MatTableDataSource } from '@angular/material';
|
||||
import { ServiceApiGet } from '../../services/service-api-get.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { GearResp } from '../../models/gear';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-gears',
|
||||
@@ -31,7 +32,13 @@ export class ListOfGearsComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('List of gears');
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
if (action === AddAction.Gear) {
|
||||
this.getListOfGears();
|
||||
}
|
||||
});
|
||||
this.serviceComm.UpdatedComponentTitle('List of gears');
|
||||
|
||||
this.getListOfGears();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ListOfJumpTypesComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('List of jump types');
|
||||
this.serviceComm.UpdatedComponentTitle('List of jump types');
|
||||
this.getListOfJumpTypes();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<td mat-cell *matCellDef="let element">{{element.gear.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('List of jumps');
|
||||
this.serviceComm.UpdatedComponentTitle('List of jumps');
|
||||
this.getListOfJumps();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ServiceApiPost } from '../../services/service-api-post.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-aircraft',
|
||||
@@ -10,7 +13,8 @@ import { ServiceApiPost } from '../../services/service-api-post.service';
|
||||
export class NewAircraftComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor(private serviceApiPost: ServiceApiPost) {
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceApiPost: ServiceApiPost) {
|
||||
this.addForm = new FormGroup({
|
||||
aircraftName: new FormControl('', Validators.required)
|
||||
});
|
||||
@@ -20,10 +24,9 @@ export class NewAircraftComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSubmit(formData) {
|
||||
console.log(formData.status);
|
||||
console.warn('New data : ', formData);
|
||||
this.serviceApiPost.AddAircraft(formData.value.aircraftName);
|
||||
this.serviceComm.RefreshData(AddAction.Aircraft);
|
||||
|
||||
this.serviceApiPost.AddAircraft(this.addForm.value.aircraftName);
|
||||
this.addForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { ServiceApiPost } from '../../services/service-api-post.service';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-gear',
|
||||
templateUrl: './new-gear.component.html',
|
||||
@@ -9,7 +14,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
export class NewGearComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor() {
|
||||
constructor(private serviceComm: ServiceComm, private servicePost: ServiceApiPost) {
|
||||
this.addForm = new FormGroup({
|
||||
name: new FormControl('', Validators.required),
|
||||
manufacturer: new FormControl('', Validators.required),
|
||||
@@ -25,8 +30,17 @@ export class NewGearComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSubmit(formData) {
|
||||
console.log(formData.status);
|
||||
console.warn('New data : ', formData);
|
||||
this.servicePost.AddGear(
|
||||
formData.value.name,
|
||||
formData.value.manufacturer,
|
||||
formData.value.minSize,
|
||||
formData.value.maxSize,
|
||||
formData.value.aad,
|
||||
formData.value.mainCanopy,
|
||||
formData.value.reserveCanopy
|
||||
);
|
||||
|
||||
this.serviceComm.RefreshData(AddAction.Gear);
|
||||
|
||||
this.addForm.reset();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class NewJumpComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('Add a new jump');
|
||||
this.serviceComm.UpdatedComponentTitle('Add a new jump');
|
||||
|
||||
this.endDate = new Date();
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { ServiceApiGet } from "../../services/service-api-get.service";
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { ServiceApiGet } from '../../services/service-api-get.service';
|
||||
|
||||
@Component({
|
||||
selector: "app-summary",
|
||||
templateUrl: "./summary.component.html",
|
||||
styleUrls: ["./summary.component.css"]
|
||||
selector: 'app-summary',
|
||||
templateUrl: './summary.component.html',
|
||||
styleUrls: ['./summary.component.css']
|
||||
})
|
||||
export class SummaryComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = ["label", "nb"];
|
||||
public displayedColumns: Array<string> = ['label', 'nb'];
|
||||
public dsNbJumpByDz;
|
||||
public dsNbJumpByAircraft;
|
||||
public dsNbJumpByRig;
|
||||
@@ -18,9 +18,9 @@ export class SummaryComponent implements OnInit {
|
||||
constructor(
|
||||
private serviceApi: ServiceApiGet,
|
||||
private serviceComm: ServiceComm
|
||||
) {}
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle("Summary");
|
||||
this.serviceComm.UpdatedComponentTitle('Summary');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user