Fix all views.

This commit is contained in:
James Cole 2019-08-10 16:50:37 +02:00
parent 0d9bae6ec2
commit 3daddd690f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
20 changed files with 207 additions and 28 deletions

View File

@ -53,9 +53,12 @@ use FireflyIII\Services\IP\IPRetrievalInterface;
use FireflyIII\Services\Password\PwndVerifierV3;
use FireflyIII\Services\Password\Verifier;
use FireflyIII\Support\Amount;
use FireflyIII\Support\ExpandedForm;
use FireflyIII\Support\FireflyConfig;
use FireflyIII\Support\ExpandedForm;
use FireflyIII\Support\Form\AccountForm;
use FireflyIII\Support\Form\CurrencyForm;
use FireflyIII\Support\Form\PiggyBankForm;
use FireflyIII\Support\Form\RuleForm;
use FireflyIII\Support\Navigation;
use FireflyIII\Support\Preferences;
use FireflyIII\Support\Steam;
@ -143,7 +146,7 @@ class FireflyServiceProvider extends ServiceProvider
);
$this->app->bind(
'expandedform',
function () {
static function () {
return new ExpandedForm;
}
);
@ -154,6 +157,26 @@ class FireflyServiceProvider extends ServiceProvider
return new AccountForm;
}
);
$this->app->bind(
'currencyform',
static function () {
return new CurrencyForm;
}
);
$this->app->bind(
'piggybankform',
static function () {
return new PiggyBankForm;
}
);
$this->app->bind(
'ruleform',
static function () {
return new RuleForm;
}
);
// chart generator:
$this->app->bind(GeneratorInterface::class, ChartJsGenerator::class);

View File

@ -27,7 +27,7 @@ use Illuminate\Support\Facades\Facade;
/**
* @codeCoverageIgnore
* Class ExpandedForm.
* Class AccountForm.
*
*/
class AccountForm extends Facade

View File

@ -0,0 +1,44 @@
<?php
/**
* CurrencyForm.php
* Copyright (c) 2019 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Facade;
/**
* @codeCoverageIgnore
* Class CurrencyForm.
*
*/
class CurrencyForm extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'currencyform';
}
}

View File

@ -28,9 +28,6 @@ use Illuminate\Support\Facades\Facade;
/**
* @codeCoverageIgnore
* Class ExpandedForm.
*
* @method array makeSelectList(Collection $set)
* @method array makeSelectListWithEmpty(Collection $set)
*/
class ExpandedForm extends Facade
{

View File

@ -0,0 +1,44 @@
<?php
/**
* PiggyBankForm.php
* Copyright (c) 2019 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Facade;
/**
* @codeCoverageIgnore
* Class PiggyBankForm.
*
*/
class PiggyBankForm extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'piggybankform';
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* RuleForm.php
* Copyright (c) 2019 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Facade;
/**
* @codeCoverageIgnore
* Class RuleForm.
*
*/
class RuleForm extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'ruleform';
}
}

View File

