FeatureFlags: define features outside settings.Cfg (take 3) (#44443)
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
include:
|
||||
- included.yaml # not yet supported
|
||||
|
||||
vars:
|
||||
stack: something
|
||||
level: free
|
||||
valA: value from features.yaml
|
||||
|
||||
flags:
|
||||
- name: feature1
|
||||
description: feature1
|
||||
expression: "false"
|
||||
|
||||
- name: feature3
|
||||
description: feature3
|
||||
expression: "true"
|
||||
|
||||
- name: feature3
|
||||
description: feature3
|
||||
expression: env.level == 'free'
|
||||
|
||||
- name: displaySwedishTheme
|
||||
description: enable swedish background theme
|
||||
expression: |
|
||||
// restrict to users allowing swedish language
|
||||
req.locale.contains("sv")
|
||||
- name: displayFrenchFlag
|
||||
description: sho background theme
|
||||
expression: |
|
||||
// only admins
|
||||
user.id == 1
|
||||
// show to users allowing french language
|
||||
&& req.locale.contains("fr")
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
include:
|
||||
- features.yaml # make sure we avoid recusion!
|
||||
|
||||
# variables that can be used in expressions
|
||||
vars:
|
||||
stack: something
|
||||
deep: 1
|
||||
valA: value from included.yaml
|
||||
|
||||
flags:
|
||||
- name: featureFromIncludedFile
|
||||
description: an inlcuded file
|
||||
expression: invalid expression string here
|
||||
Reference in New Issue
Block a user