Add step fields to enable decimal points on fields #342 (#343)

* Add step fields to enable decimal points on fields #342

* Update js-yaml version due to vulnerability scan

* Don't seed dev files when env == local

* Fix

* Fix  to be static

* Add visibilty keyword
This commit is contained in:
Nabeel S 2019-08-06 15:54:21 -04:00 committed by GitHub
parent 6292b05ad5
commit 092b9fc9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 41 additions and 47 deletions

View File

@ -18,11 +18,8 @@ class SeederService extends Service
private $counters = [];
private $offsets = [];
private static $seed_mapper = [
'local' => 'dev',
'qa' => 'dev',
'staging' => 'dev',
];
// Map an environment to a seeder directory, if we want to share
public static $seed_mapper = [];
public function __construct(DatabaseService $databaseSvc)
{

View File

@ -27,7 +27,7 @@ class Http
], $opts);
$client = new Client();
$response = $client->request('GET', $uri, $opts);
$responseSeederService = $client->request('GET', $uri, $opts);
$body = $response->getBody()->getContents();
if ($response->getHeader('content-type') === 'application/json') {

View File

@ -24,7 +24,7 @@
"icheck": "~1.0",
"jquery": "~3.4",
"jquery-pjax": "~2.0",
"js-yaml": "^3.13.1",
"js-yaml": "^3.4",
"laravel-mix": "^2.1.14",
"leaflet": "^1.3.4",
"leaflet-ajax": "2.1.0",

View File

@ -64,7 +64,7 @@
{{ Form::open(['url' => url('/admin/aircraft/'.$aircraft->id.'/expenses'),
'method' => 'post', 'class' => 'modify_expense form-inline']) }}
{{ Form::input('text', 'name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount', 'step' => '0.01']) }}
{{ Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) }}
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
'class' => 'btn btn-success btn-small']) }}

View File

@ -61,7 +61,7 @@
{{ Form::open(['url' => url('/admin/airports/'.$airport->id.'/expenses'),
'method' => 'post', 'class' => 'modify_expense form-inline']) }}
{{ Form::input('text', 'name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount', 'step' => '0.01']) }}
{{ Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) }}
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
'class' => 'btn btn-success btn-small']) }}

View File

