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

Bump identity client lib to get new optout titles (#19532) · devhttps/frontend@cb87318 · GitHub

Commit cb87318

Browse files
authored
Bump identity client lib to get new optout titles (guardian#19532)
* Bump identity client lib to get new optout titles * Bump id client lib for NOT
1 parent 0e6d28b commit cb87318

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎identity/app/views/fragments/consentSwitch.scala.html‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
@import com.gu.identity.model.Consent
2+
@import com.gu.identity.model.ConsentWording
23
@import _root_.form.IdFormHelpers.nonInputFields
34
@import views.support.fragment.Switch._
45

56
@* Product consent switch/checkbox *@
67

7-
@(consentField: Field, highlighted: Boolean = false, skin: Option[String] = None, boldTitle: Boolean = true)(messages: play.api.i18n.Messages)
8+
@(
9+
consentField: Field,
10+
highlighted: Boolean = false,
11+
skin: Option[String] = None,
12+
boldTitle: Boolean = true,
13+
titleProvider: ConsentWording => String = w => w.wording,
14+
descriptionProvider: ConsentWording => Option[String] = w => w.description
15+
)(messages: play.api.i18n.Messages)
816

917
@getConsentText(consentField: Field) = @{
1018
Consent.wording(
@@ -19,9 +27,9 @@
1927
}
2028

2129
@fragments.form.switch(
22-
title = getConsentText(consentField).wording,
30+
title = titleProvider(getConsentText(consentField)),
2331
subheading = None,
24-
description = getConsentText(consentField).description,
32+
description = descriptionProvider(getConsentText(consentField)),
2533
behaviour = ConsentSwitch,
2634
field = consentField("consented"),
2735
extraFields = consentHiddenFormFields,

‎identity/app/views/profile/nonElectronicOptOut.scala.html‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
@helper.repeatWithIndex(privacyForm("consents"), min=1){ (consentField, index) =>
2020
@if(isOptOutChannel(consentField, user)) {
2121
<li>
22-
@fragments.consentSwitch(consentField, boldTitle = false)(messages)
22+
@fragments.consentSwitch(
23+
consentField,
24+
boldTitle = false,
25+
titleProvider = wording => wording.description.getOrElse(""),
26+
descriptionProvider = _ => None
27+
)(messages)
2328
</li>
2429
}
2530
}

‎project/Dependencies.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.gu
33
import sbt._
44

55
object Dependencies {
6-
val identityLibVersion = "3.139"
6+
val identityLibVersion = "3.141"
77
val awsVersion = "1.11.240"
88
val capiVersion = "12.0"
99
val faciaVersion = "2.6.0"

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL