mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #10384 from creative-commoners/pulls/4.11/remove-wrong-message
FIX Unexpected message issue
This commit is contained in:
commit
3cad03357a
@ -362,7 +362,7 @@ class GridFieldFilterHeader extends AbstractGridFieldComponent implements GridFi
|
||||
}
|
||||
|
||||
foreach ($searchFields->getIterator() as $field) {
|
||||
$field->addExtraClass('stacked');
|
||||
$field->addExtraClass('stacked no-change-track');
|
||||
}
|
||||
|
||||
$name = $gridField->Title ?: singleton($gridField->getModelClass())->i18n_plural_name();
|
||||
|
@ -139,4 +139,21 @@ class GridFieldFilterHeaderTest extends SapphireTest
|
||||
'GridFieldFilterHeader::handleAction resets the gridstate filter when the user resets the search.'
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetSearchForm()
|
||||
{
|
||||
$searchForm = $this->component->getSearchForm($this->gridField);
|
||||
|
||||
$this->assertTrue($searchForm instanceof Form);
|
||||
$this->assertEquals('Search__Name', $searchForm->fields[0]->Name);
|
||||
$this->assertEquals('Search__City', $searchForm->fields[1]->Name);
|
||||
$this->assertEquals('Search__Cheerleader__Hat__Colour', $searchForm->fields[2]->Name);
|
||||
$this->assertEquals('TeamsSearchForm', $searchForm->Name);
|
||||
$this->assertEquals('cms-search-form', $searchForm->extraClasses['cms-search-form']);
|
||||
|
||||
foreach ($searchForm->fields as $field) {
|
||||
$this->assertEquals('stacked', $field->extraClasses['stacked']);
|
||||
$this->assertEquals('no-change-track', $field->extraClasses['no-change-track']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user