Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chosak opened this issue Dec 1, 2021 · 1 comment
Open

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

chosak opened this issue Dec 1, 2021 · 1 comment

Comments

@chosak
Copy link
Member

chosak commented Dec 1, 2021

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:

  • If you add a new boolean condition and save it, it doesn't show up on the flag's index page, but might impact how the enable/disable button works.
  • If you try to change an existing condition's type from something else to boolean, the form submission won't succeed, but no error message is shown.
  • It seems like if you try to add a boolean condition when one is already defined, the form submission won't succeed, but no error message is shown.

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
Copy link
Member Author

chosak commented Jan 26, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant