From 2c715d86c03a5ad70ce6986434502aada284ead9 Mon Sep 17 00:00:00 2001 From: Tom Richards Date: Thu, 19 Sep 2024 10:04:46 +0100 Subject: [PATCH] remove the feature switch `show-cropping-gutters-switch` so that all GNM users see the cropping gutters when cropping 5:3 which is now limited to only certain scenarios by query param `shouldShowCropGuttersIfApplicable` (thanks to https://github.com/guardian/grid/pull/4343) --- kahuna/app/controllers/KahunaController.scala | 9 +-------- kahuna/app/lib/FeatureSwitch.scala | 6 ------ kahuna/app/lib/KahunaConfig.scala | 2 -- kahuna/public/js/crop/controller.js | 2 -- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/kahuna/app/controllers/KahunaController.scala b/kahuna/app/controllers/KahunaController.scala index 7b22c04bbf..0ec7ced5fe 100644 --- a/kahuna/app/controllers/KahunaController.scala +++ b/kahuna/app/controllers/KahunaController.scala @@ -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))) diff --git a/kahuna/app/lib/FeatureSwitch.scala b/kahuna/app/lib/FeatureSwitch.scala index 3f002a83ab..9694a4525d 100644 --- a/kahuna/app/lib/FeatureSwitch.scala +++ b/kahuna/app/lib/FeatureSwitch.scala @@ -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". diff --git a/kahuna/app/lib/KahunaConfig.scala b/kahuna/app/lib/KahunaConfig.scala index 51a0f1bbfb..3208336cc6 100644 --- a/kahuna/app/lib/KahunaConfig.scala +++ b/kahuna/app/lib/KahunaConfig.scala @@ -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") } diff --git a/kahuna/public/js/crop/controller.js b/kahuna/public/js/crop/controller.js index 8c939342e6..5c5f7ca1ac 100644 --- a/kahuna/public/js/crop/controller.js +++ b/kahuna/public/js/crop/controller.js @@ -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', @@ -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) {