Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add A Feature Switch For DCAR Galleries #27555

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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
}

Expand Down
10 changes: 10 additions & 0 deletions common/app/conf/switches/FeatureSwitches.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]")),
safeState = Off,
sellByDate = never,
exposeClientSide = false,
)
}
Loading