Skip to content

Commit 3736379

Browse files
Merge pull request #4468 from guardian/jsh/cql-for-chips
Add a feature switch to use @guardian/cql in the structured search component
2 parents 8641b6a + d4b3b1f commit 3736379

File tree

18 files changed

+1805
-446
lines changed

18 files changed

+1805
-446
lines changed

kahuna/app/controllers/KahunaController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package controllers
33
import com.gu.mediaservice.lib.argo.ArgoHelpers
44
import com.gu.mediaservice.lib.auth.Authentication.Principal
55
import com.gu.mediaservice.lib.auth.{Authentication, Authorisation, BaseControllerWithLoginRedirects}
6-
import lib.{ExampleSwitch, FeatureSwitches, KahunaConfig}
6+
import lib.{ExampleSwitch, UseCqlChips, FeatureSwitches, KahunaConfig}
77
import play.api.mvc.ControllerComponents
88
import play.api.libs.json._
99

@@ -38,7 +38,7 @@ class KahunaController(
3838

3939
val isIFramed = request.headers.get("Sec-Fetch-Dest").contains("iframe")
4040
val featureSwitches = new FeatureSwitches(
41-
List(ExampleSwitch)
41+
List(ExampleSwitch, UseCqlChips)
4242
)
4343
val featureSwitchesWithClientValues = featureSwitches.getClientSwitchValues(featureSwitches.getFeatureSwitchCookies(request.cookies.get))
4444
val featureSwitchesJson = Json.stringify(Json.toJson(featureSwitches.getFeatureSwitchesToStringify(featureSwitchesWithClientValues)))

kahuna/app/lib/FeatureSwitch.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ object ExampleSwitch extends FeatureSwitch(
1010
default = false
1111
)
1212

13+
object UseCqlChips extends FeatureSwitch(
14+
key = "use-cql-chips",
15+
title = "Use CQL for the chips interface",
16+
default = false
17+
)
18+
1319
class FeatureSwitches(featureSwitches: List[FeatureSwitch]){
1420
// Feature switches are defined here, but updated by setting a cookie following the pattern e.g. "feature-switch-my-key"
1521
// for a switch called "my-key".

0 commit comments

Comments
 (0)