Update with NPM
Fix css and function name
This commit is contained in:
Binary file not shown.
Binary file not shown.
4989
Front/skydivelogs-app/package-lock.json
generated
4989
Front/skydivelogs-app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,35 +12,35 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^8.2.10",
|
||||
"@angular/animations": "^8.2.14",
|
||||
"@angular/cdk": "~8.2.3",
|
||||
"@angular/common": "^8.2.10",
|
||||
"@angular/compiler": "^8.2.10",
|
||||
"@angular/core": "^8.2.10",
|
||||
"@angular/forms": "^8.2.10",
|
||||
"@angular/common": "^8.2.14",
|
||||
"@angular/compiler": "^8.2.14",
|
||||
"@angular/core": "^8.2.14",
|
||||
"@angular/forms": "^8.2.14",
|
||||
"@angular/material": "^8.2.3",
|
||||
"@angular/platform-browser": "^8.2.10",
|
||||
"@angular/platform-browser-dynamic": "^8.2.10",
|
||||
"@angular/router": "^8.2.10",
|
||||
"core-js": "^2.4.1",
|
||||
"@angular/platform-browser": "^8.2.14",
|
||||
"@angular/platform-browser-dynamic": "^8.2.14",
|
||||
"@angular/router": "^8.2.14",
|
||||
"core-js": "^2.6.11",
|
||||
"hammerjs": "^2.0.8",
|
||||
"rxjs": "^6.5.3",
|
||||
"rxjs-compat": "^6.0.0-rc.0",
|
||||
"rxjs": "^6.5.4",
|
||||
"rxjs-compat": "^6.5.4",
|
||||
"tslib": "^1.10.0",
|
||||
"zone.js": "~0.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.803.8",
|
||||
"@angular/cli": "^8.3.8",
|
||||
"@angular/compiler-cli": "^8.2.10",
|
||||
"@angular/language-service": "^8.2.10",
|
||||
"@angular-devkit/build-angular": "^0.803.22",
|
||||
"@angular/cli": "^8.3.22",
|
||||
"@angular/compiler-cli": "^8.2.14",
|
||||
"@angular/language-service": "^8.2.14",
|
||||
"@types/jasmine": "~2.8.3",
|
||||
"@types/jasminewd2": "~2.0.2",
|
||||
"@types/jasminewd2": "^2.0.8",
|
||||
"@types/node": "~6.0.60",
|
||||
"codelyzer": "^5.0.1",
|
||||
"codelyzer": "^5.2.1",
|
||||
"jasmine-core": "~2.8.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "^4.3.0",
|
||||
"karma": "^4.4.1",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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) { }
|
||||
|
||||
@@ -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;
|
||||
@@ -21,6 +21,6 @@ export class SummaryComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle("Summary");
|
||||
this.serviceComm.UpdatedComponentTitle('Summary');
|
||||
}
|
||||
}
|
||||
|
||||
8
Front/skydivelogs-app/src/models/add-action.enum.ts
Normal file
8
Front/skydivelogs-app/src/models/add-action.enum.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export enum AddAction {
|
||||
None,
|
||||
JumpType,
|
||||
Jump,
|
||||
Aircraft,
|
||||
Gear,
|
||||
Dropzone
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { JumpReq } from '../models/jump';
|
||||
import { environment } from '../environments/environment';
|
||||
import { DateService } from './date.service';
|
||||
import { AircraftReq } from '../models/aircraft';
|
||||
import { GearReq } from '../models/gear';
|
||||
|
||||
@Injectable()
|
||||
export class ServiceApiPost {
|
||||
@@ -105,4 +106,29 @@ export class ServiceApiPost {
|
||||
})
|
||||
.subscribe(data => console.log(data));
|
||||
}
|
||||
|
||||
public AddGear(name: string,
|
||||
manufacturer: string,
|
||||
minSize: number,
|
||||
maxSize: number,
|
||||
aad: string,
|
||||
mainCanopy: string,
|
||||
reserveCanopy: string) {
|
||||
const bodyNewGear: GearReq = {
|
||||
id: 0,
|
||||
name: name,
|
||||
manufacturer: manufacturer,
|
||||
minSize: minSize,
|
||||
maxSize: maxSize,
|
||||
aad: aad,
|
||||
mainCanopy: mainCanopy,
|
||||
reserveCanopy: reserveCanopy
|
||||
};
|
||||
|
||||
this.http
|
||||
.post(`${environment.urlApi}/api/Gear`, bodyNewGear, {
|
||||
headers: this.headers
|
||||
})
|
||||
.subscribe(data => console.log(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { AddAction } from '../models/add-action.enum';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class ServiceComm {
|
||||
private componentTitleSource = new BehaviorSubject<string>('');
|
||||
componentTitle = this.componentTitleSource.asObservable();
|
||||
|
||||
private refreshRequestSource = new BehaviorSubject<AddAction>(AddAction.None);
|
||||
refreshRequest = this.refreshRequestSource.asObservable();
|
||||
|
||||
constructor() { }
|
||||
|
||||
updatedComponentTitle(title: string) {
|
||||
UpdatedComponentTitle(title: string) {
|
||||
this.componentTitleSource.next(title);
|
||||
}
|
||||
|
||||
RefreshData(refreshAfter: AddAction) {
|
||||
this.refreshRequestSource.next(refreshAfter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ body {
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
/* margin: 0; */
|
||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user