Allow FeatureService to switch features per form#865
Conversation
8694309 to
86b424a
Compare
86b424a to
fe1c173
Compare
stephencdaly
left a comment
There was a problem hiding this comment.
Changes look good. I wonder slightly whether it might be better to use the form ID rather than the slug. The reason for this is that if a form is renamed, the slug changes. I would have thought that if a form is renamed, we wouldn't want features to be disabled. Thoughts?
|
I'm inclined to agree with Stephen on using ID instead of slug - as well as being changeable I don't think we enforce uniqueness on form slugs, so ID would target the form we want more specifically |
fe1c173 to
16bb71e
Compare
|
Good points, thanks both! I've updated to use form ID instead of slug. This makes the settings file less readable, but we can just go to admin to find out which form maps to which ID for now if need be. |
16bb71e to
3f25522
Compare
stephencdaly
left a comment
There was a problem hiding this comment.
Changes look good and I've tested it locally by modifying an existing feature flag to use this.
Just one minor comment.
DavidBiddle
left a comment
There was a problem hiding this comment.
Works for me locally, code looks good, nice readable tests 🎉
3f25522 to
97b4741
Compare
This commit allows features to be toggled on a per form basis in
addition to the global feature flag. This is done in a similar way as
per org switching in forms-admin. You can override the default value of
a feature flag by providing key value pairs under a forms object, where
the key is the form ID. For example:
```
features:
flag_test:
enabled: false
forms:
"123": true
```
We'd like to use this to do some user research for additional
submission types with specific forms.
97b4741 to
1c479c3
Compare
|



What problem does this pull request solve?
This commit allows features to be toggled on a per form basis in addition to the global feature flag. This is done in a similar way as per org switching in forms-admin. You can override the default value of a feature flag by providing key value pairs under a forms object, where the key is the form ID. For example:
We'd like to use this to do some user research for additional submission types with specific forms.
Trello card: https://trello.com/c/5xPfvcTJ
Things to consider when reviewing