Skip to content

Commit

Permalink
SearchKit - Expose SearchSegment fields as filters
Browse files Browse the repository at this point in the history
Fixes dev/core#3929
By adding an input type to SearchSegments, Afform now picks them up as filter fields.
  • Loading branch information
colemanw committed Oct 25, 2022
1 parent 815858f commit f376230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function modifySpec(RequestSpec $spec) {
$field->setOptions(array_column($set['items'], 'label'));
$field->setSuffixes(['label']);
$field->setSqlRenderer([__CLASS__, 'renderSql']);
$field->setInputType('Select');
$spec->addFieldSpec($field);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function testRangeSearchSegment() {

$this->assertEquals('Giving Tier', $getField['label']);
$this->assertEquals('Extra', $getField['type']);
$this->assertEquals('Select', $getField['input_type']);
$this->assertEquals(['Low ball', 'Minor league', 'Major league', 'Heavy hitter'], $getField['options']);

$params = [
Expand Down

0 comments on commit f376230

Please sign in to comment.