mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-07 11:39:30 +00:00
Do not create the filter form in the ajax requests for tables, if it is not needed
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / docker (push) Has been cancelled
Docker Image Build (FrankenPHP) / docker (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / docker (push) Has been cancelled
Docker Image Build (FrankenPHP) / docker (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled
This commit is contained in:
parent
ab92620f56
commit
e1418dfdc1
1 changed files with 11 additions and 6 deletions
|
|
@ -154,12 +154,17 @@ class PartListsController extends AbstractController
|
||||||
$filter_changer($filter);
|
$filter_changer($filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If we are in a post request for the tables, we only have to apply the filter form if the submit query param was set
|
||||||
|
//This saves us some time from creating this complicated term on simple list pages, where no special filter is applied
|
||||||
|
$filterForm = null;
|
||||||
|
if ($request->getMethod() !== 'POST' || $request->query->has('part_filter')) {
|
||||||
$filterForm = $this->createForm(PartFilterType::class, $filter, ['method' => 'GET']);
|
$filterForm = $this->createForm(PartFilterType::class, $filter, ['method' => 'GET']);
|
||||||
if($form_changer !== null) {
|
if ($form_changer !== null) {
|
||||||
$form_changer($filterForm);
|
$form_changer($filterForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filterForm->handleRequest($formRequest);
|
$filterForm->handleRequest($formRequest);
|
||||||
|
}
|
||||||
|
|
||||||
$table = $this->dataTableFactory->createFromType(PartsDataTable::class, array_merge(
|
$table = $this->dataTableFactory->createFromType(PartsDataTable::class, array_merge(
|
||||||
['filter' => $filter], $additional_table_vars),
|
['filter' => $filter], $additional_table_vars),
|
||||||
|
|
@ -186,7 +191,7 @@ class PartListsController extends AbstractController
|
||||||
|
|
||||||
return $this->render($template, array_merge([
|
return $this->render($template, array_merge([
|
||||||
'datatable' => $table,
|
'datatable' => $table,
|
||||||
'filterForm' => $filterForm->createView(),
|
'filterForm' => $filterForm?->createView(),
|
||||||
], $additonal_template_vars));
|
], $additonal_template_vars));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue