Skip to content

Commit a76683e

Browse files
Merge branch 'main' of https://github.com/guardian/frontend into 442-add-feature-flag-toggle-for-sign-up-component
2 parents e40ba47 + 8cda7ee commit a76683e

File tree

14 files changed

+100
-47
lines changed

14 files changed

+100
-47
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=3.10.2
1+
version=3.10.3
22
runner.dialect = scala213
33

44
maxColumn = 120

common/app/experiments/Experiments.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,22 @@ import java.time.LocalDate
1111
object ActiveExperiments extends ExperimentsDefinition {
1212
override val allExperiments: Set[Experiment] =
1313
Set(
14+
StarRatingRedesign,
1415
DarkModeWeb,
1516
GoogleOneTap,
1617
)
1718
implicit val canCheckExperiment: CanCheckExperiment = new CanCheckExperiment(this)
1819
}
1920

21+
object StarRatingRedesign
22+
extends Experiment(
23+
name = "star-rating-redesign",
24+
description = "Enable the refreshed star ratings design",
25+
owners = Seq(Owner.withEmail("[email protected]")),
26+
sellByDate = LocalDate.of(2026, 2, 2),
27+
participationGroup = Perc0A,
28+
)
29+
2030
object GoogleOneTap
2131
extends Experiment(
2232
name = "google-one-tap",

common/app/model/content.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ final case class Content(
8686
lazy val isImmersive =
8787
fields.displayHint.contains("immersive") || isGallery || tags.isTheMinuteArticle || isPhotoEssay
8888
lazy val isPaidContent: Boolean = tags.tags.exists { tag => tag.id == "tone/advertisement-features" }
89-
lazy val isTheFilter: Boolean = tags.tags.exists { tag => tag.id == "thefilter/series/the-filter" }
89+
lazy val isTheFilterUk: Boolean = tags.tags.exists { tag => tag.id == "thefilter/series/the-filter" }
90+
lazy val isTheFilterUs: Boolean = tags.tags.exists { tag => tag.id == "thefilter-us/series/thefilter-us" }
9091
lazy val isUSProductionOffice: Boolean = productionOffice.exists(_.toLowerCase == "us")
9192
lazy val campaigns: List[Campaign] =
9293
_root_.commercial.targeting.CampaignAgent.getCampaignsForTags(tags.tags.map(_.id))
@@ -102,7 +103,7 @@ final case class Content(
102103
// Some Labs pages have quiz atoms but are not tagged as quizzes
103104
val hasQuizAtoms: Boolean = atoms.exists(a => a.quizzes.nonEmpty)
104105

105-
AmpArticleSwitch.isSwitchedOn && hasBodyBlocks && !tags.isQuiz && !hasQuizAtoms && !isTheFilter
106+
AmpArticleSwitch.isSwitchedOn && hasBodyBlocks && !tags.isQuiz && !hasQuizAtoms && !isTheFilterUk
106107
} else {
107108
false
108109
}
@@ -164,6 +165,8 @@ final case class Content(
164165

165166
() match {
166167
case paid if isPaidContent => Paid
168+
case filterUk if isTheFilterUk => FilterUk
169+
case filterUs if isTheFilterUs => FilterUs
167170
case oldcommentObserver if isOldOpinion && isFromTheObserver =>
168171
CommentObserverOldContent(trail.webPublicationDate.getYear)
169172
case oldComment if isOldOpinion => CommentGuardianOldContent(trail.webPublicationDate.getYear)

common/app/navigation/NavLinks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ object NavLinks {
221221
NavLink("Blog", "/crosswords/crossword-blog"),
222222
NavLink("Quick", "/crosswords/series/quick"),
223223
NavLink("Sunday quick", "/crosswords/series/sunday-quick"),
224+
NavLink("Mini", "/crosswords/series/mini-crossword"),
224225
NavLink("Quick cryptic", "/crosswords/series/quick-cryptic"),
225226
NavLink("Quiptic", "/crosswords/series/quiptic"),
226227
NavLink("Cryptic", "/crosswords/series/cryptic"),
227228
NavLink("Prize", "/crosswords/series/prize"),
228229
NavLink("Genius", "/crosswords/series/genius"),
229230
NavLink("Weekend", "/crosswords/series/weekend-crossword"),
230231
NavLink("Special", "/crosswords/series/special"),
231-
NavLink("Mini", "/crosswords/series/mini-crossword"),
232232
),
233233
)
234234
val wordiply = NavLink(

common/app/views/support/ImageProfile.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ case class GuardianOldContent(publicationYear: Int) extends ShareImageCategory
193193
case class ObserverStarRating(rating: Int) extends ShareImageCategory
194194
case class GuardianStarRating(rating: Int) extends ShareImageCategory
195195
case object Paid extends ShareImageCategory
196+
case object FilterUk extends ShareImageCategory
197+
case object FilterUs extends ShareImageCategory
196198

197199
trait OverlayBase64 {
198200
def overlayUrlBase64(overlay: String): String =
@@ -223,6 +225,10 @@ object OpenGraphImage extends OverlayBase64 {
223225
case ObserverStarRating(rating) => starRatingObserver(rating, shouldIncludeOverlay, shouldUpscale)
224226
case GuardianStarRating(rating) => starRating(rating, shouldIncludeOverlay, shouldUpscale)
225227
case Paid => Item700
228+
case FilterUk =>
229+
new ShareImage(s"overlay-base64=${overlayUrlBase64("filter-uk.png")}", shouldIncludeOverlay, shouldUpscale)
230+
case FilterUs =>
231+
new ShareImage(s"overlay-base64=${overlayUrlBase64("filter-us.png")}", shouldIncludeOverlay, shouldUpscale)
226232
}
227233
}
228234

common/test/resources/reference-navigation.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,12 @@
821821
"children": [],
822822
"classList": []
823823
},
824+
{
825+
"title": "Mini",
826+
"url": "/crosswords/series/mini-crossword",
827+
"children": [],
828+
"classList": []
829+
},
824830
{
825831
"title": "Quick cryptic",
826832
"url": "/crosswords/series/quick-cryptic",
@@ -862,12 +868,6 @@
862868
"url": "/crosswords/series/special",
863869
"children": [],
864870
"classList": []
865-
},
866-
{
867-
"title": "Mini",
868-
"url": "/crosswords/series/mini-crossword",
869-
"children": [],
870-
"classList": []
871871
}
872872
],
873873
"classList": []
@@ -1592,6 +1592,12 @@
15921592
"children": [],
15931593
"classList": []
15941594
},
1595+
{
1596+
"title": "Mini",
1597+
"url": "/crosswords/series/mini-crossword",
1598+
"children": [],
1599+
"classList": []
1600+
},
15951601
{
15961602
"title": "Quick cryptic",
15971603
"url": "/crosswords/series/quick-cryptic",
@@ -1633,12 +1639,6 @@
16331639
"url": "/crosswords/series/special",
16341640
"children": [],
16351641
"classList": []
1636-
},
1637-
{
1638-
"title": "Mini",
1639-
"url": "/crosswords/series/mini-crossword",
1640-
"children": [],
1641-
"classList": []
16421642
}
16431643
],
16441644
"classList": []
@@ -2297,6 +2297,12 @@
22972297
"children": [],
22982298
"classList": []
22992299
},
2300+
{
2301+
"title": "Mini",
2302+
"url": "/crosswords/series/mini-crossword",
2303+
"children": [],
2304+
"classList": []
2305+
},
23002306
{
23012307
"title": "Quick cryptic",
23022308
"url": "/crosswords/series/quick-cryptic",
@@ -2338,12 +2344,6 @@
23382344
"url": "/crosswords/series/special",
23392345
"children": [],
23402346
"classList": []
2341-
},
2342-
{
2343-
"title": "Mini",
2344-
"url": "/crosswords/series/mini-crossword",
2345-
"children": [],
2346-
"classList": []
23472347
}
23482348
],
23492349
"classList": []
@@ -3162,6 +3162,12 @@
31623162
"children": [],
31633163
"classList": []
31643164
},
3165+
{
3166+
"title": "Mini",
3167+
"url": "/crosswords/series/mini-crossword",
3168+
"children": [],
3169+
"classList": []
3170+
},
31653171
{
31663172
"title": "Quick cryptic",
31673173
"url": "/crosswords/series/quick-cryptic",
@@ -3203,12 +3209,6 @@
32033209
"url": "/crosswords/series/special",
32043210
"children": [],
32053211
"classList": []
3206-
},
3207-
{
3208-
"title": "Mini",
3209-
"url": "/crosswords/series/mini-crossword",
3210-
"children": [],
3211-
"classList": []
32123212
}
32133213
],
32143214
"classList": []
@@ -4147,6 +4147,12 @@
41474147
"children": [],
41484148
"classList": []
41494149
},
4150+
{
4151+
"title": "Mini",
4152+
"url": "/crosswords/series/mini-crossword",
4153+
"children": [],
4154+
"classList": []
4155+
},
41504156
{
41514157
"title": "Quick cryptic",
41524158
"url": "/crosswords/series/quick-cryptic",
@@ -4188,12 +4194,6 @@
41884194
"url": "/crosswords/series/special",
41894195
"children": [],
41904196
"classList": []
4191-
},
4192-
{
4193-
"title": "Mini",
4194-
"url": "/crosswords/series/mini-crossword",
4195-
"children": [],
4196-
"classList": []
41974197
}
41984198
],
41994199
"classList": []

