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

Update new profiling opt out as well as old status field (#19635) · devhttps/frontend@32d7599 · GitHub

Commit 32d7599

Browse files
Calum Campbell
authored
Update new profiling opt out as well as old status field (guardian#19635)
* update new profiling opt out with old button * bump identity to 3.150 * remove old status field setting * remove old status fields from tests
1 parent a44c3bc commit 32d7599

7 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎identity/app/controllers/editprofile/EditProfileController.scala‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
3+
14
package controllers.editprofile
25

36
import actions.AuthenticatedActions

‎identity/app/form/AccountDetailsMapping.scala‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package form
22

33
import model.Titles
44
import play.api.data.Forms._
5-
import com.gu.identity.model.{PrivateFields, User, UserDates}
5+
import com.gu.identity.model.{Consent, PrivateFields, User, UserDates}
66
import idapiclient.UserUpdateDTO
77
import play.api.data.Mapping
88
import play.api.i18n.MessagesProvider
@@ -85,7 +85,8 @@ case class AccountFormData(
8585
billingCountry = billingAddress.flatMap(x => toUpdate(x.country, currentUser.privateFields.billingCountry)),
8686
telephoneNumber = telephoneNumber.flatMap(_.telephoneNumber)
8787
)),
88-
statusFields = Some(currentUser.statusFields.copy(allowThirdPartyProfiling = Some(allowThirdPartyProfiling)))
88+
statusFields = Some(currentUser.statusFields.copy(allowThirdPartyProfiling = Some(allowThirdPartyProfiling))),
89+
consents = Some(List(Consent(id = Consent.ProfilingOptout.id, consented = !allowThirdPartyProfiling)))
8990
)
9091
}
9192

‎identity/test/controllers/ConsentsJourneyControllerTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import scala.concurrent.Future
4747
val httpConfiguration = HttpConfiguration.createWithDefaults()
4848

4949
val userId: String = "123"
50-
val user = User("test@example.com", userId, statusFields = StatusFields(receive3rdPartyMarketing = Some(true), receiveGnmMarketing = Some(true), userEmailValidated = Some(true)))
50+
val user = User("test@example.com", userId, statusFields = StatusFields(userEmailValidated = Some(true)))
5151
val testAuth = ScGuU("abc", GuUCookieData(user, 0, None))
5252
val authenticatedUser = AuthenticatedUser(user, testAuth, true)
5353
val phoneNumbers = PhoneNumbers

‎identity/test/controllers/EditProfileControllerTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import scala.concurrent.Future
5050
val httpConfiguration = HttpConfiguration.createWithDefaults()
5151

5252
val userId: String = "123"
53-
val user = User("test@example.com", userId, statusFields = StatusFields(receive3rdPartyMarketing = Some(true), receiveGnmMarketing = Some(true), userEmailValidated = Some(true)))
53+
val user = User("test@example.com", userId, statusFields = StatusFields(userEmailValidated = Some(true)))
5454
val testAuth = ScGuU("abc", GuUCookieData(user, 0, None))
5555
val authenticatedUser = AuthenticatedUser(user, testAuth, true)
5656
val phoneNumbers = PhoneNumbers

‎identity/test/controllers/EmailVerificationControllerTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class EmailVerificationControllerTest extends path.FreeSpec
4141
when(api.resendEmailValidationEmail(any[Auth], any[TrackingData], any[Option[String]])) thenReturn Future.successful(Right({}))
4242

4343
val userId: String = "123"
44-
val user = User("test@example.com", userId, statusFields = StatusFields(receive3rdPartyMarketing = Some(true), receiveGnmMarketing = Some(true), userEmailValidated = Some(true)))
44+
val user = User("test@example.com", userId, statusFields = StatusFields(userEmailValidated = Some(true)))
4545
val testAuth = ScGuU("abc", GuUCookieData(user, 0, None))
4646
val authenticatedUser = AuthenticatedUser(user, testAuth, true)
4747
val phoneNumbers = PhoneNumbers

‎identity/test/controllers/FormstackControllerTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FormstackControllerTest extends path.FreeSpec
4242
val newsletterService = spy(new NewsletterService(api, requestParser, idUrlBuilder))
4343

4444
val userId = "123"
45-
val user = User("test@example.com", userId, statusFields = StatusFields(receive3rdPartyMarketing = Some(true), receiveGnmMarketing = Some(true)))
45+
val user = User("test@example.com", userId)
4646
val authenticatedActions = new AuthenticatedActions(authService, mock[IdApiClient], mock[IdentityUrlBuilder], controllerComponents, newsletterService, requestParser, profileRedirectService)
4747

4848
when(authService.fullyAuthenticatedUser(MockitoMatchers.any[RequestHeader])) thenReturn Some(AuthenticatedUser(user, ScGuU("abc", GuUCookieData(user, 0, None))))

‎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.142"
6+
val identityLibVersion = "3.150"
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