File ClientApp/src/app/app.error-handler.ts changed (mode: 100644) (index 8a2708c..c4c683a) |
1 |
1 |
import { ErrorHandler, Inject, NgZone, isDevMode } from '@angular/core'; |
import { ErrorHandler, Inject, NgZone, isDevMode } from '@angular/core'; |
2 |
2 |
import { ToastaService } from 'ngx-toasta'; |
import { ToastaService } from 'ngx-toasta'; |
|
3 |
|
import * as Sentry from "@sentry/browser"; |
|
4 |
|
|
|
5 |
|
Sentry.init({ |
|
6 |
|
dsn: "https://c9ee4ff5fda2430d931b499039230d1a@sentry.io/1371113" |
|
7 |
|
}); |
3 |
8 |
|
|
4 |
9 |
export class AppErrorHandler implements ErrorHandler { |
export class AppErrorHandler implements ErrorHandler { |
5 |
10 |
|
|
|
... |
... |
export class AppErrorHandler implements ErrorHandler { |
10 |
15 |
|
|
11 |
16 |
handleError(error: any): void { |
handleError(error: any): void { |
12 |
17 |
if (!isDevMode()) { |
if (!isDevMode()) { |
13 |
|
//ToDo Log errors |
|
|
18 |
|
Sentry.captureException(error.originalError || error); |
14 |
19 |
} |
} |
15 |
20 |
else { |
else { |
16 |
21 |
|
|
File ClientApp/src/app/app.module.ts changed (mode: 100644) (index c55893a..c3cfbf9) |
... |
... |
import { AppErrorHandler } from './app.error-handler'; |
36 |
36 |
{ path: 'counter', component: CounterComponent },
|
{ path: 'counter', component: CounterComponent },
|
37 |
37 |
{ path: 'fetch-data', component: FetchDataComponent },
|
{ path: 'fetch-data', component: FetchDataComponent },
|
38 |
38 |
{ path: 'vehicles/new', component: VehiculeFormComponent },
|
{ path: 'vehicles/new', component: VehiculeFormComponent },
|
|
39 |
|
{ path: 'vehicles/:id', component: VehiculeFormComponent },
|
39 |
40 |
])
|
])
|
40 |
41 |
],
|
],
|
41 |
42 |
providers: [
|
providers: [
|
File ClientApp/src/app/services/vehicle.service.ts changed (mode: 100644) (index 6d5c0b8..2f40bfe) |
... |
... |
import { map } from 'rxjs/operators'; |
4 |
4 |
|
|
5 |
5 |
@Injectable() |
@Injectable() |
6 |
6 |
export class VehicleService { |
export class VehicleService { |
7 |
|
|
|
|
7 |
|
|
8 |
8 |
constructor(private http: Http) { } |
constructor(private http: Http) { } |
9 |
9 |
|
|
10 |
10 |
getMakes(){ |
getMakes(){ |
|
... |
... |
export class VehicleService { |
21 |
21 |
return this.http.post('/api/vehicles', vehicle) |
return this.http.post('/api/vehicles', vehicle) |
22 |
22 |
.pipe(map((res: any) => res.json())); |
.pipe(map((res: any) => res.json())); |
23 |
23 |
} |
} |
|
24 |
|
|
|
25 |
|
getVehicle(id) { |
|
26 |
|
return this.http.get('/api/vehicles/' + id) |
|
27 |
|
.pipe(map((res: any) => res.json())); |
|
28 |
|
} |
24 |
29 |
} |
} |
File ClientApp/src/app/vehicule-form/vehicule-form.component.ts changed (mode: 100644) (index 0e35de0..858da92) |
1 |
1 |
import { VehicleService } from '../services/vehicle.service'; |
import { VehicleService } from '../services/vehicle.service'; |
2 |
2 |
import { Component, OnInit } from '@angular/core'; |
import { Component, OnInit } from '@angular/core'; |
|
3 |
|
import { Router, ActivatedRoute } from '@angular/router'; |
3 |
4 |
|
|
4 |
5 |
@Component({ |
@Component({ |
5 |
6 |
selector: 'app-vehicule-form', |
selector: 'app-vehicule-form', |
|
... |
... |
export class VehiculeFormComponent implements OnInit { |
15 |
16 |
models: any[]; |
models: any[]; |
16 |
17 |
features: any[]; |
features: any[]; |
17 |
18 |
|
|
18 |
|
constructor(private vehicleService: VehicleService) { } |
|
|
19 |
|
constructor( |
|
20 |
|
private vehicleService: VehicleService, |
|
21 |
|
private router: Router, |
|
22 |
|
private route: ActivatedRoute) { |
|
23 |
|
route.params.subscribe(p => { |
|
24 |
|
this.vehicle.id = +p['id']; |
|
25 |
|
}) |
|
26 |
|
} |
19 |
27 |
|
|
20 |
28 |
ngOnInit() { |
ngOnInit() { |
21 |
|
this.vehicleService.getMakes().subscribe(makes => |
|
|
29 |
|
this.vehicleService.getVehicle(this.vehicle.id) |
|
30 |
|
.subscribe(v => { |
|
31 |
|
this.vehicle = v; |
|
32 |
|
}, err => { |
|
33 |
|
if (err.status == 404) |
|
34 |
|
this.router.navigate(['/home']); |
|
35 |
|
}); |
|
36 |
|
|
|
37 |
|
this.vehicleService.getMakes() |
|
38 |
|
.subscribe(makes => |
22 |
39 |
this.makes = makes); |
this.makes = makes); |
23 |
40 |
|
|
24 |
|
this.vehicleService.getFeatures().subscribe(features => |
|
25 |
|
this.features = features); |
|
|
41 |
|
this.vehicleService.getFeatures() |
|
42 |
|
.subscribe(features => |
|
43 |
|
this.features = features); |
26 |
44 |
} |
} |
27 |
45 |
|
|
28 |
46 |
onMakeChange(){ |
onMakeChange(){ |
File package-lock.json added (mode: 100644) (index 0000000..2475833) |
|
1 |
|
{ |
|
2 |
|
"requires": true, |
|
3 |
|
"lockfileVersion": 1, |
|
4 |
|
"dependencies": { |
|
5 |
|
"@sentry/browser": { |
|
6 |
|
"version": "4.5.3", |
|
7 |
|
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-4.5.3.tgz", |
|
8 |
|
"integrity": "sha512-ePbsyXtZS9jWM0lD8rxA46omJjJcQPaRZak08TyxFBGm1YOUFvvNAA6rNjUtK4fFEznLhPA5YcllcOCBE2bPPg==", |
|
9 |
|
"requires": { |
|
10 |
|
"@sentry/core": "4.5.3", |
|
11 |
|
"@sentry/types": "4.5.3", |
|
12 |
|
"@sentry/utils": "4.5.3", |
|
13 |
|
"tslib": "^1.9.3" |
|
14 |
|
}, |
|
15 |
|
"dependencies": { |
|
16 |
|
"@sentry/core": { |
|
17 |
|
"version": "4.5.3", |
|
18 |
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.5.3.tgz", |
|
19 |
|
"integrity": "sha512-off7XkyyiPXJTQ1XYPzxsY3zLHztMdK1kuIeHzyoIzu4kvs8H75eqou+fADo04JmfaMNy+OZSoW+5Aq2SZR2Ng==", |
|
20 |
|
"requires": { |
|
21 |
|
"@sentry/hub": "4.5.3", |
|
22 |
|
"@sentry/minimal": "4.5.3", |
|
23 |
|
"@sentry/types": "4.5.3", |
|
24 |
|
"@sentry/utils": "4.5.3", |
|
25 |
|
"tslib": "^1.9.3" |
|
26 |
|
} |
|
27 |
|
}, |
|
28 |
|
"@sentry/hub": { |
|
29 |
|
"version": "4.5.3", |
|
30 |
|
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.5.3.tgz", |
|
31 |
|
"integrity": "sha512-4b8oPVAGw/hf11CQN9J7hAk2wzD2HIZsQBl/PcB/p5r1UyHw8cibpVobJulkHJMBJMiZ/twIBGZ1G1qK3LJdhw==", |
|
32 |
|
"requires": { |
|
33 |
|
"@sentry/types": "4.5.3", |
|
34 |
|
"@sentry/utils": "4.5.3", |
|
35 |
|
"tslib": "^1.9.3" |
|
36 |
|
} |
|
37 |
|
}, |
|
38 |
|
"@sentry/minimal": { |
|
39 |
|
"version": "4.5.3", |
|
40 |
|
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.5.3.tgz", |
|
41 |
|
"integrity": "sha512-W9+eEZosoDKTAJkab/bxsSRim7I4lqeWHLhmCchDimKcdmpBzC+gOCT0PywwOWRLW08LhTHfmnNSAJv6PaZiCA==", |
|
42 |
|
"requires": { |
|
43 |
|
"@sentry/hub": "4.5.3", |
|
44 |
|
"@sentry/types": "4.5.3", |
|
45 |
|
"tslib": "^1.9.3" |
|
46 |
|
} |
|
47 |
|
}, |
|
48 |
|
"@sentry/types": { |
|
49 |
|
"version": "4.5.3", |
|
50 |
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.5.3.tgz", |
|
51 |
|
"integrity": "sha512-7ll1PAFNjrBNX9rzy3P2qAQrpQwHaDO3uKj735qsnGw34OtAS8Xr8WYrjI14f9fMPa/XIeWvMPb4GMic28V/ag==" |
|
52 |
|
}, |
|
53 |
|
"@sentry/utils": { |
|
54 |
|
"version": "4.5.3", |
|
55 |
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.5.3.tgz", |
|
56 |
|
"integrity": "sha512-yIYqnuq9cd9nAUJ2MPmq++Mgy81qB2fglsDB8TiBfk2eaba79qFcKp8xg3w3EMDHZMlfmlx4fkTmZJ/+V02oWQ==", |
|
57 |
|
"requires": { |
|
58 |
|
"@sentry/types": "4.5.3", |
|
59 |
|
"tslib": "^1.9.3" |
|
60 |
|
} |
|
61 |
|
} |
|
62 |
|
} |
|
63 |
|
}, |
|
64 |
|
"@sentry/core": { |
|
65 |
|
"version": "4.5.1", |
|
66 |
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.5.1.tgz", |
|
67 |
|
"integrity": "sha512-ml4Z1PZ7GjsJip5vYkRMkqCLpK5u3jxUYtECOWVsYHIHgVlvERV+HWCdyH0PoiEwr97ZU+4mjnc9Av8P7a18Mw==", |
|
68 |
|
"requires": { |
|
69 |
|
"@sentry/hub": "4.5.1", |
|
70 |
|
"@sentry/minimal": "4.5.1", |
|
71 |
|
"@sentry/types": "4.5.0", |
|
72 |
|
"@sentry/utils": "4.5.1", |
|
73 |
|
"tslib": "^1.9.3" |
|
74 |
|
} |
|
75 |
|
}, |
|
76 |
|
"@sentry/hub": { |
|
77 |
|
"version": "4.5.1", |
|
78 |
|
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.5.1.tgz", |
|
79 |
|
"integrity": "sha512-msftpMDSvWaENdYMHX8GPBQ5jTLxClWCprtAlE0AFZ90WHFrwvA0bHpGLzseFDjYwGUKoG2psxejoSstoBy53A==", |
|
80 |
|
"requires": { |
|
81 |
|
"@sentry/types": "4.5.0", |
|
82 |
|
"@sentry/utils": "4.5.1", |
|
83 |
|
"tslib": "^1.9.3" |
|
84 |
|
} |
|
85 |
|
}, |
|
86 |
|
"@sentry/minimal": { |
|
87 |
|
"version": "4.5.1", |
|
88 |
|
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.5.1.tgz", |
|
89 |
|
"integrity": "sha512-/PaBrzuGkL6c137KRz5iIpmIfCj1FY/rYOffBAYrZADmmZyVrHfP2cNreneze+9OYy5dCFylBFEQpNOCMDdARw==", |
|
90 |
|
"requires": { |
|
91 |
|
"@sentry/hub": "4.5.1", |
|
92 |
|
"@sentry/types": "4.5.0", |
|
93 |
|
"tslib": "^1.9.3" |
|
94 |
|
} |
|
95 |
|
}, |
|
96 |
|
"@sentry/types": { |
|
97 |
|
"version": "4.5.0", |
|
98 |
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.5.0.tgz", |
|
99 |
|
"integrity": "sha512-IstPjFoebQGrQWdM732D/+S0BTovmDgezyplk4kLEb87+/B+YK0hlhziUa7B2byTFJGgQQKXy7h2sKZBrA3GUA==" |
|
100 |
|
}, |
|
101 |
|
"@sentry/utils": { |
|
102 |
|
"version": "4.5.1", |
|
103 |
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.5.1.tgz", |
|
104 |
|
"integrity": "sha512-ihzvgKBuvHBjKtbjz3EtuTW0OAJH5nw1L3tNVOCi+fbEdp10DiyL0i3hQKdE87CLoNEAt/SPRmTrG1cP2dNa7Q==", |
|
105 |
|
"requires": { |
|
106 |
|
"@sentry/types": "4.5.0", |
|
107 |
|
"tslib": "^1.9.3" |
|
108 |
|
} |
|
109 |
|
}, |
|
110 |
|
"tslib": { |
|
111 |
|
"version": "1.9.3", |
|
112 |
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", |
|
113 |
|
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" |
|
114 |
|
} |
|
115 |
|
} |
|
116 |
|
} |