Skip to content

Commit

Permalink
Prevent galleries rendering in DCAR (#27556)
Browse files Browse the repository at this point in the history
Prevent galleries ever rendering in DCAR while we're working on them. This can be reverted or updated when we're ready to release them.
  • Loading branch information
JamieB-gu authored Oct 28, 2024
1 parent c1f98b2 commit 92848d6
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions applications/app/services/dotcomrendering/GalleryPicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,13 @@ import play.api.mvc.RequestHeader
import utils.DotcomponentsLogger

object GalleryPicker extends GuLogging {

/** Add to this function any logic for including/excluding a gallery article from being rendered with DCR
*
* Currently defaulting to false until we implement image articles in DCR
*/
private def dcrCouldRender(galleryPage: GalleryPage): Boolean = {
false
}

def getTier(
galleryPage: GalleryPage,
)(implicit
request: RequestHeader,
): RenderType = {
DotcomponentsLogger.logger.logRequest(s"path executing in web", Map.empty, galleryPage.gallery)

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 LocalRender
}

if (tier == RemoteRender) {
DotcomponentsLogger.logger.logRequest(s"path executing in dotcomponents", Map.empty, galleryPage.gallery)
} else {
DotcomponentsLogger.logger.logRequest(s"path executing in web", Map.empty, galleryPage.gallery)
}

tier
LocalRender
}
}

0 comments on commit 92848d6

Please sign in to comment.