[x] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
[x] My work includes tests or is validated by existing tests.
Summary
This PR integrates rule builder component into form builder, which provides an user-interface rule builder to build conditional logic for the forms.
This feature is included in the feature flag
Features Included:
[x] allow-future-dates and disallow-decimal-value
[x] added toggle functionality to make a field as required.
[x] added toggle functionality to allow future dates in the date field.
[x] added toggle functionality to disallow decimal values in number field.
[x] Ability to add multiple logics for the same question field
[x] Ability to add multiple conditions and actions for each logic
[x] Ability to edit and delete the conditions and actions
[x] Changing the required field dynamically in the schema
[x] Storing the rules in global state for retrieving and updating the fields dynamically
[x] Ability to add hideWhenExpression and failsWhenExpression logic in rule-builder itself, not in the schema part.
[x] added unit test cases for rule builder and rule header.
Requirements
Summary
This PR integrates rule builder component into form builder, which provides an user-interface rule builder to build conditional logic for the forms. This feature is included in the feature flag
Features Included:
Screenshots
https://www.loom.com/share/c892130d32684f739f9b0c7759c033f1?sid=6c9a1da5-7f95-4e33-82de-b37d679080cc
Demo depicts the ability to add multiple rules for same question field dynamically
https://www.loom.com/share/cef02c0d362c4d3f92bc846527329656?sid=d5156068-8bc6-4cf5-b48a-ab3c5e1cc690
Related Issue
https://openmrs.atlassian.net/browse/O3-3230 https://openmrs.atlassian.net/browse/O3-3231 https://openmrs.atlassian.net/browse/O3-3232 https://openmrs.atlassian.net/browse/O3-3233 https://openmrs.atlassian.net/browse/O3-3413 https://openmrs.atlassian.net/browse/O3-3238 https://openmrs.atlassian.net/browse/O3-3237 https://openmrs.atlassian.net/browse/O3-3422
Other
Figma Design of rule builder:![Final UIUX of Rule builder](https://github.com/openmrs/openmrs-esm-form-builder/assets/93466587/ea013ae1-51e1-46db-bd3e-56db3e2de801)
Logged Data
For a specified rule containing multiple conditional logics
For a specified conditional logic that contains multiple conditions and actions: