Skip to content

Commit

Permalink
Merge pull request #27489 from guardian/dina/remove-survey-switch
Browse files Browse the repository at this point in the history
Remove `surveys` switch
  • Loading branch information
deedeeh authored Sep 19, 2024
2 parents 2058b7a + 98b7f17 commit 353040d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
3 changes: 1 addition & 2 deletions applications/app/views/fragments/mediaBody.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import common.LinkTo
@import conf.switches.Switches.SurveySwitch
@import model.{MediaPage, Video, VideoPlayer}
@import views.support.Commercial.{isAdFree, isPaidContent}
@import views.support.TrailCssClasses.toneClass
Expand All @@ -22,7 +21,7 @@
)"
itemscope itemtype="@media.metadata.schemaType" role="main">

@if(!page.metadata.isFront && SurveySwitch.isSwitchedOn) {
@if(!page.metadata.isFront && page.metadata.hasSurveyAd(request)) {
@fragments.commercial.survey()
}

Expand Down
2 changes: 1 addition & 1 deletion article/app/pages/StoryHtmlPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ object StoryHtmlPage {
bodyTag(classes = bodyClasses)(
skipToMainContent(),
pageSkin() when page.metadata.hasPageSkin(request),
survey() when SurveySwitch.isSwitchedOn,
survey() when page.metadata.hasSurveyAd(request),
header,
mainContent(),
content,
Expand Down
3 changes: 1 addition & 2 deletions common/app/common/dfp/SurveySponsorshipAgent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package common.dfp
import play.api.mvc.RequestHeader
import model.{MetaData}
import model.DotcomContentType
import conf.switches.Switches.{SurveySwitch}
import net.liftweb.json.Meta

trait SurveySponsorshipAgent {
Expand All @@ -21,7 +20,7 @@ trait SurveySponsorshipAgent {
}

def hasSurveyAd(fullAdUnitPath: String, metadata: MetaData, request: RequestHeader): Boolean = {
if (metadata.contentType == Some(DotcomContentType.Article) && SurveySwitch.isSwitchedOn) {
if (metadata.contentType == Some(DotcomContentType.Article)) {
val adTest = request.getQueryString("adtest")

findSponsorships(fullAdUnitPath, metadata, adTest).nonEmpty
Expand Down
10 changes: 0 additions & 10 deletions common/app/conf/switches/CommercialSwitches.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ trait CommercialSwitches {
exposeClientSide = true,
)

val SurveySwitch = Switch(
Commercial,
"surveys",
"For delivering surveys, enables the requesting of the out-of-page slot on non-fronts. Switch OFF if there are no surveys active in GAM",
owners = Seq(Owner.withName("unknown")),
safeState = Off,
sellByDate = never,
exposeClientSide = true,
)

val ImrWorldwideSwitch = Switch(
Commercial,
"imr-worldwide",
Expand Down
3 changes: 1 addition & 2 deletions common/app/views/main.scala.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@(projectName: Option[String] = None)(head: Html)(body: Html)(implicit page: model.Page, request: RequestHeader, context: model.ApplicationContext)
@import common.{Edition, commercial}
@import conf.switches.Switches.SurveySwitch
@import model.Page.getContent
@import views.support.{Commercial, RenderClasses}
@import play.api.Mode.Dev
Expand Down Expand Up @@ -45,7 +44,7 @@
@fragments.commercial.pageSkin()
}

@if(!page.metadata.isFront && SurveySwitch.isSwitchedOn) {
@if(!page.metadata.isFront && page.metadata.hasSurveyAd(request)) {
@fragments.commercial.survey()
}

Expand Down

0 comments on commit 353040d

Please sign in to comment.