refactor: Allow _perc and _current columns to be string for alert rules (#8532)

* refactor: Allow _perc and _current columns to be string for alert rules

* Moved the check for column type
This commit is contained in:
Neil Lathwood
2018-04-14 14:11:11 +01:00
committed by GitHub
parent d08e1e6bb9
commit 3db26c1d36

View File

@@ -110,8 +110,12 @@ class QueryBuilderFilter implements \JsonSerializable
$field = "$table.$column";
// format enums as radios
if ($type == 'enum') {
if (ends_with($column, ['_perc', '_current'])) {
$this->filter[$field] = [
'id' => $field,
'type' => 'string',
];
} elseif ($type == 'enum') {// format enums as radios
$values = explode(',', substr($column_type, 4));
$values = array_map(function ($val) {
return trim($val, "()' ");