docs/03-dev-howtos/20-update-overlay-images.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Updating Social Media Overlay Images
44
We use the [overlay capability of Fastly IO](https://docs.fastly.com/api/imageopto/overlay) to generate images for social
55
media - [here](https://i.guim.co.uk/img/media/a16462a73520e333b6b0f84cc487dc5c1cde68a3/0_173_5184_3110/master/5184.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctb3BpbmlvbnMucG5n&s=63e3b63a91b42000daefd4811f513ada)
66
is an example with the guardian logo overlayed on it. The code that generates the urls for these images exists in
7-
`Profile.scala`.
7+
`ImageProfile.scala`.
88

99
Overlay images are currently all hosted from the frontend static S3 bucket, so to update the images you'll need access to
1010
S3. It's recommended you add any new overlay images under `overlays/`. You can check that your new image has been properly
@@ -18,7 +18,7 @@ If you've updated an image you'll need to clear the cache for that image using t
1818
image, for example `https://i.guim.co.uk/img/static/overlays/tg-default.png` - note that this URL isn't signed so will return
1919
a 403, but will still work in the cache clearing tool.
2020

21-
You can then reference the image in a url either by using the existing logic in `Profile.scala` or like this:
21+
You can then reference the image in a url either by using the existing logic in `ImageProfile.scala` or like this:
2222
`https://i.guim.co.uk/img/media/abc123/master/1234.jpg?overlay-base64=<base64encode(/img/static/overlays/logo.png)`
2323

2424
See the fastly docs referenced above, or if you're feeling brave the [fastly image service vcl](https://github.com/guardian/fastly-image-service)

identity/app/controllers/EmailVerificationController.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class EmailVerificationController(
2222

2323
def completeRegistration: Action[AnyContent] =
2424
Action.async { implicit request =>
25+
logger.info(s"Request path is: ${request.path}")
2526
val page = IdentityPage("/complete-registration", "Complete Signup", isFlow = true)
2627
val verifiedReturnUrlAsOpt = returnUrlVerifier.getVerifiedReturnUrl(request)
2728

@@ -41,10 +42,15 @@ class EmailVerificationController(
4142
logger.error("No encryptedEmail parameter present on complete registration page request")
4243
Future.successful(errorPage(verifiedReturnUrlAsOpt, page))
4344
})
45+
.map { result =>
46+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
47+
result
48+
}
4449
}
4550

4651
def resendValidationEmail: Action[AnyContent] =
4752
Action.async { implicit request =>
53+
logger.info(s"Request path is: ${request.path}")
4854
val page = IdentityPage("/complete-registration", "Complete Signup", isFlow = true)
4955
val verifiedReturnUrlAsOpt = returnUrlVerifier.getVerifiedReturnUrl(request)
5056
val email = request.session.get("email")
@@ -66,6 +72,10 @@ class EmailVerificationController(
6672
)
6773
Future.successful(errorPage(verifiedReturnUrlAsOpt, page))
6874
})
75+
.map { result =>
76+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
77+
result
78+
}
6979
}
7080

