Compare commits

..
6 changed files with 27 additions and 33 deletions
@@ -9,7 +9,6 @@ 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;
@@ -152,10 +151,10 @@ class PirepController extends Controller
$count = $request->input($field_name);
}
$fares[] = new PirepFare([
$fares[] = [
'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);
$userFields = $this->userRepo->getUserFields($user, true);
return view('profile.edit', [
'user' => $user,
+2 -7
View File
@@ -36,14 +36,9 @@ class UserRepository extends Repository
*
* @return \App\Models\UserField[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection
*/
public function getUserFields(User $user, $only_public_fields = null): Collection
public function getUserFields(User $user, $only_public_fields = true): Collection
{
if (is_bool($only_public_fields)) {
$fields = UserField::where(['private' => !$only_public_fields])->get();
} else {
$fields = UserField::get();
}
$fields = UserField::where(['private' => !$only_public_fields])->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->lat.', '.$point->lon.')',
'popup' => $point->name.' ('.$point->name.')',
'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->lat.', '.$point->lon.')',
'popup' => $point->name.' ('.$point->name.')',
]);
}
@@ -369,7 +369,7 @@ class GeoService extends Service
$actual->addPoint($point->lat, $point->lon, [
'pirep_id' => $pirep->id,
'name' => $point->altitude,
'popup' => 'Spd: '.$point->gs.' kts<br />Alt: '.$point->altitude.' ft<br />Pos: '.$point->lat.', '.$point->lon,
'popup' => 'GS: '.$point->gs.'<br />Alt: '.$point->altitude,
]);
}
+17 -17
View File
@@ -1,5 +1,5 @@
{
"name": "npm-proj-1630891903110-0.06417380357287183uaTTYD",
"name": "npm-proj-1628880244889-0.44700105681461366eg79BC",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -8,11 +8,11 @@
"@turf/center": "^6.0.1",
"acorn": "^7.4.1",
"animate.css": "~3.6",
"axios": "^0.21.3",
"axios": "^0.21.1",
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",
"ckeditor4": "4.14.0",
"ckeditor4": "^4.16.2",
"cookieconsent": "^3.1.0",
"cross-env": "^5.1.6",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
@@ -2366,11 +2366,11 @@
}
},
"node_modules/axios": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"dependencies": {
"follow-redirects": "^1.14.0"
"follow-redirects": "^1.10.0"
}
},
"node_modules/axobject-query": {
@@ -3030,9 +3030,9 @@
}
},
"node_modules/ckeditor4": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.14.0.tgz",
"integrity": "sha512-g5p3bhbxbwB094bE7ss0rOyvG/azYdRjLTyngnPM2+fKZhnPrMVaFDx3SiiWKB+zyvndT3Deu54VTv/z2MQJCA=="
"version": "4.16.2",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.16.2.tgz",
"integrity": "sha512-5x2FmI+yGpQIKISh24Wp4HwjQxN6C4Lw59yh68HbFwcnMu8DvSiZLJfeINGvRG1oQ1L9GzJ5Pqd0PL0KDH08Jw=="
},
"node_modules/class-utils": {
"version": "0.3.6",
@@ -15927,11 +15927,11 @@
"dev": true
},
"axios": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"requires": {
"follow-redirects": "^1.14.0"
"follow-redirects": "^1.10.0"
}
},
"axobject-query": {
@@ -16466,9 +16466,9 @@
}
},
"ckeditor4": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.14.0.tgz",
"integrity": "sha512-g5p3bhbxbwB094bE7ss0rOyvG/azYdRjLTyngnPM2+fKZhnPrMVaFDx3SiiWKB+zyvndT3Deu54VTv/z2MQJCA=="
"version": "4.16.2",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.16.2.tgz",
"integrity": "sha512-5x2FmI+yGpQIKISh24Wp4HwjQxN6C4Lw59yh68HbFwcnMu8DvSiZLJfeINGvRG1oQ1L9GzJ5Pqd0PL0KDH08Jw=="
},
"class-utils": {
"version": "0.3.6",
+2 -2
View File
@@ -13,11 +13,11 @@
"@turf/center": "^6.0.1",
"acorn": "^7.4.1",
"animate.css": "~3.6",
"axios": "^0.21.3",
"axios": "^0.21.1",
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",
"ckeditor4": "4.14.0",
"ckeditor4": "4.16.2",
"cookieconsent": "^3.1.0",
"cross-env": "^5.1.6",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",