-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: tool sticky liveblog ask * WIP: Basic preview changes * making sure it's using all the test elements for now * lint fix * WIP: add scala components * WIP: add execution context, attempt at fixes * consistent naming * Remove duplication, comment * Switch gutters on by default * change gutter-ask to gutter-test as not working otherwise * Fix heading name on menu item * hide gutter-tests menu item in case we merge. * Added tabs with previews * Add image selection * Remove old comments, set body copy limit closer to current. * Update gutter content model for image * hide all but excludedTags * move tags to top level for saving, body copy in RTE, * reinstate banner-test2 - accidental cut rather than copy and paste? * ensure tags are nested under PageContextTargeting * Remove hide some tag form elements, nest tags * rename to logically separate potential article gutter tests * remove unused getEmptyParagraphError * rename to LiveblogGutter in case we want a separate version for Articles later. * Rename from liveblog-gutter to gutter-liveblog to match pattern for epics * remove unnecessary TODO * Rename channe switch enableGutters to allow for liveblog * Rename continued * Add prod default variant to prod default test * ensure controller is picking up bodyCopy from controlled FormData * Change max body copy length and errror message, include noHtml in RTE restrictions * Set default to not_for_sale svg file in S3 and update helper text in variant editor * Add gutter to S3 bucket in CDK * Remove methodology, ensure signed-in status radio buttons are working. * Add gutter to bucket resources * delete old comments --------- Co-authored-by: Sue Burt <“sue.burt@guardian.co.uk”>
- Loading branch information
Showing
22 changed files
with
937 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
app/controllers/gutter/GutterLiveblogTestsController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package controllers.gutter | ||
|
||
import com.gu.googleauth.AuthAction | ||
import controllers.ChannelTestsController | ||
import models.{GutterTest, Channel} | ||
import models.GutterTest._ | ||
import play.api.libs.circe.Circe | ||
import play.api.mvc.{ActionBuilder, AnyContent, ControllerComponents} | ||
import services.{DynamoArchivedChannelTests, DynamoChannelTests} | ||
import zio.ZEnv | ||
|
||
import scala.concurrent.ExecutionContext | ||
|
||
object GutterLiveblogTestsController { | ||
val name = "gutter-liveblog-tests" | ||
} | ||
|
||
class GutterLiveblogTestsController( | ||
authAction: ActionBuilder[AuthAction.UserIdentityRequest, AnyContent], | ||
components: ControllerComponents, | ||
stage: String, | ||
runtime: zio.Runtime[ZEnv], | ||
dynamoTests: DynamoChannelTests, | ||
dynamoArchivedTests: DynamoArchivedChannelTests | ||
)(implicit ec: ExecutionContext) extends ChannelTestsController[GutterTest]( | ||
authAction, | ||
components, | ||
stage, | ||
lockFileName = GutterLiveblogTestsController.name, | ||
channel = Channel.GutterLiveblog, | ||
runtime = runtime, | ||
dynamoTests, | ||
dynamoArchivedTests | ||
) with Circe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package models | ||
|
||
import io.circe.generic.extras.Configuration | ||
import io.circe.generic.extras.auto._ | ||
import io.circe.generic.extras.semiauto._ | ||
import io.circe.{Decoder, Encoder, Json} | ||
import models.Methodology.defaultMethodologies | ||
|
||
case class GutterContent( | ||
image: Option[Image], | ||
bodyCopy: Option[List[String]], | ||
cta: Option[Cta], | ||
) | ||
|
||
case class GutterVariant( | ||
name: String, | ||
gutterContent: Option[GutterContent], | ||
) | ||
|
||
case class GutterTest( | ||
name: String, | ||
channel: Option[Channel], | ||
status: Option[Status], | ||
lockStatus: Option[LockStatus], | ||
priority: Option[Int], | ||
nickname: Option[String], | ||
userCohort: UserCohort, | ||
locations: List[Region] = Nil, | ||
contextTargeting: PageContextTargeting = PageContextTargeting(Nil,Nil,Nil,Nil), | ||
variants: List[GutterVariant], | ||
controlProportionSettings: Option[ControlProportionSettings] = None, | ||
deviceType: Option[DeviceType] = None, | ||
campaignName: Option[String] = Some("NOT_IN_CAMPAIGN"), | ||
signedInStatus: Option[SignedInStatus] = Some(SignedInStatus.All), | ||
consentStatus: Option[ConsentStatus] = Some(ConsentStatus.All), | ||
methodologies: List[Methodology] = defaultMethodologies | ||
)extends ChannelTest[GutterTest] { | ||
|
||
override def withChannel(channel: Channel): GutterTest = | ||
this.copy(channel = Some(channel)) | ||
override def withPriority(priority: Int): GutterTest = | ||
this.copy(priority = Some(priority)) | ||
} | ||
|
||
object GutterTest { | ||
implicit val customConfig: Configuration = Configuration.default.withDefaults | ||
implicit val gutterTestDecoder: Decoder[GutterTest] = | ||
deriveConfiguredDecoder[GutterTest] | ||
implicit val gutterTestEncoder: Encoder[GutterTest] = | ||
deriveConfiguredEncoder[GutterTest] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.