@ -62,7 +62,7 @@
<div class="row">
<div class="form-group col-sm-6">
{{ Form::label('ground_handling_cost', 'Ground Handling Cost:') }}
{{ Form::number('ground_handling_cost', null, ['class' => 'form-control']) }}
{{ Form::number('ground_handling_cost', null, ['class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('ground_handling_cost') }}</p>
@component('admin.components.info')
@ -73,7 +73,7 @@
<div class="form-group col-md-6">
{{ Form::label('fuel_jeta_cost', 'Jet A Fuel Cost:') }}
{{ Form::number('fuel_jeta_cost', null, ['class' => 'form-control']) }}
{{ Form::number('fuel_jeta_cost', null, ['class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('fuel_jeta_cost') }}</p>
@component('admin.components.info')

View File

@ -6,9 +6,7 @@
<th>Location</th>
<th>Hub</th>
<th style="text-align: center;">GH Cost</th>
{{--<th style="text-align: center;">100LL</th>--}}
<th style="text-align: center;">JetA</th>
{{--<th style="text-align: center;">MOGAS</th>--}}
<th></th>
</thead>
<tbody>
@ -25,15 +23,9 @@
<td style="text-align: center;">
{{ $airport->ground_handling_cost }}
</td>
{{--<td style="text-align: center;">
<a class="inline" href="#" data-pk="{{ $airport->id }}" data-name="fuel_100ll_cost">{{ $airport->fuel_100ll_cost }}</a>
</td>--}}
<td style="text-align: center;">
<a class="inline" href="#" data-pk="{{ $airport->id }}" data-name="fuel_jeta_cost">{{ $airport->fuel_jeta_cost }}</a>
</td>
{{--<td style="text-align: center;">
<a class="inline" href="#" data-pk="{{ $airport->id }}" data-name="fuel_mogas_cost">{{ $airport->fuel_mogas_cost }}</a>
</td>--}}
<td style="text-align: right;">
{{ Form::open(['route' => ['admin.airports.destroy', $airport->id], 'method' => 'delete']) }}
<a href="{{ route('admin.airports.edit', [$airport->id]) }}" class='btn btn-sm btn-success btn-icon'><i class="fas fa-pencil-alt"></i></a>

View File

@ -27,7 +27,7 @@
<div class="form-group col-sm-6">
{{ Form::label('amount', 'Amount:') }}
{{ Form::number('amount', null, ['class' => 'form-control', 'min' => 0]) }}
{{ Form::number('amount', null, ['class' => 'form-control', 'min' => 0, 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('amount') }}</p>
</div>

View File

@ -41,7 +41,7 @@
@component('admin.components.info')
The operating cost
@endcomponent
{{ Form::text('cost', null, ['class' => 'form-control', 'placeholder' => 0]) }}
{{ Form::number('cost', null, ['class' => 'form-control', 'placeholder' => 0, 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('cost') }}</p>
</div>
@ -50,7 +50,7 @@
@component('admin.components.info')
The number of seats available in this class.
@endcomponent
{{ Form::text('capacity', null, ['class' => 'form-control', 'placeholder' => 0]) }}
{{ Form::number('capacity', null, ['class' => 'form-control', 'min' => 0]) }}
<p class="text-danger">{{ $errors->first('capacity') }}</p>
</div>

View File

@ -46,12 +46,14 @@
'class' => 'form-control',
'placeholder' => 'hours',
'style' => 'width: 50%',
'min' => '0',
]) }}
{{ Form::number('minutes', null, [
'class' => 'form-control',
'placeholder' => 'minutes',
'style' => 'width: 50%',
'min' => '0',
]) }}
</div>

View File

@ -18,6 +18,7 @@
{{ Form::number('fare_'.$fare->id, null, [
'class' => 'form-control',
'min' => 0,
'step' => '0.01',
'readonly' => $pirep->read_only]) }}
@endif
</div>

View File

@ -22,7 +22,7 @@
<div class="form-group col-md-4">
{{ Form::label('acars_base_pay_rate', 'ACARS Base Pay Rate:') }}
{{ Form::number('acars_base_pay_rate', null, ['min' => 0, 'class' => 'form-control']) }}
{{ Form::number('acars_base_pay_rate', null, ['min' => 0, 'class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('acars_base_pay_rate') }}</p>
@component('admin.components.info')
Base rate, per-flight hour, for ACARS PIREPs.
@ -32,7 +32,7 @@
<div class="form-group col-md-4">
{{ Form::label('manual_base_pay_rate', 'Manual Base Pay Rate:') }}
{{ Form::number('manual_base_pay_rate', null, ['min' => 0, 'class' => 'form-control']) }}
{{ Form::number('manual_base_pay_rate', null, ['min' => 0, 'class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('manual_base_pay_rate') }}</p>
@component('admin.components.info')
Base rate, per-flight hour, for manually-filed PIREPs.

View File

@ -24,8 +24,10 @@
@elseif($setting->type === 'boolean' || $setting->type === 'bool')
{{ Form::hidden($setting->id, 0) }}
{{ Form::checkbox($setting->id, null, $setting->value) }}
@elseif($setting->type === 'int' || $setting->type === 'number')
@elseif($setting->type === 'int')
{{ Form::number($setting->id, $setting->value, ['class'=>'form-control']) }}
@elseif($setting->type === 'number')
{{ Form::number($setting->id, $setting->value, ['class'=>'form-control', 'step' => '0.01']) }}
@elseif($setting->type === 'select')
{{ Form::select(
$setting->id,

View File

@ -59,7 +59,7 @@
{{ Form::open(['url' => url('/admin/subfleets/'.$subfleet->id.'/expenses'),
'method' => 'post', 'class' => 'modify_expense form-inline']) }}
{{ Form::text('name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount']) }}
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount', 'step' => '0.01']) }}
{{ Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) }}
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
'class' => 'btn btn-success btn-small']) }}

View File

@ -35,13 +35,13 @@
<div class="form-group col-sm-3">
{{ Form::label('cost_block_hour', 'Cost Per Hour:') }}
{{ Form::number('cost_block_hour', null , ['class' => 'form-control']) }}
{{ Form::number('cost_block_hour', null , ['class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('cost_block_hour') }}</p>
</div>
<div class="form-group col-sm-3">
{{ Form::label('cost_delay_minute', 'Cost Delay Per Minute:') }}
{{ Form::number('cost_delay_minute', null , ['class' => 'form-control']) }}
{{ Form::number('cost_delay_minute', null , ['class' => 'form-control', 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('cost_delay_minute') }}</p>
</div>

View File

@ -949,9 +949,9 @@ balanced-match@^1.0.0:
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
base64-js@^1.0.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
base@^0.11.1:
version "0.11.2"
@ -1314,14 +1314,14 @@ caniuse-api@^1.5.2:
lodash.uniq "^4.5.0"
caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
version "1.0.30000988"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000988.tgz#6a761a0204c4c41977b0379fb14f51d367c5e4ee"
integrity sha512-P0JCbGJhL1tTTeF+ehckvXwtckRursLDbA/ETdAd8Yg1ROAGJ5OgYgMONW1zWW1+ZTB79d7ZeJiOHGreEGG1ew==
version "1.0.30000989"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000989.tgz#bd8dd2789725685054a2c5ef95804f9e6e50fb32"
integrity sha512-5pkU/t9nueoBgELZOCpK+wN4wK6MkIz1Q9lGZSgLwg4xR8EhLY9r0qj6T2bUI8Cq9pGbioEar+Zqgosk5fpbjg==
caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000805, caniuse-lite@^1.0.30000844:
version "1.0.30000988"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000988.tgz#742f35ec1b8b75b9628d705d7652eea1fef983db"
integrity sha512-lPj3T8poYrRc/bniW5SQPND3GRtSrQdUM/R4mCYTbZxyi3jQiggLvZH4+BYUuX0t4TXjU+vMM7KFDQg+rSzZUQ==
version "1.0.30000989"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz#b9193e293ccf7e4426c5245134b8f2a56c0ac4b9"
integrity sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw==
caseless@~0.12.0:
version "0.12.0"
@ -2225,9 +2225,9 @@ ejs@^2.6.1:
integrity sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q==
electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30, electron-to-chromium@^1.3.47:
version "1.3.214"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.214.tgz#8b5b9a0415fd41b69c61f694007597cb8c8eb7e8"
integrity sha512-SU9yyql6uA0Fc8bWR7sCYNGBtxkC+tQb6UaC7ReaadN42Kx7Ka+dzx3lAIm9Ock+ULEawJuTFcVB2x34uOCg0Q==
version "1.3.215"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.215.tgz#c833cb31110c2e0a7dade1110648c2174f75233b"
integrity sha512-ZV3OnwF0FlIygwxAG2H92yt7WGjWBpawyFAFu8e9k7xJatY+BPowID0D0Bs3PMACYAJATEejw/I9cawO27ZvTg==
elliptic@^6.0.0:
version "6.5.0"
@ -3784,7 +3784,7 @@ js-tokens@^3.0.2:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
js-yaml@^3.13.1, js-yaml@^3.4.3:
js-yaml@^3.13.1, js-yaml@^3.4, js-yaml@^3.4.3:
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
@ -6901,9 +6901,9 @@ type-is@~1.6.17, type-is@~1.6.18:
mime-types "~2.1.24"
type@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61"
integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==
version "1.0.3"
resolved "https://registry.yarnpkg.com/type/-/type-1.0.3.tgz#16f5d39f27a2d28d86e48f8981859e9d3296c179"
integrity sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==
typedarray@^0.0.6:
version "0.0.6"
@ -7321,9 +7321,9 @@ webpack-notifier@^1.5.1:
strip-ansi "^3.0.1"
webpack-sources@^1.0.1, webpack-sources@^1.1.0:
version "1.4.2"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.2.tgz#a688692f5ce53f9db6edef498c0beae73610c9d6"
integrity sha512-V/mHhu5RzLPYVY3Aa+ogcoLqdZU+XdOf0VCLuqSDLJ6oo5lk7Q1n9kG5cySidY/SzXfXwS+CASg4z00q7gIhRQ==
version "1.4.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==
dependencies:
source-list-map "^2.0.0"
source-map "~0.6.1"