diff --git a/applications/app/services/dotcomrendering/GalleryPicker.scala b/applications/app/services/dotcomrendering/GalleryPicker.scala index 06daee8bbf8..7ba5bbffc1f 100644 --- a/applications/app/services/dotcomrendering/GalleryPicker.scala +++ b/applications/app/services/dotcomrendering/GalleryPicker.scala @@ -5,6 +5,7 @@ import model.Cors.RichRequestHeader import model.GalleryPage import play.api.mvc.RequestHeader import utils.DotcomponentsLogger +import conf.switches.Switches.DCARGalleryPages object GalleryPicker extends GuLogging { @@ -22,13 +23,12 @@ object GalleryPicker extends GuLogging { request: RequestHeader, ): RenderType = { - val participatingInTest = false // until we create a test for this content type val dcrCanRender = dcrCouldRender(galleryPage) val tier = { if (request.forceDCROff) LocalRender - else if (request.forceDCR) RemoteRender - else if (dcrCanRender && participatingInTest) RemoteRender + else if (request.forceDCR && DCARGalleryPages.isSwitchedOn()) RemoteRender + else if (dcrCanRender && DCARGalleryPages.isSwitchedOn()) RemoteRender else LocalRender } diff --git a/common/app/conf/switches/FeatureSwitches.scala b/common/app/conf/switches/FeatureSwitches.scala index 169593af64c..287d8a6a89a 100644 --- a/common/app/conf/switches/FeatureSwitches.scala +++ b/common/app/conf/switches/FeatureSwitches.scala @@ -512,4 +512,14 @@ trait FeatureSwitches { sellByDate = LocalDate.of(2024, 11, 29), exposeClientSide = true, ) + + val DCARGalleryPages = Switch( + SwitchGroup.Feature, + "dcar-gallery-pages", + "If this switch is on, we will render gallery pages with DCAR", + owners = Seq(Owner.withEmail("dotcom.platform@theguardian.com")), + safeState = Off, + sellByDate = never, + exposeClientSide = false, + ) }