flagr icon indicating copy to clipboard operation
flagr copied to clipboard

Distribution modal saves checked value if settings not saved

Open sesquipedalian-dev opened this issue 4 years ago • 0 comments

In the flagr UI, the modal that comes up for editing a segment's distribution can save the checkbox value for a variant, even if the distribution settings aren't saved (e.g. the settings are invalid, close the modal manually, etc).

Expected Behavior

Subsequent opens of the distribution modal dialog should get the freshest state of the distribution.

Current Behavior

The modal can have stale state. This causes you a couple extra clicks (uncheck / recheck box) in order to be able to assign some of the distribution to that variant.

Possible Solution

a) reset the modal contents on close b) make sure to get fresh modal content every time it is shown (from being hidden)

Steps to Reproduce (for bugs)

  1. Go to https://try-flagr.herokuapp.com/#/flags/1
  2. Click 'edit' the distribution on the default segment
  3. Check the box for 'control'
  4. Click the 'X' box in the upper right to dismiss the modal
  5. Click 'edit' the distribution on the default segment again
  6. Observe the check box for 'control' is still checked, but you can't edit the distribution slider to include an amount for that option. If you uncheck / check the 'control' box again, you are able to edit the distribution to include 'control'

Context

Minor inconvenience when editing distribution

Your Environment

  • Version used (flagr version): 1.1.4
  • Server type and version: N/A
  • Operating System and version (uname -a): OS X
  • Browser: Chrome

sesquipedalian-dev avatar Sep 03 '19 20:09 sesquipedalian-dev