I recently fixed O3-4681 (non-functional subforms crash in form-engine-lib), and while working on that fix, I noticed something that could be improved in the form-builder.
Right now, if you want to add a subform to a form, you have to manually edit the JSON schema and type the exact name of the subform yourself. There is no way to do this in the drag-and-drop Interactive Builder. This means admins and clinicians who don’t know JSON cannot use subforms at all. Also, if the name is typed wrong, the form crashes, which is exactly the bug I just fixed.
I want to propose adding an “Add Subform” button to the Interactive Builder. When clicked, it would open a search modal showing all published forms fetched from the backend using GET /ws/rest/v1/form?published=true. The admin picks one from the list, and the JSON is generated automatically. No manual typing of form names needed.
This would make subforms accessible to non-technical users, prevent wrong form name errors, and be consistent with the overall drag-and-drop philosophy of the Interactive Builder.
I am a new contributor, so before I start building this, I wanted to check with the community first. A few questions:
- Is this the right approach, or is there a preferred pattern for adding new features to the interactive builder?
- Should this be a new modal, or should I extend the existing Add Page modal with a subform option?
- Are there design guidelines or mockups I should follow?
- Is there already a Jira ticket for this, or should I create a new one?