From 926695182e9708a18502e7a2ac44e5f2d84de1ed Mon Sep 17 00:00:00 2001 From: Charlotte Date: Fri, 18 Oct 2024 16:43:30 +0100 Subject: [PATCH] add containerStyle and imageAspectRatio fields to collection config --- .../scala/com/gu/facia/client/models/Config.scala | 12 +++++++++--- .../com/gu/facia/api/models/collectionconfig.scala | 13 ++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala b/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala index 5dceb91b..239ab372 100644 --- a/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala +++ b/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala @@ -227,7 +227,9 @@ object CollectionConfigJson { targetedTerritory: Option[TargetedTerritory] = None, platform: Option[CollectionPlatform] = None, frontsToolSettings: Option[FrontsToolSettings] = None, - suppressImages: Option[Boolean] = None + suppressImages: Option[Boolean] = None, + containerStyle: Option[String] = None, + imageAspectRatio: Option[String] = None, ): CollectionConfigJson = CollectionConfigJson( displayName, @@ -251,7 +253,9 @@ object CollectionConfigJson { targetedTerritory, platform, frontsToolSettings, - suppressImages + suppressImages, + containerStyle, + imageAspectRatio, ) } @@ -277,7 +281,9 @@ case class CollectionConfigJson( targetedTerritory: Option[TargetedTerritory], platform: Option[CollectionPlatform], frontsToolSettings: Option[FrontsToolSettings], - suppressImages: Option[Boolean] + suppressImages: Option[Boolean], + containerStyle: Option[String], + imageAspectRatio: Option[String], ) { val collectionType = `type` } diff --git a/fapi-client/src/main/scala/com/gu/facia/api/models/collectionconfig.scala b/fapi-client/src/main/scala/com/gu/facia/api/models/collectionconfig.scala index 35ee87b5..d6ea5612 100644 --- a/fapi-client/src/main/scala/com/gu/facia/api/models/collectionconfig.scala +++ b/fapi-client/src/main/scala/com/gu/facia/api/models/collectionconfig.scala @@ -35,7 +35,10 @@ case class CollectionConfig( targetedTerritory: Option[TargetedTerritory], platform: CollectionPlatform = AnyPlatform, frontsToolSettings: Option[FrontsToolSettings], - suppressImages: Boolean) + suppressImages: Boolean, + containerStyle: Option[String], + imageAspectRatio: Option[String], + ) object CollectionConfig { val DefaultCollectionType = "fixed/small/slow-IV" @@ -62,7 +65,9 @@ object CollectionConfig { targetedTerritory = None, platform = AnyPlatform, frontsToolSettings = None, - suppressImages = false) + suppressImages = false, + containerStyle = None, + imageAspectRatio = None) def fromCollectionJson(collectionJson: CollectionConfigJson): CollectionConfig = CollectionConfig( @@ -87,5 +92,7 @@ object CollectionConfig { collectionJson.targetedTerritory, collectionJson.platform.getOrElse(AnyPlatform), collectionJson.frontsToolSettings, - collectionJson.suppressImages.exists(identity)) + collectionJson.suppressImages.exists(identity), + collectionJson.containerStyle, + collectionJson.imageAspectRatio) }