cfpb / wagtail-flags

Feature flags for Wagtail sites
Creative Commons Zero v1.0 Universal
84 stars 15 forks source link

Boolean flag conditions don't work as expected in the UI #65

Open chosak opened 2 years ago

chosak commented 2 years ago

Any flag conditions of type "boolean" don't appear in the Wagtail flags UI, because of this use of conditions_without_bool. I gather this is to support the use of a boolean condition to toggle a flag on or off from the UI, but it can lead to some confusing behavior:

I encountered this problem because I wanted to manually disable a flag that already had an existing condition from Django settings, and thought that adding a boolean False flag would be a useful way to do that. But after trying to add that condition, it was unclear whether it had done anything or what the current logic was.

Two immediate ideas to address this: prevent use of boolean conditions in the UI, or migrate existing boolean conditions to some new "wagtail-flags-toggle" type which is deliberately distinct from booleans.

chosak commented 1 year ago

A related issue: if you define a flag in settings with "FLAG_NAME": [("boolean", True)], the UI still shows you a "DISABLE FLAG_NAME FOR ALL REQUESTS" button, but clicking it doesn't seem to do anything.