Skip to content

Commit

Permalink
Handle the move of suppressImages to displayHints
Browse files Browse the repository at this point in the history
  • Loading branch information
Fweddi committed Feb 21, 2025
1 parent ea65f61 commit 5a1d19f
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ TwirlKeys.templateImports ++= Seq(
routesImport += "model.editions._"

val awsVersion = "1.12.470"
val capiModelsVersion = "25.0.0"
val capiClientVersion = "32.0.0"
val capiModelsVersion = "27.0.0"
val capiClientVersion = "34.0.0"
val json4sVersion = "4.0.3"
val circeVersion = "0.13.0"

Expand Down Expand Up @@ -83,7 +83,7 @@ libraryDependencies ++= Seq(
"com.gu" %% "content-api-client-aws" % "0.7.6",
"com.gu" %% "content-api-client-default" % capiClientVersion,
"com.gu" %% "editorial-permissions-client" % "3.0.0",
"com.gu" %% "fapi-client-play30" % "13.0.0",
"com.gu" %% "fapi-client-play30" % "15.0.0",
"com.gu" %% "mobile-notifications-api-models" % "3.0.0",
"com.gu" %% "pan-domain-auth-play_3-0" % "7.0.0",
"org.scanamo" %% "scanamo" % "1.1.1" exclude ("org.scala-lang.modules", "scala-java8-compat_2.13"),
Expand Down
1 change: 0 additions & 1 deletion fronts-client/src/actions/__tests__/Collections.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ describe('Collection actions', () => {
previouslyCardIds: [],
groups: undefined,
frontsToolSettings: undefined,
suppressImages: undefined,
targetedRegions: [],
excludedRegions: [],
targetedTerritory: undefined,
Expand Down
2 changes: 1 addition & 1 deletion fronts-client/src/components/CollectionDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class CollectionDisplay extends React.Component<Props, CollectionState> {
{oc(collection).metadata[0].type()}
</CollectionConfigText>
) : null}
{collection?.suppressImages ? (
{collection?.displayHints?.suppressImages ? (
<CollectionConfigText>
<CollectionConfigTextPipe> | </CollectionConfigTextPipe>
Images suppressed
Expand Down
1 change: 0 additions & 1 deletion fronts-client/src/fixtures/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ const stateWithCollection: any = {
automatedCollection: {
displayName: 'automated',
type: 'type',
suppressImages: undefined,
targetedRegions: [],
excludedRegions: [],
targetedTerritory: undefined,
Expand Down
4 changes: 2 additions & 2 deletions fronts-client/src/types/Collection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CapiArticle } from 'types/Capi';
import { Diff } from 'utility-types';
import type { FrontsToolSettings } from 'types/FaciaApi';
import type { DisplayHints, FrontsToolSettings } from 'types/FaciaApi';
import { CardTypes } from 'constants/cardTypes';

interface CollectionArticles {
Expand Down Expand Up @@ -190,9 +190,9 @@ interface Collection {
frontsToolSettings?: FrontsToolSettings;
isHidden?: boolean;
targetedTerritory?: string;
suppressImages?: boolean;
targetedRegions: string[];
excludedRegions: string[];
displayHints?: DisplayHints;
}

interface ArticleTag {
Expand Down
8 changes: 7 additions & 1 deletion fronts-client/src/types/FaciaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ interface FrontsToolSettings {
displayEditWarning?: boolean;
}

interface DisplayHints {
maxItemsToDisplay?: number;
suppressImages?: boolean;
}

interface CollectionConfigResponse {
displayName: string;
type?: string;
Expand All @@ -54,7 +59,7 @@ interface CollectionConfigResponse {
frontsToolSettings?: FrontsToolSettings;
prefill?: EditionsPrefill;
targetedTerritory?: string;
suppressImages?: boolean;
displayHints?: DisplayHints;
}

interface FrontsConfigResponse {
Expand Down Expand Up @@ -140,5 +145,6 @@ export {
EditionCollectionResponse,
VisibleArticlesResponse,
FrontsToolSettings,
DisplayHints,
EditionsFrontMetadata,
};
2 changes: 1 addition & 1 deletion fronts-client/src/util/frontsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const combineCollectionWithConfig = (
platform: collectionConfig.platform,
metadata: collectionConfig.metadata,
targetedTerritory: collectionConfig.targetedTerritory,
suppressImages: collectionConfig.suppressImages,
displayHints: collectionConfig.displayHints,
});
};

Expand Down
6 changes: 3 additions & 3 deletions public/src/js/models/config/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export default class ConfigCollection extends DropTarget {
'platform',
'frontsToolSettings',
'userVisibility',
'targetedTerritory',
'suppressImages'
'targetedTerritory'
]),
{
displayHints: asObservableProps([
'maxItemsToDisplay'
'maxItemsToDisplay',
'suppressImages'
], observableNumeric)
},
{
Expand Down
2 changes: 1 addition & 1 deletion public/src/js/widgets/columns/fronts-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
meta.type() === 'flexible/general')
-->
<label for="suppressImages">Suppress images</label>
<input id="suppressImages" type="checkbox" data-bind="checked: meta.suppressImages" />
<input id="suppressImages" type="checkbox" data-bind="checked: meta.displayHints.suppressImages" />
<!-- /ko -->

<div class="platform-edit">
Expand Down
1 change: 0 additions & 1 deletion test/config/TransformationsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class TransformationsSpec extends FlatSpec with Matchers {
None,
None,
None,
None,
None
)

Expand Down
3 changes: 1 addition & 2 deletions test/services/CollectionServiceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ class CollectionServiceTest extends FreeSpec with Matchers {
userVisibility = None,
targetedTerritory = None,
platform = None,
frontsToolSettings = None,
suppressImages = None
frontsToolSettings = None
)
}
}

0 comments on commit 5a1d19f

Please sign in to comment.