conversational-form icon indicating copy to clipboard operation
conversational-form copied to clipboard

Support branching on fieldsets for more flexibility

Open jerrebm opened this issue 6 years ago • 2 comments

Status quo:

Conditionals must be set on tag-level, adding them on eg. fieldset-tag does nothing.

Problem:

This is great for simple paths, but for paths which branch off into completely different directions multiple times, it makes it unnecessarily hard. You'd have to set a number of conditional tags on every single input field.

For example, I'm currently working on a form which is a mostly boolean based input, with the answer of almost every question branching off into a new path. Moreover, some paths do eventually require an input field which has the same name attribute as used in other branches, which currently also causes a bug. See issue #327

Solution:

Allow conditionals to be set on fieldset tags.

This would allow all inputs that belong to a specific path to be grouped together, making it much easier and clearer to maintain. Since all input that doesn't fall under the fieldset can be ignored, this should also resolve #327.

jerrebm avatar Sep 05 '19 07:09 jerrebm

@egyptik this would be a very nice extension to the current branching logic. If it is important to you then maybe you want to consider contributing with a PR? 😎

jenssogaard avatar Sep 13 '19 14:09 jenssogaard

@jenssogaard I'd be happy to, but can't get it to work. Do you have any instructions?

I tried the following:

  1. Cloned the Develop branch.
  2. Ran npm install in root dir.
  3. Ran npm install in gulp-tasks dir.
  4. Ran gulp build in root dir.

Besides a few TypeScript errors, this seemed to work. However, when I open one of the development HTML pages in /src it's having a lot of 404 errors for files located in /build/cf/ui/control-elements/*.

When checking my build folder, all I can find in /build/cf is a single file named ConversationalForm.plugin.js.

jerrebm avatar Sep 17 '19 09:09 jerrebm