Skip to content
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
4 changes: 2 additions & 2 deletions kahuna/app/controllers/KahunaController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package controllers
import com.gu.mediaservice.lib.argo.ArgoHelpers
import com.gu.mediaservice.lib.auth.Authentication.Principal
import com.gu.mediaservice.lib.auth.{Authentication, Authorisation, BaseControllerWithLoginRedirects}
import lib.{ExampleSwitch, FeatureSwitches, KahunaConfig}
import lib.{ExampleSwitch, UseCqlChips, FeatureSwitches, KahunaConfig}
import play.api.mvc.ControllerComponents
import play.api.libs.json._

Expand Down Expand Up @@ -38,7 +38,7 @@ class KahunaController(

val isIFramed = request.headers.get("Sec-Fetch-Dest").contains("iframe")
val featureSwitches = new FeatureSwitches(
List(ExampleSwitch)
List(ExampleSwitch, UseCqlChips)
)
val featureSwitchesWithClientValues = featureSwitches.getClientSwitchValues(featureSwitches.getFeatureSwitchCookies(request.cookies.get))
val featureSwitchesJson = Json.stringify(Json.toJson(featureSwitches.getFeatureSwitchesToStringify(featureSwitchesWithClientValues)))
Expand Down
6 changes: 6 additions & 0 deletions kahuna/app/lib/FeatureSwitch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ object ExampleSwitch extends FeatureSwitch(
default = false
)

object UseCqlChips extends FeatureSwitch(
key = "use-cql-chips",
title = "Use CQL for the chips interface",
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
Loading
Loading