Skip to content

Commit

Permalink
Merge branch '4.11' into 4
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 8, 2022
2 parents 3e85c4d + c0e8a21 commit b62c4a9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
17 changes: 0 additions & 17 deletions .scrutinizer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/Forms/GridField/GridFieldFilterHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function getSearchForm(GridField $gridField)
}

foreach ($searchFields->getIterator() as $field) {
$field->addExtraClass('stacked');
$field->addExtraClass('stacked no-change-track');
}

$name = $gridField->Title ?: singleton($gridField->getModelClass())->i18n_plural_name();
Expand Down
17 changes: 17 additions & 0 deletions tests/php/Forms/GridField/GridFieldFilterHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,21 @@ public function testHandleActionReset()
'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']);
}
}
}

0 comments on commit b62c4a9

Please sign in to comment.