@ -40,7 +40,9 @@ use Throwable;
class CurrencyForm
{
use FormSupport;
/**
* TODO cleanup and describe.
* @param string $name
* @param mixed $value
* @param array $options
@ -64,6 +66,8 @@ class CurrencyForm
}
/**
* TODO cleanup and describe.
*
* @param string $name
* @param mixed $value
* @param array $options
@ -90,6 +94,8 @@ class CurrencyForm
/**
* TODO describe and cleanup.
*
* @param string $name
* @param mixed $value
* @param array $options
@ -103,6 +109,8 @@ class CurrencyForm
}
/**
* TODO cleanup and describe better.
*
* @param string $name
* @param string $view
* @param mixed $value

View File

@ -33,7 +33,10 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
class PiggyBankForm
{
use FormSupport;
/**
* TODO cleanup and describe.
*
* @param string $name
* @param mixed $value
* @param array $options

View File

@ -100,8 +100,6 @@ return [
FireflyIII\Providers\AdminServiceProvider::class,
FireflyIII\Providers\RecurringServiceProvider::class,
ImportServiceProvider::class,
],
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
@ -146,7 +144,10 @@ return [
'Amount' => \FireflyIII\Support\Facades\Amount::class,
'Steam' => \FireflyIII\Support\Facades\Steam::class,
'ExpandedForm' => \FireflyIII\Support\Facades\ExpandedForm::class,
'CurrencyForm' => \FireflyIII\Support\Facades\CurrencyForm::class,
'AccountForm' => \FireflyIII\Support\Facades\AccountForm::class,
'PiggyBankForm' => \FireflyIII\Support\Facades\PiggyBankForm::class,
'RuleForm' => \FireflyIII\Support\Facades\RuleForm::class,
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
],

View File

@ -179,7 +179,7 @@ return [
|
*/
'facades' => [
'Breadcrumbs' => [
'Breadcrumbs' => [
'is_safe' => [
'render',
],
@ -193,22 +193,37 @@ return [
'Steam',
'Config',
'Request',
'Form' => ['is_safe' => ['input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file',],],
'ExpandedForm' => [
'Form' => ['is_safe' => ['input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file',],],
'ExpandedForm' => [
'is_safe' => [
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location', 'file', 'staticText',
'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'currencyList', 'ruleGroupList',
'ruleGroupListWithEmpty', 'piggyBankList', 'currencyListEmpty', 'percentage', 'balanceAll',
'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'percentage',
],
],
'AccountForm' => [
'AccountForm' => [
'is_safe' => [
'activeAssetAccountList', 'activeLongAccountList', 'activeWithdrawalDestinations', 'activeDepositDestinations',
'assetAccountCheckList', 'assetAccountList', 'longAccountList',
],
],
'CurrencyForm' => [
'is_safe' => [
'currencyList', 'currencyListEmpty', 'balanceAll',
],
],
'PiggyBankForm' =>
[
'is_safe' => [
'piggyBankList',
],
],
'RuleForm' => [
'is_safe' => [
'ruleGroupList', 'ruleGroupListWithEmpty',
],
],
],

View File

@ -18,7 +18,7 @@
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if objectType == 'asset' or objectType == 'liabilities' %}
{{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if objectType == 'liabilities' %}
{{ ExpandedForm.select('liability_type_id', liabilityTypes) }}

View File

@ -19,7 +19,7 @@
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if account.accountType.type == 'Default account' or account.accountType.type == 'Asset account' or objectType == 'liabilities' %}
{{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if objectType == 'liabilities' %}

View File

@ -17,7 +17,7 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ ExpandedForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ ExpandedForm.amountNoCurrency('amount_min') }}
{{ ExpandedForm.amountNoCurrency('amount_max') }}
{{ ExpandedForm.date('date',phpdate('Y-m-d')) }}

View File

@ -18,7 +18,7 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ ExpandedForm.currencyList('transaction_currency_id') }}
{{ CurrencyForm.currencyList('transaction_currency_id') }}
{{ ExpandedForm.amountNoCurrency('amount_min') }}
{{ ExpandedForm.amountNoCurrency('amount_max') }}
{{ ExpandedForm.date('date',bill.date.format('Y-m-d')) }}

View File

@ -24,7 +24,7 @@
{{ 'to_get_started'|_ }}
</p>
{{ ExpandedForm.text('bank_name') }}
{{ ExpandedForm.balanceAll('bank_balance') }}
{{ CurrencyForm.balanceAll('bank_balance') }}
<p class="text-success">
{{ 'currency_not_present'|_ }}

View File

@ -86,7 +86,7 @@
{{ ExpandedForm.text('transaction_description') }}
{# transaction information (mandatory) #}
{{ ExpandedForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ ExpandedForm.amountNoCurrency('amount', []) }}
{# source account if withdrawal, or if transfer: #}
@ -115,7 +115,7 @@
</div>
<div class="box-body">
{# transaction information (optional) #}
{{ ExpandedForm.currencyListEmpty('foreign_currency_id', 0) }}
{{ CurrencyForm.currencyListEmpty('foreign_currency_id', 0) }}
{{ ExpandedForm.amountNoCurrency('foreign_amount', []) }}
{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}
@ -132,7 +132,7 @@
{{ ExpandedForm.text('tags') }}
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
{{ ExpandedForm.piggyBankList('piggy_bank_id',0) }}
{{ PiggyBankForm.piggyBankList('piggy_bank_id',0) }}
</div>
</div>
</div>

View File

@ -84,7 +84,7 @@
{# end of three buttons#}
{{ ExpandedForm.text('transaction_description', array.transactions[0].description) }}
{# transaction information (mandatory) #}
{{ ExpandedForm.currencyList('transaction_currency_id', array.transactions[0].currency_id) }}
{{ CurrencyForm.currencyList('transaction_currency_id', array.transactions[0].currency_id) }}
{{ ExpandedForm.amountNoCurrency('amount', array.transactions[0].amount) }}
{# source account if withdrawal, or if transfer: #}
@ -116,7 +116,7 @@
</div>
<div class="box-body">
{# transaction information (optional) #}
{{ ExpandedForm.currencyListEmpty('foreign_currency_id', array.transactions[0].foreign_currency_id) }}
{{ CurrencyForm.currencyListEmpty('foreign_currency_id', array.transactions[0].foreign_currency_id) }}
{{ ExpandedForm.amountNoCurrency('foreign_amount', array.transactions[0].foreign_amount) }}
{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}
@ -155,7 +155,7 @@
{{ ExpandedForm.text('tags', tags) }}
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
{{ ExpandedForm.piggyBankList('piggy_bank_id',piggyBankId) }}
{{ PiggyBankForm.piggyBankList('piggy_bank_id',piggyBankId) }}
</div>
</div>
</div>

View File

@ -35,7 +35,7 @@
</p>
<p>
{{ ExpandedForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}
{{ RuleForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}
</p>
{% else %}
<input type="hidden" name="move_rules_before_delete" value="0"/>

View File

@ -38,7 +38,7 @@
<div class="box-body">
{{ ExpandedForm.text('title') }}
{{ ExpandedForm.select('trigger',allJournalTriggers()) }}
{{ ExpandedForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ ExpandedForm.checkbox('stop_processing',1,null, {helpText: trans('firefly.rule_help_stop_processing')}) }}
{{ ExpandedForm.checkbox('strict',1, null,{helpText: trans('firefly.rule_help_strict')}) }}
</div>

View File

@ -15,7 +15,7 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('title') }}
{{ ExpandedForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ ExpandedForm.select('trigger',allJournalTriggers(), primaryTrigger) }}
{# only correct way to do active checkbox #}