Currently there are two reciprocal conditional actions: show and hide. Despite the name, the are persistent. For example, if the condition(s) are FALSE and the action is SHOW, then the target component is HIDDEN.
I propose to change:
then SHOW YourComponentName -> then YourComponentName IS SHOWN
and
then HIDE YourComponentName -> then YourComponentName ISN'T SHOWN
Effectively, the "hide" command will be eliminated and replaced with the "invert" "isn't" option for shown.
This lays the groundwork for other actions. For example, we can just add a REQUIRED action and the inverted version of that is not required. Or SET to VALUE would become ISN'T Set To Value.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | webform-hide_to_isnt_shown-2458897-3.patch | 8.87 KB | danchadwick |
| #2 | webform-hide_to_isnt_shown-2458897-2.patch | 8.26 KB | danchadwick |
| #1 | webform-hide_to_isnt_shown-2458897-1.patch | 7.79 KB | danchadwick |
| revised conditinoal actions.png | 13.5 KB | danchadwick |
Comments
Comment #1
danchadwick commentedPatch must be applied after #2454277: _webform_client_form_rule_check duplicates code in WebformConditionals..
Comment #2
danchadwick commentedRevised patch. Fixes a bug in 'invert' javascript.
Comment #3
danchadwick commentedRevised again. Fixed tests. These pass locally. Testbot can't test this yet because it doesn't apply to the current head.
Comment #5
danchadwick commentedCommitted to 7.x-4.x
Comment #6
danchadwick commentedOf the 4 conditional patches, apply this 3rd.
Comment #7
fenstratCommitted and pushed to 8.x-4.x. Thanks!
Comment #12
danchadwick commentedTestbot estúpido.