diff --git a/library/Icingadb/Common/SearchControls.php b/library/Icingadb/Common/SearchControls.php index aeecfd587..698bbeae8 100644 --- a/library/Icingadb/Common/SearchControls.php +++ b/library/Icingadb/Common/SearchControls.php @@ -6,9 +6,9 @@ namespace Icinga\Module\Icingadb\Common; use Icinga\Module\Icingadb\Hook\SearchColumnsProviderHook; -use ipl\Html\Html; use ipl\Orm\Query; use ipl\Web\Control\SearchBar; +use ipl\Web\Control\SearchEditor; use ipl\Web\Url; use ipl\Web\Widget\ContinueWith; @@ -16,6 +16,7 @@ trait SearchControls { use \ipl\Web\Compat\SearchControls { \ipl\Web\Compat\SearchControls::createSearchBar as private webCreateSearchBar; + \ipl\Web\Compat\SearchControls::createSearchEditor as private webCreateSearchEditor; } /** @@ -31,11 +32,6 @@ public function createSearchBar(Query $query, ...$params): SearchBar { $searchBar = $this->webCreateSearchBar($query, ...$params); - if (($wrapper = $searchBar->getWrapper()) && ! $wrapper->getWrapper()) { - // TODO: Remove this once ipl-web v0.7.0 is required - $searchBar->addWrapper(Html::tag('div', ['class' => 'search-controls'])); - } - $model = $query->getModel(); $defaultColumns = $model->getSearchColumns(); $columns = SearchColumnsProviderHook::getCustomVarColumns($model, $defaultColumns); @@ -51,6 +47,20 @@ private function callHandleRequest() return false; } + /** + * Necessary because {@see self::callHandleRequest()} prevents the {@see webCreateSearchEditor()} from calling + * $editor->handleRequest() + * + * @inheritdoc + */ + public function createSearchEditor(Query $query, ...$params): SearchEditor + { + $editor = $this->webCreateSearchEditor($query, ...$params); + $editor->handleRequest($this->getServerRequest()); + + return $editor; + } + /** * Create and return a ContinueWith * diff --git a/public/css/common.less b/public/css/common.less index 1d223dc5c..6279e2727 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -107,52 +107,6 @@ div.show-more { .notice { display: none; } - - // TODO: Remove once ipl-web v0.7.0 is required - &:not(.default-layout) { - .pagination-control { - float: left; - } - - .sort-control { - display: flex; - justify-content: flex-end; - - :not(.form-element) > label { - margin-right: 0; - } - - .control-button { - margin: 0; - } - } - - > :not(:only-child) { - margin-bottom: 0.5em; - } - - .search-suggestions { - margin-bottom: 2.5em; - } - - .search-controls { - clear: both; - display: flex; - min-width: 100%; - - .search-bar { - flex: 1 1 auto; - - & ~ .control-button:last-child { - margin-right: -.5em; - } - - & ~ .control-button { - margin-left: .5em; - } - } - } - } } .content > h2:first-child,