From e9c5c19947ff0affd5083811d9ccaf6f6c70ccb5 Mon Sep 17 00:00:00 2001 From: Ioanna Kokkini Date: Mon, 8 Apr 2024 16:35:30 +0100 Subject: [PATCH 1/3] Render old liveblogs via DCR It looks like it's one of the last types of content still rendered by frontend. --- article/app/services/dotcomrendering/ArticlePicker.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/article/app/services/dotcomrendering/ArticlePicker.scala b/article/app/services/dotcomrendering/ArticlePicker.scala index 0e2f91429cb..749196fbc97 100644 --- a/article/app/services/dotcomrendering/ArticlePicker.scala +++ b/article/app/services/dotcomrendering/ArticlePicker.scala @@ -29,7 +29,6 @@ object ArticlePicker { Map( ("isSupportedType", ArticlePageChecks.isSupportedType(page)), ("isNotAGallery", ArticlePageChecks.isNotAGallery(page)), - ("isNotLiveBlog", ArticlePageChecks.isNotLiveBlog(page)), ) } @@ -39,7 +38,6 @@ object ArticlePicker { Set( "isSupportedType", "isNotAGallery", - "isNotLiveBlog", ), ) From ee221c909feba6bb72bec64e656b2b288f4f6da7 Mon Sep 17 00:00:00 2001 From: Ioanna Kokkini Date: Mon, 8 Apr 2024 17:29:24 +0100 Subject: [PATCH 2/3] Check that body links are in the json instead of the document --- article/test/ArticleControllerTest.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/article/test/ArticleControllerTest.scala b/article/test/ArticleControllerTest.scala index e6300d6d17c..8364d99970a 100644 --- a/article/test/ArticleControllerTest.scala +++ b/article/test/ArticleControllerTest.scala @@ -44,10 +44,13 @@ import services.newsletters.{NewsletterApi, NewsletterSignupAgent} } it should "count in body links" in { - val result = articleController.renderArticle(liveBlogUrl)(TestRequest(liveBlogUrl)) - val body = contentAsString(result) - body should include(""""inBodyInternalLinkCount":38""") - body should include(""""inBodyExternalLinkCount":42""") + val fakeRequest = FakeRequest("GET", s"$liveBlogUrl.json?dcr") + .withHeaders("Origin" -> "http://www.theorigin.com") + + val result = articleController.renderArticle(liveBlogUrl)(fakeRequest) + val content = contentAsString(result) + content should include(""""inBodyInternalLinkCount":38""") + content should include(""""inBodyExternalLinkCount":42""") } it should "not cache 404s" in { From 5e1f0714a3063fe178759e348e84c8138d5109ef Mon Sep 17 00:00:00 2001 From: Ioanna Kokkini Date: Tue, 9 Apr 2024 10:39:29 +0100 Subject: [PATCH 3/3] Remove `isNotLiveBlog` method from `ArticlePicker` Co-authored-by: Max Duval --- article/app/services/dotcomrendering/ArticlePicker.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/article/app/services/dotcomrendering/ArticlePicker.scala b/article/app/services/dotcomrendering/ArticlePicker.scala index 749196fbc97..41b8acd5b6b 100644 --- a/article/app/services/dotcomrendering/ArticlePicker.scala +++ b/article/app/services/dotcomrendering/ArticlePicker.scala @@ -18,8 +18,6 @@ object ArticlePageChecks { def isNotAGallery(page: PageWithStoryPackage): Boolean = !page.item.tags.isGallery - def isNotLiveBlog(page: PageWithStoryPackage): Boolean = !page.item.tags.isLiveBlog - def isNotPaidContent(page: PageWithStoryPackage): Boolean = !page.item.tags.isPaidContent }