From 2353b7ce6f0f6867d2c05f22310f282eacc2dae7 Mon Sep 17 00:00:00 2001 From: Paul Dempsey <76729591+paul-daniel-dempsey@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:43:14 +0000 Subject: [PATCH] review: routing changed to include testUser --- .../controllers/SubscriptionsController.scala | 47 ++++++++++--------- support-frontend/app/wiring/Controllers.scala | 1 + 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/support-frontend/app/controllers/SubscriptionsController.scala b/support-frontend/app/controllers/SubscriptionsController.scala index b46bf40323..56821d4aeb 100644 --- a/support-frontend/app/controllers/SubscriptionsController.scala +++ b/support-frontend/app/controllers/SubscriptionsController.scala @@ -14,7 +14,7 @@ import config.StringsConfig import lib.RedirectWithEncodedQueryString import play.api.mvc._ import play.twirl.api.Html -import services.CachedProductCatalogServiceProvider +import services.{CachedProductCatalogServiceProvider, TestUserService} import services.pricing.{PriceSummary, PriceSummaryServiceProvider} import views.EmptyDiv import views.ViewHelpers.outputJson @@ -30,6 +30,7 @@ class SubscriptionsController( settingsProvider: AllSettingsProvider, val supportUrl: String, stage: Stage, + testUserService: TestUserService, cachedProductCatalogServiceProvider: CachedProductCatalogServiceProvider, )(implicit val ec: ExecutionContext) extends AbstractController(components) @@ -93,29 +94,31 @@ class SubscriptionsController( ) ++ paperMap } - def landing(countryCode: String): Action[AnyContent] = CachedAction() { implicit request => - implicit val settings: AllSettings = settingsProvider.getAllSettings() - val title = "Support the Guardian | Get a Subscription" - val mainElement = EmptyDiv("subscriptions-landing-page") - val js = "subscriptionsLandingPage.js" - val pricingCopy = CountryGroup.byId(countryCode).map(getLandingPrices) - val productCatalog = cachedProductCatalogServiceProvider.fromStage(stage, false).get() - - Ok( - views.html.main( - title, - mainElement, - RefPath(js), - Some(RefPath("subscriptionsLandingPage.css")), - description = stringsConfig.subscriptionsLandingDescription, - noindex = stage != PROD, - ) { - Html(s"""""") - }, - ).withSettingsSurrogateKey + }, + ).withSettingsSurrogateKey + } } - } diff --git a/support-frontend/app/wiring/Controllers.scala b/support-frontend/app/wiring/Controllers.scala index 6f77c7d55e..67a376dc91 100644 --- a/support-frontend/app/wiring/Controllers.scala +++ b/support-frontend/app/wiring/Controllers.scala @@ -62,6 +62,7 @@ trait Controllers { allSettingsProvider, appConfig.supportUrl, appConfig.stage, + testUsers, cachedProductCatalogServiceProvider, )