Compare commits

...
Author SHA1 Message Date
snyk-bot 0fa480c5a0 fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-TAR-1579147
- https://snyk.io/vuln/SNYK-JS-TAR-1579152
- https://snyk.io/vuln/SNYK-JS-TAR-1579155
2021-09-01 21:16:06 +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 23 additions and 17 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,
]);
}
+8 -8
View File
@@ -1,5 +1,5 @@
{
"name": "phpvms",
"name": "npm-proj-1630530959563-0.3771552149793951CYCCrG",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -40,7 +40,7 @@
"rivets": "^0.9.6",
"select2": "^4.0.13",
"ssri": "^8.0.1",
"tar": ">=4.4.2",
"tar": "^6.1.9",
"webpack": "^5.45.1",
"webpack-cli": "^3.3.12",
"x-editable": "1.5.1"
@@ -12802,9 +12802,9 @@
}
},
"node_modules/tar": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz",
"integrity": "sha512-XjLaMNl76o07zqZC/aW4lwegdY07baOH1T8w3AEfrHAdyg/oYO4ctjzEBq9Gy9fEP9oHqLIgvx6zuGDGe+bc8Q==",
"dependencies": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
@@ -23866,9 +23866,9 @@
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
},
"tar": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz",
"integrity": "sha512-XjLaMNl76o07zqZC/aW4lwegdY07baOH1T8w3AEfrHAdyg/oYO4ctjzEBq9Gy9fEP9oHqLIgvx6zuGDGe+bc8Q==",
"requires": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
+1 -1
View File
@@ -45,7 +45,7 @@
"rivets": "^0.9.6",
"select2": "^4.0.13",
"ssri": "^8.0.1",
"tar": ">=4.4.2",
"tar": ">=6.1.9",
"webpack": "^5.45.1",
"webpack-cli": "^3.3.12",
"x-editable": "1.5.1"