Skip to content

Commit

Permalink
remove the feature switch show-cropping-gutters-switch so that all …
Browse files Browse the repository at this point in the history
…GNM users see the cropping gutters when cropping 5:3 which is now limited to only certain scenarios by query param `shouldShowCropGuttersIfApplicable` (thanks to #4343)
  • Loading branch information
twrichards committed Oct 7, 2024
1 parent 2ac4d87 commit 2c715d8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
9 changes: 1 addition & 8 deletions kahuna/app/controllers/KahunaController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ class KahunaController(

val isIFramed = request.headers.get("Sec-Fetch-Dest").contains("iframe")
val featureSwitches = new FeatureSwitches(
List(
if (maybeUser.map(_.accessor.identity).exists(config.displayCropGutterByDefaultTo.contains))
ShowCroppingGuttersSwitch.copy(default = true)
else if(config.staffPhotographerOrganisation == "GNM")
ShowCroppingGuttersSwitch
else
ExampleSwitch
)
List(ExampleSwitch)
)
val featureSwitchesWithClientValues = featureSwitches.getClientSwitchValues(featureSwitches.getFeatureSwitchCookies(request.cookies.get))
val featureSwitchesJson = Json.stringify(Json.toJson(featureSwitches.getFeatureSwitchesToStringify(featureSwitchesWithClientValues)))
Expand Down
6 changes: 0 additions & 6 deletions kahuna/app/lib/FeatureSwitch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ object ExampleSwitch extends FeatureSwitch(
default = false
)

object ShowCroppingGuttersSwitch extends FeatureSwitch(
key = "show-cropping-gutters-switch",
title = "Display gutters on 5:3 crops to show what would be clipped if used in a 5:4 space",
default = false
)

class FeatureSwitches(featureSwitches: List[FeatureSwitch]){
// Feature switches are defined here, but updated by setting a cookie following the pattern e.g. "feature-switch-my-key"
// for a switch called "my-key".
Expand Down
2 changes: 0 additions & 2 deletions kahuna/app/lib/KahunaConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,5 @@ class KahunaConfig(resources: GridConfigResources) extends CommonConfig(resource
.getOrElse("Not configured")

val shouldUploadStraightToBucket: Boolean = maybeIngestBucket.isDefined

val displayCropGutterByDefaultTo: Set[String] = getStringSet("displayCropGutterByDefaultTo")
}

2 changes: 0 additions & 2 deletions kahuna/public/js/crop/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '../components/gr-keyboard-shortcut/gr-keyboard-shortcut';
import {radioList} from '../components/gr-radio-list/gr-radio-list';
import {cropUtil} from "../util/crop";
import {cropOptions} from "../util/constants/cropOptions";
import {getFeatureSwitchActive} from "../components/gr-feature-switch-panel/gr-feature-switch-panel";

const crop = angular.module('kahuna.crop.controller', [
'gr.keyboardShortcut',
Expand Down Expand Up @@ -184,7 +183,6 @@ crop.controller('ImageCropCtrl', [
ctrl.shouldShowVerticalWarningGutters =
window._clientConfig.staffPhotographerOrganisation === "GNM"
&& cropSettings.shouldShowCropGuttersIfApplicable()
&& getFeatureSwitchActive("show-cropping-gutters-switch")
&& maybeCropRatioIfStandard === "5:3";

if (isCropTypeDisabled) {
Expand Down

0 comments on commit 2c715d8

Please sign in to comment.