Skip to content

Commit

Permalink
Update paid content picker logic as we now support labs containers (#…
Browse files Browse the repository at this point in the history
…26202)

* Update paid content picker logic as we now support labs containers

* ooops, this logic should be the opposite way around - we DO NOT support paid fronts
  • Loading branch information
alinaboghiu committed Jun 16, 2023
1 parent b1d7a59 commit f0bea4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion article/app/controllers/ArticleController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class ArticleController(
private def getDCRJson(article: ArticlePage, blocks: Blocks)(implicit request: RequestHeader): String = {
val pageType: PageType = PageType(article, request, context)
val newsletter = newsletterService.getNewsletterForArticle(article)
val edition = Edition(request)

DotcomRenderingDataModel.toJson(
DotcomRenderingDataModel
Expand Down
13 changes: 6 additions & 7 deletions facia/app/services/dotcomrendering/FaciaPicker.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package services.dotcomrendering

import common.GuLogging
import common.{Edition, GuLogging}
import conf.switches.Switches.DCRFronts
import implicits.Requests._
import model.PressedPage
import model.facia.PressedCollection
import model.pressed.{LinkSnap}
import model.pressed.LinkSnap
import play.api.mvc.RequestHeader
import views.support.Commercial

Expand Down Expand Up @@ -116,12 +116,11 @@ object FrontChecks {
!faciaPage.metadata.hasPageSkin(request)
}

def hasNoPaidCards(faciaPage: PressedPage): Boolean = {
// We don't support paid content
def isNotPaidFront(faciaPage: PressedPage)(implicit request: RequestHeader): Boolean = {
// We don't support paid fronts
// See: https://github.com/guardian/dotcom-rendering/issues/5945
// See: https://github.com/guardian/dotcom-rendering/issues/5150

!faciaPage.collections.exists(_.curated.exists(card => card.isPaidFor))
!faciaPage.isPaid(Edition(request));
}

def hasNoRegionalAusTargetedContainers(faciaPage: PressedPage): Boolean = {
Expand Down Expand Up @@ -175,7 +174,7 @@ object FaciaPicker extends GuLogging {
("hasNoWeatherWidget", FrontChecks.hasNoWeatherWidget(faciaPage)),
("isNotAdFree", FrontChecks.isNotAdFree()),
("hasNoPageSkin", FrontChecks.hasNoPageSkin(faciaPage)),
("hasNoPaidCards", FrontChecks.hasNoPaidCards(faciaPage)),
("isNotPaidFront", FrontChecks.isNotPaidFront(faciaPage)),
("hasNoRegionalAusTargetedContainers", FrontChecks.hasNoRegionalAusTargetedContainers(faciaPage)),
("hasNoUnsupportedSnapLinkCards", FrontChecks.hasNoUnsupportedSnapLinkCards(faciaPage)),
("hasNoDynamicPackage", FrontChecks.hasNoDynamicPackage(faciaPage)),
Expand Down

0 comments on commit f0bea4e

Please sign in to comment.