Compare commits

...
Author SHA1 Message Date
snyk-bot b60251e7b8 fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AXIOS-1579269
2021-09-06 01:31:47 +00:00
B.Fatih KOZandNabeel S 6eef246b6a Improve Map features (GeoJson) (#1290)
* Update GeoService.php

Replace double name usage with more valuable info

* Update GeoService.php

Changed `GS` with `Spd` 'cause it may be IAS or GS according to the phase of the flight.

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-08-30 13:00:27 -04:00
B.Fatih KOZandNabeel S fc8ca69729 Fix Private Profile fields not being editable (#1289)
* Update ProfileController.php

* Update UserRepository.php

* Update UserRepository.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-08-30 12:55:33 -04:00
B.Fatih KOZ 57277c558d Fix Fare not properly set in controller (#1291)
* Update FareService.php

* Update PirepController.php

Move the logic to controller as requested

* Update FareService.php

Reverting back the service changes as requested

* StyleFix
2021-08-30 12:50:04 -04:00
6 changed files with 25 additions and 19 deletions
@@ -9,6 +9,7 @@ use App\Models\Enums\PirepSource;
use App\Models\Enums\PirepState;
use App\Models\Pirep;
use App\Models\PirepComment;
use App\Models\PirepFare;
use App\Repositories\AircraftRepository;
use App\Repositories\AirlineRepository;
use App\Repositories\AirportRepository;
@@ -151,10 +152,10 @@ class PirepController extends Controller
$count = $request->input($field_name);
}
$fares[] = [
$fares[] = new PirepFare([
'fare_id' => $fare->id,
'count' => $count,
];
]);
}
$this->fareSvc->saveForPirep($pirep, $fares);
@@ -123,7 +123,7 @@ class ProfileController extends Controller
$airlines = $this->airlineRepo->selectBoxList();
$airports = $this->airportRepo->selectBoxList(false, setting('pilots.home_hubs_only'));
$userFields = $this->userRepo->getUserFields($user, true);
$userFields = $this->userRepo->getUserFields($user);
return view('profile.edit', [
'user' => $user,
+7 -2
View File
@@ -36,9 +36,14 @@ class UserRepository extends Repository
*
* @return \App\Models\UserField[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection
*/
public function getUserFields(User $user, $only_public_fields = true): Collection
public function getUserFields(User $user, $only_public_fields = null): Collection
{
$fields = UserField::where(['private' => !$only_public_fields])->get();
if (is_bool($only_public_fields)) {
$fields = UserField::where(['private' => !$only_public_fields])->get();
} else {
$fields = UserField::get();
}
return $fields->map(function ($field, $_) use ($user) {
foreach ($user->fields as $userFieldValue) {
if ($userFieldValue->field->slug === $field->slug) {
+3 -3
View File
@@ -309,7 +309,7 @@ class GeoService extends Service
foreach ($all_route_points as $point) {
$route->addPoint($point->lat, $point->lon, [
'name' => $point->name,
'popup' => $point->name.' ('.$point->name.')',
'popup' => $point->name.' ('.$point->lat.', '.$point->lon.')',
'icon' => '',
]);
}
@@ -351,7 +351,7 @@ class GeoService extends Service
foreach ($planned_route as $point) {
$planned->addPoint($point->lat, $point->lon, [
'name' => $point->name,
'popup' => $point->name.' ('.$point->name.')',
'popup' => $point->name.' ('.$point->lat.', '.$point->lon.')',
]);
}
@@ -369,7 +369,7 @@ class GeoService extends Service
$actual->addPoint($point->lat, $point->lon, [
'pirep_id' => $pirep->id,
'name' => $point->altitude,
'popup' => 'GS: '.$point->gs.'<br />Alt: '.$point->altitude,
'popup' => 'Spd: '.$point->gs.' kts<br />Alt: '.$point->altitude.' ft<br />Pos: '.$point->lat.', '.$point->lon,
]);
}
+10 -10
View File
@@ -1,5 +1,5 @@
{
"name": "phpvms",
"name": "npm-proj-1630891903110-0.06417380357287183uaTTYD",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -8,7 +8,7 @@
"@turf/center": "^6.0.1",
"acorn": "^7.4.1",
"animate.css": "~3.6",
"axios": "^0.21.1",
"axios": "^0.21.3",
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",
@@ -2366,11 +2366,11 @@
}
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"dependencies": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.0"
}
},
"node_modules/axobject-query": {
@@ -15927,11 +15927,11 @@
"dev": true
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"requires": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.0"
}
},
"axobject-query": {
+1 -1
View File
@@ -13,7 +13,7 @@
"@turf/center": "^6.0.1",
"acorn": "^7.4.1",
"animate.css": "~3.6",
"axios": "^0.21.1",
"axios": "^0.21.3",
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",