close #3209 Enhancement: Transaction index bulk action form flexible..
This commit is contained in:
parent
2e327bc0ef
commit
cc428bc1c7
|
|
@ -88,6 +88,8 @@ abstract class Index extends Component
|
|||
/** @var string */
|
||||
public $classBulkAction;
|
||||
|
||||
public $hidePaymentMethod;
|
||||
|
||||
public $hidePaidAt;
|
||||
|
||||
public $hideNumber;
|
||||
|
|
@ -172,6 +174,7 @@ abstract class Index extends Component
|
|||
bool $hideSummary = false, array $summaryItems = [],
|
||||
bool $hideSearchString = false, bool $hideBulkAction = false,
|
||||
string $searchStringModel = '', string $bulkActionClass = '', array $bulkActions = [], array $bulkActionRouteParameters = [], string $searchRoute = '', string $classBulkAction = '',
|
||||
bool $hidePaymentMethod = false,
|
||||
bool $hidePaidAt = false, bool $hideNumber = false, string $classPaidAtAndNumber = '', string $textPaidAt = '', string $textNumber = '',
|
||||
bool $hideStartedAt = false, bool $hideEndedAt = false, string $classStartedAtAndEndedAt = '', string $textStartedAt = '', string $textEndedAt = '',
|
||||
bool $hideType = false, bool $hideCategory = false, string $classTypeAndCategory = '', string $textType = '', string $textCategory = '',
|
||||
|
|
@ -236,6 +239,9 @@ abstract class Index extends Component
|
|||
$this->searchRoute = $this->getIndexRoute($type, $searchRoute);
|
||||
|
||||
$this->classBulkAction = $this->getClassBulkAction($type, $classBulkAction);
|
||||
|
||||
$this->hidePaymentMethod = $hidePaymentMethod;
|
||||
|
||||
|
||||
/* Document Start */
|
||||
$this->hidePaidAt = $hidePaidAt;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\View\Components\Transactions\Index;
|
||||
|
||||
use App\Abstracts\View\Components\Transactions\Index as Component;
|
||||
|
||||
class BulkAction extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.index.bulk-action');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +1,7 @@
|
|||
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
|
||||
<x-form.group.payment-method
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
|
||||
<x-form.group.account
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
|
||||
@if ($category_and_contact)
|
||||
<x-form.group.category
|
||||
:type="$real_type"
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
|
||||
<x-form.group.contact
|
||||
:type="$contact_type"
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
@endif
|
||||
|
||||
<x-form.input.hidden name="currency_code" :value="$account_currency_code" />
|
||||
<x-form.input.hidden name="currency_rate" value="1" />
|
||||
</div>
|
||||
<x-transactions.index.bulk-action
|
||||
type="income"
|
||||
:category_and_contact="$category_and_contact"
|
||||
:real_type="$real_type"
|
||||
:contact_type="$contact_type"
|
||||
:account_currency_code="$account_currency_code"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
@props(['category_and_contact', 'real_type', 'contact_type', 'account_currency_code'])
|
||||
|
||||
@if (! $hidePaymentMethod || ! $hideAccount || $category_and_contact || ! $hideCategory || ! $hideContact)
|
||||
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
|
||||
@if (! $hidePaymentMethod)
|
||||
<x-form.group.payment-method
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@if (! $hideAccount)
|
||||
<x-form.group.account
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@if ($category_and_contact)
|
||||
@if (! $hideCategory)
|
||||
<x-form.group.category
|
||||
:type="$real_type"
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@if (! $hideContact)
|
||||
<x-form.group.contact
|
||||
:type="$contact_type"
|
||||
without-add-new
|
||||
selected=""
|
||||
not-required
|
||||
form-group-class="sm:col-span-6"
|
||||
/>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<x-form.input.hidden name="currency_code" :value="$account_currency_code" />
|
||||
<x-form.input.hidden name="currency_rate" value="1" />
|
||||
</div>
|
||||
@endif
|
||||
Loading…
Reference in New Issue