Merge pull request #1919 from SevanNerse/filter-values

values property will be considered while creating filters
This commit is contained in:
Denis Duliçi 2021-03-09 17:20:18 +03:00 committed by GitHub
commit 417df3c37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ class SearchString extends Component
{
$filter = true;
if (empty($this->getFilterUrl($column, $options)) && (!isset($options['date']) && !isset($options['boolean']))) {
if (empty($this->getFilterUrl($column, $options)) && (!isset($options['date']) && !isset($options['boolean']) && !isset($options['values']))) {
$filter = false;
}
@ -199,6 +199,10 @@ class SearchString extends Component
'value' => empty($options['translation']) ? trans('general.yes') : trans($options['translation'][1]),
],
];
} else if (isset($options['values'])) {
foreach ($options['values'] as $key => $value) {
$values[$key] = trans($value);
}
} else if ($search = request()->get('search', false)) {
$fields = explode(' ', $search);