mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
SearchControls: Don't override createSearchEditor
It's now obsolete since the customvar labels are generated by the model natively now. (or soon, depending on the commit order :'))
This commit is contained in:
parent
47332faffa
commit
17577cff1d
1 changed files with 1 additions and 27 deletions
|
|
@ -20,11 +20,10 @@ trait SearchControls
|
|||
{
|
||||
use \ipl\Web\Compat\SearchControls {
|
||||
\ipl\Web\Compat\SearchControls::createSearchBar as private webCreateSearchBar;
|
||||
\ipl\Web\Compat\SearchControls::enrichFilterCondition as private webEnrichFilterCondition;
|
||||
\ipl\Web\Compat\SearchControls::createSearchEditor as private webCreateSearchEditor;
|
||||
}
|
||||
|
||||
public function fetchMetaData(Query $query): array
|
||||
public function fetchFilterColumns(Query $query): array
|
||||
{
|
||||
return iterator_to_array(ObjectSuggestions::collectFilterColumns($query->getModel(), $query->getResolver()));
|
||||
}
|
||||
|
|
@ -136,29 +135,4 @@ trait SearchControls
|
|||
|
||||
return $continueWith;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enrich the filter condition with meta data from the query
|
||||
*
|
||||
* @param Filter\Condition $condition
|
||||
* @param Query $query
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function enrichFilterCondition(Filter\Condition $condition, Query $query)
|
||||
{
|
||||
$this->webEnrichFilterCondition($condition, $query);
|
||||
|
||||
$path = $condition->getColumn();
|
||||
if (strpos($path, '.vars.') !== false) {
|
||||
list($target, $varName) = explode('.vars.', $path);
|
||||
if (strpos($target, '.') === false) {
|
||||
// Programmatically translated since the full definition is available in class ObjectSuggestions
|
||||
$condition->metaData()->set(
|
||||
'columnLabel',
|
||||
sprintf(t(ucfirst($target) . ' %s', '..<customvar-name>'), $varName)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue