Skip to content

Commit

Permalink
AssignRenderer and Form: "is true/set" operator
Browse files Browse the repository at this point in the history
refs #339
fixes #729
fixes #739
  • Loading branch information
Thomas-Gelf committed Aug 25, 2017
1 parent ee21c63 commit 99eb6ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions application/views/helpers/FormDataFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ protected function element(FilterExpression $filter = null)
$filter->setExpression(json_decode($filter->getExpression()));
}

if ($filter->getExpression() === true) {
return '';
}
$dummy = IcingaObject::createByType($type);
$col = $filter->getColumn();
if ($dummy->hasProperty($col)) {
Expand Down Expand Up @@ -224,8 +227,6 @@ protected function text(Filter $filter = null)
$this->elementId('value', $filter),
$value
);

$value = '(' . implode('|', $value) . ')';
}

return $this->view->formText(
Expand Down Expand Up @@ -298,7 +299,7 @@ protected function selectSign(FilterExpression $filter = null)
'<=' => '<=',
'in' => 'in',
'contains' => 'contains',
// 'true' => 'is true (or set)',
'true' => 'is true (or set)',
);

if ($filter === null) {
Expand Down
3 changes: 3 additions & 0 deletions library/Director/IcingaConfig/AssignRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ protected function renderFilterExpression(FilterExpression $filter)
);
}
} elseif ($filter instanceof FilterMatch) {
if ($rawExpression === true) {
return $column;
}
if (strpos($expression, '*') === false) {
return $this->renderEquals($column, $expression);
} else {
Expand Down
4 changes: 2 additions & 2 deletions public/css/module.less
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ div.filter-expression {
margin: 0 0.3em;
&.wide {
min-width: 6em;
max-width: 6em;
width: 6em;
max-width: 8em;
width: 8em;
}
}

Expand Down

0 comments on commit 99eb6ac

Please sign in to comment.