Skip to content

Commit

Permalink
Merge pull request #876 from satrun77/pull/localisation-search
Browse files Browse the repository at this point in the history
Remove header filter from localisation grid field
  • Loading branch information
tractorcow authored Aug 20, 2024
2 parents 8f7d803 + 4448bef commit dc85ba9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Extension/Traits/FluentObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\Forms\GridField\GridFieldConfig_Base;
use SilverStripe\Forms\GridField\GridFieldDataColumns;
use SilverStripe\Forms\GridField\GridFieldFilterHeader;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataQuery;
Expand Down Expand Up @@ -101,6 +102,8 @@ protected function updateFluentCMSFields(FieldList $fields)

// Generate gridfield for handling localisations
$config = GridFieldConfig_Base::create();
// Remove filters as the displayed data is in ArrayList format
$config->removeComponentsByType(GridFieldFilterHeader::class);

$columns = $config->getComponentByType(GridFieldDataColumns::class);
$summaryColumns = [
Expand Down
2 changes: 2 additions & 0 deletions tests/php/Extension/FluentFilteredExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldFilterHeader;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use TractorCow\Fluent\Extension\FluentFilteredExtension;
Expand Down Expand Up @@ -151,6 +152,7 @@ public function testUpdateCMSFields()
LocaleToggleColumn::class,
$config->getComponentByType(LocaleToggleColumn::class)
);
$this->assertNull($config->getComponentByType(GridFieldFilterHeader::class));
});
}

Expand Down

0 comments on commit dc85ba9

Please sign in to comment.