7181
private def successPage(

identity/app/controllers/FormstackController.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ class FormstackController(
2020

2121
def formstackForm(formReference: String): Action[AnyContent] =
2222
Action { implicit request =>
23-
NotFound(views.html.formstack.formstackFormNotFound(page))
23+
logger.info(s"Request path is: ${request.path}")
24+
val result = NotFound(views.html.formstack.formstackFormNotFound(page))
25+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
26+
result
2427
}
2528

2629
def complete: Action[AnyContent] =
2730
Action { implicit request =>
28-
Ok(views.html.formstack.formstackComplete(page))
31+
logger.info(s"Request path is: ${request.path}")
32+
val result = Ok(views.html.formstack.formstackComplete(page))
33+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
34+
result
2935
}
3036
}

identity/app/controllers/editprofile/ConsentsJourney.scala

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ trait ConsentsJourney extends EditProfileControllerComponents {
3636
def completeConsents: Action[AnyContent] =
3737
csrfCheck {
3838
consentAuthWithIdapiUserAction.async { implicit request =>
39+
logger.info(s"Request path is: ${request.path}")
3940
val returnUrlForm = Form(single("returnUrl" -> nonEmptyText))
4041
returnUrlForm
4142
.bindFromRequest()
@@ -67,20 +68,27 @@ trait ConsentsJourney extends EditProfileControllerComponents {
6768
}
6869
},
6970
)
71+
.map { result =>
72+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
73+
result
74+
}
7075
}
7176
}
7277

