Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suppressImages prop #1672

Merged
merged 7 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ TwirlKeys.templateImports ++= Seq(
routesImport += "model.editions._"

val awsVersion = "1.12.470"
val capiModelsVersion = "23.0.0"
val capiClientVersion = "26.0.0"
val capiModelsVersion = "25.0.0"
val capiClientVersion = "32.0.0"
val json4sVersion = "4.0.3"
val circeVersion = "0.13.0"

Expand Down Expand Up @@ -74,7 +74,7 @@ libraryDependencies ++= Seq(
"com.gu" %% "content-api-client-aws" % "0.6",
"com.gu" %% "content-api-client-default" % capiClientVersion,
"com.gu" %% "editorial-permissions-client" % "3.0.0",
"com.gu" %% "fapi-client-play30" % "6.0.0",
"com.gu" %% "fapi-client-play30" % "12.0.0",
"com.gu" %% "mobile-notifications-api-models" % "3.0.0",
"com.gu" %% "pan-domain-auth-play_3-0" % "4.0.0",

Expand Down
6 changes: 6 additions & 0 deletions fronts-client/src/components/CollectionDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ class CollectionDisplay extends React.Component<Props, CollectionState> {
{oc(collection).metadata[0].type()}
</CollectionConfigText>
) : null}
{collection?.suppressImages ? (
<CollectionConfigText>
<CollectionConfigTextPipe> | </CollectionConfigTextPipe>
Images suppressed
</CollectionConfigText>
) : null}
{collection &&
collection.platform &&
collection.platform !== 'Any' ? (
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/types/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ interface Collection {
frontsToolSettings?: FrontsToolSettings;
isHidden?: boolean;
targetedTerritory?: string;
suppressImages?: boolean;
}

interface ArticleTag {
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/types/FaciaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ interface CollectionConfigResponse {
frontsToolSettings?: FrontsToolSettings;
prefill?: EditionsPrefill;
targetedTerritory?: string;
suppressImages?: boolean;
}

interface FrontsConfigResponse {
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/util/frontsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const combineCollectionWithConfig = (
platform: collectionConfig.platform,
metadata: collectionConfig.metadata,
targetedTerritory: collectionConfig.targetedTerritory,
suppressImages: collectionConfig.suppressImages,
});
};

Expand Down
3 changes: 2 additions & 1 deletion public/src/js/models/config/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default class ConfigCollection extends DropTarget {
'platform',
'frontsToolSettings',
'userVisibility',
'targetedTerritory'
'targetedTerritory',
'suppressImages'
]),
{
displayHints: asObservableProps([
Expand Down
5 changes: 5 additions & 0 deletions public/src/js/widgets/columns/fronts-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@
<label for="frontsToolSettings.displayEditWarning">Display edit warning</label>
<input id="hideShowMore" type="checkbox" data-bind="checked: meta.frontsToolSettings.displayEditWarning" />

<!-- ko if: meta.type() === 'scrollable/small' -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've limited it to scrollable small here - I guess we'll want it for scrollable medium too? Will have another PR for some more changes to make in this file, so could update then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep in scrollable small for now. This may be required on other containers but will confirm what's wanted before we do

<label for="suppressImages">Suppress images</label>
<input id="suppressImages" type="checkbox" data-bind="checked: meta.suppressImages" />
<!-- /ko -->

<div class="platform-edit">
<span>Platform: </span><span data-bind="text: getPlatform()"></span>
<!-- ko if: !thisIsPlatformSpecificCollection && parents().length <= 1 -->
Expand Down
1 change: 1 addition & 0 deletions test/config/TransformationsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class TransformationsSpec extends FlatSpec with Matchers {
None,
None,
None,
None,
None
)

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/FakeCapiAndOphan.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.concurrent.Future

trait FakeCapiAndOphan {

private val allFalseMetadata = ResolvedMetaData(false, false, false, false, false, false, false, false, false, false, false, false, false, false)
private val allFalseMetadata = ResolvedMetaData(false, false, "boostLevel.default", false, false, false, false, false, false, false, false, false, false, false, false)

private val imageUrl = "https://media.giphy.com/media/K3PYNk8oh3HGM/source.gif"

Expand Down
3 changes: 2 additions & 1 deletion test/services/CollectionServiceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class CollectionServiceTest extends FreeSpec with Matchers {
userVisibility = None,
targetedTerritory = None,
platform = None,
frontsToolSettings = None)
frontsToolSettings = None,
suppressImages = None)
}
}
2 changes: 1 addition & 1 deletion test/services/editions/EditionsTemplatingTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class EditionsTemplatingTest extends FreeSpec with Matchers with OptionValues wi
}

private def prefillWithCapiId(capiId: String): Prefill = {
val allFalseMetadata = ResolvedMetaData(false, false, false, false, false, false, false, false, false, false, false, false, false, false)
val allFalseMetadata = ResolvedMetaData(false, false, "boostLevel.default", false, false, false, false, false, false, false, false, false, false, false, false)
Prefill(
222222,
None,
Expand Down
48 changes: 36 additions & 12 deletions test/util/ContentUpgradeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":false,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":false,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":false,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"news"
| }
| }
Expand Down Expand Up @@ -174,20 +178,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":true,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":true,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":true,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"comment",
| "cutout":"cutout image location",
| "mediaType":"Cutout"
Expand Down Expand Up @@ -264,20 +272,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":true,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":true,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":false,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"comment",
| "mediaType":"UseArticleTrail"
| }
Expand Down Expand Up @@ -337,20 +349,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":true,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":true,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":false,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"comment",
| "mediaType":"UseArticleTrail"
| }
Expand Down Expand Up @@ -410,20 +426,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":false,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":false,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":false,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"letters",
| "pickedKicker":"Letters"
| }
Expand Down Expand Up @@ -483,20 +503,24 @@ class ContentUpgradeTest extends FreeSpec with Matchers {
| "isHosted":true,
| "frontsMeta":{
| "defaults":{
| "boostLevel.gigaBoost":false,
| "isBreaking":false,
| "isBoosted":false,
| "showMainVideo":false,
| "imageHide":false,
| "boostLevel.default":true,
| "showQuotedHeadline":false,
| "imageSlideshowReplace":false,
| "boostLevel.boost":false,
| "imageReplace":false,
| "showBoostedHeadline":false,
| "showKickerCustom":false,
| "showByline":false,
| "showKickerTag":false,
| "showLivePlayable":false,
| "imageCutoutReplace":false,
| "showKickerSection":false},
| "showKickerSection":false,
| "boostLevel.megaboost":false,
| "showBoostedHeadline":false},
| "tone":"editorial",
| "pickedKicker":"Editorial"
| }
Expand Down
Loading