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

Remove unused parameter from method #27047

Merged
merged 1 commit into from
May 16, 2024
Merged
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
2 changes: 1 addition & 1 deletion article/app/pages/StoryHtmlPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object StoryHtmlPage {
if (pageWithStoryPackage.item.tags.isLiveBlog) {
Html(s"<script>window.guardian.config.page.dcrCouldRender = true</script>")
} else {
val thisDcrCouldRender: Boolean = dcrChecks(pageWithStoryPackage, request).values.forall(identity)
val thisDcrCouldRender: Boolean = dcrChecks(pageWithStoryPackage).values.forall(identity)
Html(s"<script>window.guardian.config.page.dcrCouldRender = $thisDcrCouldRender</script>")
}
}
Expand Down
10 changes: 5 additions & 5 deletions article/app/services/dotcomrendering/ArticlePicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ object ArticlePageChecks {

object ArticlePicker {

def dcrChecks(page: PageWithStoryPackage, request: RequestHeader): Map[String, Boolean] = {
def dcrChecks(page: PageWithStoryPackage): Map[String, Boolean] = {
Map(
("isSupportedType", ArticlePageChecks.isSupportedType(page)),
("isNotAGallery", ArticlePageChecks.isNotAGallery(page)),
)
}

private[this] def dcrArticle100PercentPage(page: PageWithStoryPackage, request: RequestHeader): Boolean = {
val allowListFeatures = dcrChecks(page, request)
private[this] def dcrArticle100PercentPage(page: PageWithStoryPackage): Boolean = {
val allowListFeatures = dcrChecks(page)
val article100PercentPageFeatures = allowListFeatures.view.filterKeys(
Set(
"isSupportedType",
Expand All @@ -45,14 +45,14 @@ object ArticlePicker {
def getTier(page: PageWithStoryPackage, path: String)(implicit
request: RequestHeader,
): RenderType = {
val checks = dcrChecks(page, request)
val checks = dcrChecks(page)
val dcrCanRender = checks.values.forall(identity)
val isNotPaidContent = ArticlePageChecks.isNotPaidContent(page)
val shouldServePressed = PressedContent.isPressed(ensureStartingForwardSlash(path)) && isNotPaidContent

val tier: RenderType = decideTier(shouldServePressed, dcrCanRender)

val isArticle100PercentPage = dcrArticle100PercentPage(page, request);
val isArticle100PercentPage = dcrArticle100PercentPage(page)
val pageTones = page.article.tags.tones.map(_.id).mkString(", ")

// include features that we wish to log but not allow-list against
Expand Down