7378
private def displayConsentJourneyForm(page: ConsentJourneyPage, consentHint: Option[String]): Action[AnyContent] =
7479
csrfAddToken {
7580
consentAuthWithIdapiUserWithEmailValidation.async { implicit request =>
81+
logger.info(s"Request path is: ${request.path}")
7682
consentJourneyView(
7783
page = page,
7884
journey = page.journey,
7985
forms = ProfileForms(userWithOrderedConsents(request.user, consentHint), PublicEditProfilePage),
8086
request.user,
8187
consentHint,
82-
)
83-
88+
).map { result =>
89+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
90+
result
91+
}
8492
}
8593
}
8694

@@ -90,6 +98,7 @@ trait ConsentsJourney extends EditProfileControllerComponents {
9098
): Action[AnyContent] =
9199
csrfAddToken {
92100
consentAuthWithIdapiUserWithEmailValidation.async { implicit request =>
101+
logger.info(s"Request path is: ${request.path}")
93102
val returnUrl = returnUrlVerifier.getVerifiedReturnUrl(request) match {
94103
case Some(url) => if (url contains "/consents") returnUrlVerifier.defaultReturnUrl else url
95104
case _ => returnUrlVerifier.defaultReturnUrl
@@ -99,7 +108,10 @@ trait ConsentsJourney extends EditProfileControllerComponents {
99108
page,
100109
request.user,
101110
returnUrl,
102-
)
111+
).map { result =>
112+
logger.info(s"Response for ${request.path} is: ${result.header.status}")
113+
result
114+
}
103115
}
104116
}
105117

0 commit comments

Comments
 (0)