Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges-GNM committed Jan 9, 2025
1 parent a98eeb4 commit 862efc9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion common/app/layout/slices/ContainerDefinition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ object ContainerDefinition {
customCssClasses = Set.empty,
)

def fromContainer(container: Container, items: Seq[PressedContent], config: ContainerDisplayConfig): Option[ContainerDefinition] = {
def fromContainer(
container: Container,
items: Seq[PressedContent],
config: ContainerDisplayConfig,
): Option[ContainerDefinition] = {
container match {
case Dynamic(dynamicContainer) =>
dynamicContainer.containerDefinitionFor(items.map(Story.fromFaciaContent))
Expand Down
4 changes: 2 additions & 2 deletions common/app/layout/slices/FlexibleContainer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ private[slices] trait FlexibleContainer {

protected def optionalFirstSlice(stories: Seq[Story]): Option[(Slice, Seq[Story])]

final def slicesFor(stories: Seq[Story], config:ContainerDisplayConfig): Option[Seq[Slice]] = {
final def slicesFor(stories: Seq[Story], config: ContainerDisplayConfig): Option[Seq[Slice]] = {
val flexGenMaxItems = config.collectionConfigWithId.config.displayHints.get.maxItemsToDisplay.getOrElse(8)
if (stories.nonEmpty && stories.isDescending && stories.forall(story => story.group >= 0 && story.group <= 3)) {
optionalFirstSlice(stories) map { case (firstSlice, remaining) =>
Some(firstSlice +: standardSlices(remaining, Some(firstSlice), flexGenMaxItems))
} getOrElse {
Some(standardSlices(stories, None, flexGenMaxItems) )
Some(standardSlices(stories, None, flexGenMaxItems))
}
} else {
None
Expand Down
6 changes: 5 additions & 1 deletion common/app/layout/slices/FlexibleGeneral.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ object FlexibleGeneral extends FlexibleContainer {
}
}

override protected def standardSlices(storiesIncludingBackfill: Seq[Story], firstSlice: Option[Slice], flexGenMaxItems: Int): Seq[Slice] = {
override protected def standardSlices(
storiesIncludingBackfill: Seq[Story],
firstSlice: Option[Slice],
flexGenMaxItems: Int,
): Seq[Slice] = {

flexGenMaxItems match {
case 0 => Nil
Expand Down
6 changes: 5 additions & 1 deletion common/app/layout/slices/FlexibleSpecial.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ object FlexibleSpecial extends FlexibleContainer {
}
}

override protected def standardSlices(storiesIncludingBackfill: Seq[Story], firstSlice: Option[Slice], flexGenMaxItems: Int): Seq[Slice] = {
override protected def standardSlices(
storiesIncludingBackfill: Seq[Story],
firstSlice: Option[Slice],
flexGenMaxItems: Int,
): Seq[Slice] = {

storiesIncludingBackfill.length match {
case 0 => Nil
Expand Down

0 comments on commit 862efc9

Please sign in to comment.