From 9baeec11ece2c7236e767456682c3e449f54326b Mon Sep 17 00:00:00 2001 From: Nic Date: Fri, 8 Nov 2024 19:25:50 -0600 Subject: [PATCH 1/8] UPDATE Silverstripe 6 --- composer.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index fb37934..e296843 100644 --- a/composer.json +++ b/composer.json @@ -8,15 +8,11 @@ "CMS" ], "require": { - "jonom/focuspoint": "^5", "silverstripe/linkfield":"^4.0", - "silverstripe/recipe-cms": "^5.0", - "symbiote/silverstripe-gridfieldextensions": "^4" + "silverstripe/recipe-cms": "6.x-dev" }, "require-dev": { - "dnadesign/silverstripe-elemental": "^5", - "silverstripe/recipe-testing": "^3", - "squizlabs/php_codesniffer": "^3.7" + "dnadesign/silverstripe-elemental": "6.x-dev" }, "minimum-stability": "dev", "prefer-stable": true, @@ -28,7 +24,7 @@ }, "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } } } From 5bc0d7b5a3250d8962c317cc50307d713cb80060 Mon Sep 17 00:00:00 2001 From: Nic Date: Fri, 8 Nov 2024 19:29:32 -0600 Subject: [PATCH 2/8] UPDATE linkfield requriement --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e296843..bf41b67 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "CMS" ], "require": { - "silverstripe/linkfield":"^4.0", + "silverstripe/linkfield":"^5.0", "silverstripe/recipe-cms": "6.x-dev" }, "require-dev": { From 675cbee773bbb4c240bff3802cd456efb4e2f23f Mon Sep 17 00:00:00 2001 From: Nic Date: Fri, 8 Nov 2024 19:35:28 -0600 Subject: [PATCH 3/8] UPDATE GFE for Silverstripe 6 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf41b67..19d200f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ ], "require": { "silverstripe/linkfield":"^5.0", - "silverstripe/recipe-cms": "6.x-dev" + "silverstripe/recipe-cms": "6.x-dev", + "symbiote/silverstripe-gridfieldextensions": "^5" }, "require-dev": { "dnadesign/silverstripe-elemental": "6.x-dev" From 008455b813f84a5a875cf9fdc037d4a49f635f17 Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 8 Nov 2024 19:58:42 -0600 Subject: [PATCH 4/8] UPDATE extension class --- src/Extension/CarouselPageExtension.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Extension/CarouselPageExtension.php b/src/Extension/CarouselPageExtension.php index e671ebc..948f6d3 100644 --- a/src/Extension/CarouselPageExtension.php +++ b/src/Extension/CarouselPageExtension.php @@ -2,10 +2,11 @@ namespace Dynamic\Carousel\Extension; +use SilverStripe\Core\Extension; +use SilverStripe\ORM\ManyManyList; use SilverStripe\View\SSViewer; use Dynamic\Carousel\Model\Slide; use SilverStripe\Forms\FieldList; -use SilverStripe\ORM\DataExtension; use SilverStripe\Forms\NumericField; use SilverStripe\Forms\DropdownField; use SilverStripe\Forms\CompositeField; @@ -29,7 +30,7 @@ * @property int $Interval * @method ManyManyList|Slide[] Slides() */ -class CarouselPageExtension extends DataExtension +class CarouselPageExtension extends Extension { /** * @var array @@ -48,7 +49,7 @@ class CarouselPageExtension extends DataExtension * @config */ private static $many_many = [ - 'Slides' => 'Dynamic\\Carousel\\Model\\Slide', + 'Slides' => Slide::class, ]; /** From af34d99c90fd97f359ad4dda4475e9efdf3bb95b Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 8 Nov 2024 20:52:42 -0600 Subject: [PATCH 5/8] UPDATE vcs and hide slides tab --- composer.json | 9 ++++++++- src/Extension/CarouselPageExtension.php | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 19d200f..cf572aa 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,18 @@ "require": { "silverstripe/linkfield":"^5.0", "silverstripe/recipe-cms": "6.x-dev", - "symbiote/silverstripe-gridfieldextensions": "^5" + "symbiote/silverstripe-gridfieldextensions": "^5", + "jonom/focuspoint": "dev-silverstripe6" }, "require-dev": { "dnadesign/silverstripe-elemental": "6.x-dev" }, + "repositories": [ + { + "type": "vcs", + "url": "git@github.com:muskie9/silverstripe-focuspoint.git" + } + ], "minimum-stability": "dev", "prefer-stable": true, "autoload": { diff --git a/src/Extension/CarouselPageExtension.php b/src/Extension/CarouselPageExtension.php index 948f6d3..ca40e1b 100644 --- a/src/Extension/CarouselPageExtension.php +++ b/src/Extension/CarouselPageExtension.php @@ -77,6 +77,8 @@ class CarouselPageExtension extends Extension public function updateCMSFields(\SilverStripe\Forms\FieldList $fields) { if ($this->getOwner()->exists()) { + $fields->removeByName('Slides'); + $grid = GridField::create( 'Slides', 'Slides', From 215052efd14aaba40fd08e0b2119d649e6c705c5 Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 8 Nov 2024 21:18:58 -0600 Subject: [PATCH 6/8] UPDATE working display logic --- src/Model/VideoSlide.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/VideoSlide.php b/src/Model/VideoSlide.php index c443d2f..0c55ff9 100644 --- a/src/Model/VideoSlide.php +++ b/src/Model/VideoSlide.php @@ -34,6 +34,7 @@ class VideoSlide extends Slide */ private static $db = [ 'VideoType' => 'Enum(["Embed","Native"], "Embed")', + 'VideoURL' => 'Varchar(255)', ]; /** @@ -56,7 +57,11 @@ class VideoSlide extends Slide public function getCMSFields(): FieldList { $this->beforeUpdateCMSFields(function (FieldList $fields) { - //$fields-> + $native = $fields->dataFieldByName('Video'); + $embed = $fields->dataFieldByName('VideoURL'); + + $native->displayIf('VideoType')->isEqualTo('Native')->end(); + $embed->displayIf('VideoType')->isEqualTo('Embed')->end(); }); return parent::getCMSFields(); From 6c6910602ef4bcc4c0f5f63f5f3b2271273cc6d5 Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 8 Nov 2024 21:20:02 -0600 Subject: [PATCH 7/8] UPDATE display logic for SS 6 --- composer.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cf572aa..efe6cf5 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "silverstripe/linkfield":"^5.0", "silverstripe/recipe-cms": "6.x-dev", "symbiote/silverstripe-gridfieldextensions": "^5", - "jonom/focuspoint": "dev-silverstripe6" + "jonom/focuspoint": "dev-silverstripe6", + "unclecheese/display-logic": "dev-silverstripe6" }, "require-dev": { "dnadesign/silverstripe-elemental": "6.x-dev" @@ -20,6 +21,10 @@ { "type": "vcs", "url": "git@github.com:muskie9/silverstripe-focuspoint.git" + }, + { + "type": "vcs", + "url": "git@github.com:dynamic/silverstripe-display-logic.git" } ], "minimum-stability": "dev", From 35cb9d24fc827cbbd6abec7e4f96fcc3d3ce9171 Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 22 Nov 2024 20:17:35 -0600 Subject: [PATCH 8/8] UPDATE dev requirements --- composer.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index efe6cf5..0e4218c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,13 @@ "unclecheese/display-logic": "dev-silverstripe6" }, "require-dev": { - "dnadesign/silverstripe-elemental": "6.x-dev" + "dnadesign/silverstripe-elemental": "6.x-dev", + "phpunit/phpunit": "^11.3", + "squizlabs/php_codesniffer": "^3.7", + "silverstripe/versioned": "^3", + "silverstripe/standards": "^1", + "phpstan/extension-installer": "^1.3", + "silverstripe/frameworktest": "^2" }, "repositories": [ {