fixed search string dynamic issues..
This commit is contained in:
parent
29ad5faff4
commit
b9057afd08
|
|
@ -71,6 +71,23 @@ abstract class Index extends Component
|
|||
|
||||
public $hideBulkAction;
|
||||
|
||||
public $bulkActions;
|
||||
|
||||
/** @var string */
|
||||
public $searchStringModel;
|
||||
|
||||
/** @var string */
|
||||
public $bulkActionClass;
|
||||
|
||||
/** @var array */
|
||||
public $bulkActionRouteParameters;
|
||||
|
||||
/** @var string */
|
||||
public $searchRoute;
|
||||
|
||||
/** @var string */
|
||||
public $classBulkAction;
|
||||
|
||||
public $hidePaidAt;
|
||||
|
||||
public $hideNumber;
|
||||
|
|
@ -154,6 +171,7 @@ abstract class Index extends Component
|
|||
bool $hideEmptyPage = false,
|
||||
bool $hideSummary = false, array $summaryItems = [],
|
||||
bool $hideSearchString = false, bool $hideBulkAction = false,
|
||||
string $searchStringModel = '', string $bulkActionClass = '', array $bulkActions = [], array $bulkActionRouteParameters = [], string $searchRoute = '', string $classBulkAction = '',
|
||||
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 = '',
|
||||
|
|
@ -209,6 +227,15 @@ abstract class Index extends Component
|
|||
/* Container Start */
|
||||
$this->hideSearchString = $hideSearchString;
|
||||
$this->hideBulkAction = $hideBulkAction;
|
||||
|
||||
$this->searchStringModel = $this->getSearchStringModel($type, $searchStringModel);
|
||||
|
||||
$this->bulkActionClass = $this->getBulkActionClass($type, $bulkActionClass);
|
||||
$this->bulkActionRouteParameters = $this->getBulkActionRouteParameters($type, $bulkActionRouteParameters);
|
||||
|
||||
$this->searchRoute = $this->getIndexRoute($type, $searchRoute);
|
||||
|
||||
$this->classBulkAction = $this->getClassBulkAction($type, $classBulkAction);
|
||||
|
||||
/* Document Start */
|
||||
$this->hidePaidAt = $hidePaidAt;
|
||||
|
|
|
|||
|
|
@ -310,6 +310,32 @@ return [
|
|||
|
||||
// Transactions
|
||||
'transaction' => [
|
||||
'transactions' => [
|
||||
'group' => 'banking',
|
||||
'route' => [
|
||||
'prefix' => 'transactions', // core use with group + prefix, module ex. estimates
|
||||
'parameter' => 'transaction', // banking/transactions/{parameter}/edit
|
||||
//'create' => 'transactions.create', // if you change route, you can write full path
|
||||
],
|
||||
'permission' => [
|
||||
'prefix' => 'transactions',
|
||||
//'create' => 'create-banking-transactions',
|
||||
],
|
||||
'translation' => [
|
||||
'prefix' => 'transactions', // this translation file name.
|
||||
'related_document_amount' => 'invoices.invoice_amount',
|
||||
'transactions' => 'general.incomes',
|
||||
],
|
||||
'contact_type' => 'customer',
|
||||
'document_type' => 'invoice',
|
||||
'split_type' => Transaction::INCOME_SPLIT_TYPE,
|
||||
'email_template' => 'payment_received_customer',
|
||||
'script' => [
|
||||
'folder' => 'banking',
|
||||
'file' => 'transactions',
|
||||
],
|
||||
],
|
||||
|
||||
Transaction::INCOME_TYPE => [
|
||||
'group' => 'banking',
|
||||
'route' => [
|
||||
|
|
|
|||
|
|
@ -58,16 +58,22 @@
|
|||
<x-slot name="content">
|
||||
@if ((! $hideSearchString) && (! $hideBulkAction))
|
||||
<x-index.search
|
||||
search-string="{{ $searchStringModel }}"
|
||||
bulk-action="{{ $bulkActionClass }}"
|
||||
route="{{ $searchRoute }}"
|
||||
|
||||
search-string="App\Models\Banking\Transaction"
|
||||
bulk-action="App\BulkActions\Banking\Transactions"
|
||||
/>
|
||||
@elseif ((! $hideSearchString) && $hideBulkAction)
|
||||
<x-index.search
|
||||
search-string="App\Models\Banking\Transaction"
|
||||
search-string="{{ $searchStringModel }}"
|
||||
route="{{ $searchRoute }}"
|
||||
/>
|
||||
@elseif ($hideSearchString && (! $hideBulkAction))
|
||||
<x-index.search
|
||||
bulk-action="App\BulkActions\Banking\Transactions"
|
||||
bulk-action="{{ $bulkActionClass }}"
|
||||
route="{{ $searchRoute }}"
|
||||
/>
|
||||
@endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue