FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #19640 from guardian/nb-lowercase-container-names · devhttps/frontend@e4ae03f · GitHub

Commit e4ae03f

Browse files
authored
Merge pull request guardian#19640 from guardian/nb-lowercase-container-names
/theguardian shouldn't have lowercase container names
2 parents ef20d96 + 8184330 commit e4ae03f

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

‎applications/app/services/NewspaperQuery.scala‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg
2323

2424
val dateForFrontPagePattern = DateTimeFormat.forPattern("EEEE d MMMM y")
2525
private val hrefFormat = DateTimeFormat.forPattern("yyyy/MMM/dd").withZone(DateTimeZone.UTC)
26-
val FRONT_PAGE_DISPLAY_NAME = "front page"
26+
val FRONT_PAGE_DISPLAY_NAME = "Front page"
2727
val pathToTag = Map("theguardian" -> "theguardian/mainsection", "theobserver" -> "theobserver/news")
2828

2929
def fetchLatestGuardianNewspaper()(implicit executionContext: ExecutionContext): Future[List[FaciaContainer]] = {
@@ -77,7 +77,7 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg
7777

7878
val bookSectionContainers = orderedBookSections.map { list =>
7979
val content = list.content.map(c => FaciaContentConvert.contentToFaciaContent(c))
80-
bookSectionContainer(Some(list.tag.id), Some(lowercaseDisplayName(list.tag.webTitle)), None, content, orderedBookSections.indexOf(list) + 1, Nil)
80+
bookSectionContainer(Some(list.tag.id), Some(list.tag.webTitle), None, content, orderedBookSections.indexOf(list) + 1, Nil)
8181
}
8282

8383
firstPageContainer :: bookSectionContainers
@@ -135,8 +135,6 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg
135135

136136
private def getNewspaperPageNumber(content: ApiContent) = content.fields.flatMap(_.newspaperPageNumber)
137137

138-
def lowercaseDisplayName(s: String): String = if(s.equals("UK news") || s.equals("US news")) s else s.toLowerCase()
139-
140138
def getPastSundayDateFor(date: DateTime): DateTime = {
141139
if(date.getDayOfWeek != DateTimeConstants.SUNDAY) {
142140
val daysSinceSunday = DateTimeConstants.SUNDAY - date.getDayOfWeek - 7

‎applications/test/services/NewspaperQueryTest.scala‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ import test.{ConfiguredTestSuite, WithMaterializer, WithTestContentApiClient, Wi
1717
lazy val newspaperQuery = new NewspaperQuery(testContentApiClient)
1818

1919
"NewspapeQueryTest" - {
20-
"lowercase display name except UK news and US news" in {
21-
newspaperQuery.lowercaseDisplayName("International") should be("international")
22-
newspaperQuery.lowercaseDisplayName("UK news") should be("UK news")
23-
newspaperQuery.lowercaseDisplayName("US news") should be("US news")
24-
}
25-
2620
"use past Sunday date for a given day (required for /theobserver)" in {
2721
newspaperQuery.getPastSundayDateFor(new DateTime(2015, 11, 19, 0, 0).withZone(DateTimeZone.UTC)).toISODateTimeString should be("2015-11-15T00:00:00.000Z")
2822
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL