danutc / form-builder

form builder for mozilla-services/react-jsonschema-form
Apache License 2.0
2 stars 1 forks source link

Enhance conditional logic to be user friendly #36

Open hnandarusdy opened 8 years ago

hnandarusdy commented 8 years ago

It is hard to see all conditional logic. It is not a problem for me if we only can define it from root / object. But, imagine if we have 2nd level / 3rd level of conditional logic, and one form may have around at least 10 conditional logic.

for example:

if (jbpm.offerStatus.value === "abcd"){
    caseData["So"].visible = true;
    caseData["Orderlink"].visible = true;
    jbpm.orderType.visible = true;
    if(jbpm.orderType.value === "")
        jbpm.orderType.valid = false;
    else
        jbpm.orderType.valid = true;
}
else{
    caseData["soNumber"].visible = false;
    caseData["link"].visible = false;
    jbpm.orderType.visible = false;
    jbpm.orderType.valid = true;
}

If we have 5 types of above conditional logic in 1 form, then it will be hard to debug when there is a problem.

It would be better if you could generate something for display all conditional logic in a form. (wrap) would be good if you could display it via UI image

but that is not necessary, I just need a wrap of all conditional logic of a form.