Skip to content

Commit

Permalink
🔥 chore: remove symbiote/silverstripe-gridfieldextensions
Browse files Browse the repository at this point in the history
- Removed because it is no longer relevant
- Remove autocomplete for browser version gridfield
  • Loading branch information
Cambis committed Jul 22, 2024
1 parent 7e6f30d commit ad2df4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions build/composer-php-81.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"php": "^8.1",
"silverstripe/admin": "^1.0 || ^2.0",
"silverstripe/framework": "^4.0 || ^5.0",
"silverstripe/siteconfig": "^4.0 || ^5.0",
"symbiote/silverstripe-gridfieldextensions": "^3.0 || ^4.0"
"silverstripe/siteconfig": "^4.0 || ^5.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"php": "^8.3",
"silverstripe/admin": "^1.0 || ^2.0",
"silverstripe/framework": "^4.0 || ^5.0",
"silverstripe/siteconfig": "^4.0 || ^5.0",
"symbiote/silverstripe-gridfieldextensions": "^3.0 || ^4.0"
"silverstripe/siteconfig": "^4.0 || ^5.0"
},
"require-dev": {
"cambis/silverstripe-rector": "^0.5.0",
Expand Down
11 changes: 0 additions & 11 deletions src/Admin/AnnouncementAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

use DNADesign\BrowserUpdate\Model\Announcement;
use SilverStripe\Admin\ModelAdmin;
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\ORM\DataObject;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;

class AnnouncementAdmin extends ModelAdmin
{
Expand All @@ -22,13 +20,4 @@ class AnnouncementAdmin extends ModelAdmin
private static string $menu_title = 'Browser update announcements';

private static string $menu_icon_class = 'font-icon-attention-1';

protected function getGridFieldConfig(): GridFieldConfig
{
$config = parent::getGridFieldConfig();

$config->addComponent(GridFieldOrderableRows::create('Sort'));

return $config;
}
}
6 changes: 3 additions & 3 deletions src/Model/Announcement.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
use SilverStripe\Forms\NumericField;
use SilverStripe\Forms\TextField;
Expand All @@ -32,7 +33,6 @@
* @property bool $NoClose
* @property bool $NoMessage
* @property bool $NoPermanentHide
* @property int $Sort
* @method HasManyList<BrowserVersion> BrowserVersions()
*/
class Announcement extends DataObject implements BrowserUpdateInterface, PermissionProvider
Expand Down Expand Up @@ -64,7 +64,6 @@ class Announcement extends DataObject implements BrowserUpdateInterface, Permiss
'NoClose' => 'Boolean(0)',
'NoMessage' => 'Boolean(0)',
'NoPermanentHide' => 'Boolean(0)',
'Sort' => 'Int',
];

/**
Expand Down Expand Up @@ -115,7 +114,8 @@ public function getCMSFields(): FieldList
{
$fields = parent::getCMSFields();

$gridFieldConfig = GridFieldConfig_RelationEditor::create();
$gridFieldConfig = GridFieldConfig_RelationEditor::create()
->removeComponentsByType([GridFieldAddExistingAutocompleter::class]);

$gridField = GridField::create(
'BrowserVersions',
Expand Down

0 comments on commit ad2df4a

Please sign in to comment.