Compare commits

...

9 Commits

Author SHA1 Message Date
snyk-bot
3870932a85 fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MARKED-1070800
2021-02-10 02:23:54 +00:00
Olli
8c2513eb3d Update style.css for better mobile experience (#1018)
This edit hides the dropdown menu while being closed on mobile view
2021-02-05 08:38:32 -05:00
Nabeel Shahzad
2dbd58e59e Merge branch 'dev' of https://github.com/nabeelio/phpvms into dev 2021-02-04 14:54:20 -05:00
Nabeel Shahzad
bf77f7dd96 Add 'phase' as response output, deprecate "status" 2021-02-04 14:54:16 -05:00
B.Fatih KOZ
5a570989de Failsafe for SimBrief random pax generation (#1015)
* Failsafe for SimBrief random pax generation

PR fixes the problem for 0 load generation where va admins do not set load factor and variance values for their flights and also leave the general settings empty. In such cases, both loadmin and loadmax was returning 0 , resulting zero load.

Thanks @macofallico for figuring this out.

* StyleFix
2021-02-01 15:27:22 -05:00
B.Fatih KOZ
6b3207377a Fix Profile Fields (#1013)
* Fix Profile Fields

PR fixes two issues ;

1. Profile Fields not showing up on user profile
2. Profile Fields not showing up on user.profile.edit

Profile.index was looking for "public" to be true, while controller was sending "private" and it was not boolean.

Also profile controller was not sending the fields to the blade. Both fixed and working now

* Update index.blade.php
2021-01-28 08:31:29 -05:00
B.Fatih KOZ
ac1d5e1555 Fix PilotHoursAwards (#1011)
!is_int was causing the check always return false even when user enters a proper value like 6000 or 30000 in admin/award settings.

We should use !is_numeric instead to see if it is a valid numeric value.
2021-01-26 19:48:43 -05:00
B.Fatih KOZ
0d45fc287b AwardController text correction (#1010)
Fixed the flash message texts
2021-01-26 16:31:54 -05:00
B.Fatih KOZ
4911f6799d Fix for ACARS config download button not working #919 (#1009)
* Fix For Acars Config Download Button No Working Bug #919

PR fixes the Acars Config Download button not showing up at user profile.

Also fixes the problem where Generate New Api Key button not following user selections and generating a new key even if user clicks cancel.

* Style Fix for ? and !

Fix the typo :)
2021-01-25 16:04:43 -05:00
10 changed files with 29 additions and 18 deletions

View File

@@ -186,13 +186,13 @@ class AwardController extends Controller
{
$award = $this->awardRepository->findWithoutFail($id);
if (empty($award)) {
Flash::error('Fare not found');
Flash::error('Award not found');
return redirect(route('admin.awards.index'));
}
$this->awardRepository->delete($id);
Flash::success('Fare deleted successfully.');
Flash::success('Award deleted successfully.');
return redirect(route('admin.awards.index'));
}

View File

@@ -52,7 +52,7 @@ class ProfileController extends Controller
{
// Is the ACARS module enabled?
$acars_enabled = false;
$acars = Module::find('VMSACARS');
$acars = Module::find('VMSAcars');
if ($acars) {
$acars_enabled = $acars->isEnabled();
}
@@ -95,6 +95,7 @@ class ProfileController extends Controller
'user' => $user,
'userFields' => $userFields,
'airports' => $airports,
'acars' => $this->acarsEnabled(),
]);
}
@@ -121,7 +122,7 @@ class ProfileController extends Controller
$airlines = $this->airlineRepo->selectBoxList();
$airports = $this->airportRepo->selectBoxList(false, setting('pilots.home_hubs_only'));
$userFields = $this->userRepo->getUserFields($user, false);
$userFields = $this->userRepo->getUserFields($user, true);
return view('profile.edit', [
'user' => $user,

View File

@@ -109,6 +109,11 @@ class SimBriefController
$loadmax = $lfactor + $lfactorv;
$loadmax = $loadmax > 100 ? 100 : $loadmax;
// Failsafe for admins not defining load values for their flights
// and also leave the general settings empty, set loadmax to 100
if ($loadmax === 0) {
$loadmax = 100;
}
// Show the main simbrief form
return view('flights.simbrief_form', [

View File

@@ -27,6 +27,7 @@ class Pirep extends Resource
{
$res = parent::toArray($request);
$res['ident'] = $this->ident;
$res['phase'] = $this->status;
$res['status_text'] = PirepStatus::label($this->status);
// Set these to the response units

View File

@@ -11,7 +11,8 @@ use App\Services\AirportService;
class Weather extends Widget
{
protected $config = [
'icao' => null,
'icao' => null,
'raw_only' => null,
];
/**

View File

@@ -42,7 +42,7 @@ class PilotHoursAwards extends Award
*/
public function check($flight_minutes = null): bool
{
if (!is_int($flight_minutes)) {
if (!is_numeric($flight_minutes)) {
Log::error('PilotHourAwards: Flight time "'.$flight_minutes.'" is not a valid flight time');
return false;
}

11
package-lock.json generated
View File

@@ -1983,11 +1983,6 @@
"resolved": "https://registry.npmjs.org/bootstrap-sass/-/bootstrap-sass-3.4.1.tgz",
"integrity": "sha512-p5rxsK/IyEDQm2CwiHxxUi0MZZtvVFbhWmyMOt4lLkA4bujDA1TGoKT0i1FKIWiugAdP+kK8T5KMDFIKQCLYIA=="
},
"bootstrap3": {
"version": "npm:bootstrap@3.4.1",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz",
"integrity": "sha512-yN5oZVmRCwe5aKwzRj6736nSmKDX7pLYwsXiCj/EYmo16hODaBiT4En5btW/jhBF/seV+XMx3aYwukYC3A49DA=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -5881,9 +5876,9 @@
}
},
"marked": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/marked/-/marked-1.2.2.tgz",
"integrity": "sha512-5jjKHVl/FPo0Z6ocP3zYhKiJLzkwJAw4CZoLjv57FkvbUuwOX4LIBBGGcXjAY6ATcd1q9B8UTj5T9Umauj0QYQ=="
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-2.0.0.tgz",
"integrity": "sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q=="
},
"md5": {
"version": "2.3.0",

View File

@@ -34,7 +34,7 @@
"leaflet-rotatedmarker": "^0.2.0",
"leaflet.geodesic": "^2.5.2",
"lodash": ">=4.17.19",
"marked": "^1.2.2",
"marked": "^2.0.0",
"minimist": "^1.2.2",
"moment": "^2.29.1",
"paper-dashboard": "^1.1.0",

View File

@@ -130,3 +130,11 @@
border-radius: 5px;
width: 250px;
}
/*
* fix the dropdown menu on mobile view
*/
.dropdown-menu:not(.show) {
display: none;
}

View File

@@ -133,11 +133,11 @@
<div class="text-right">
@if (isset($acars) && $acars === true)
<a href="{{ route('frontend.profile.acars') }}" class="btn btn-primary"
onclick="alert('Save to \'My Documents/phpVMS\'')">ACARS Config</a>
onclick="alert('Copy or Save to \'My Documents/phpVMS\'')">ACARS Config</a>
&nbsp;
@endif
<a href="{{ route('frontend.profile.regen_apikey') }}" class="btn btn-warning"
onclick="return confirm({{ __('Are you sure? This will reset your API key.') }})">@lang('profile.newapikey')</a>
onclick="return confirm('Are you sure? This will reset your API key!')">@lang('profile.newapikey')</a>
&nbsp;
<a href="{{ route('frontend.profile.edit', [$user->id]) }}"
class="btn btn-primary">@lang('common.edit')</a>
@@ -171,7 +171,7 @@
<div class="col-sm-12">
<table class="table table-full-width">
@foreach($userFields as $field)
@if($field->public === true)
@if(!$field->private)
<tr>
<td>{{ $field->name }}</td>
<td>{{ $field->value }}</td>