Skip to content

Commit

Permalink
add containerStyle and imageAspectRatio fields to collection config
Browse files Browse the repository at this point in the history
  • Loading branch information
cemms1 committed Oct 18, 2024
1 parent 934d144 commit 9266951
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -251,7 +253,9 @@ object CollectionConfigJson {
targetedTerritory,
platform,
frontsToolSettings,
suppressImages
suppressImages,
containerStyle,
imageAspectRatio,
)
}

Expand All @@ -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`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand All @@ -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)
}

0 comments on commit 9266951

Please sign in to comment.