formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.83k stars 1.04k forks source link

FIO-8414 | FIO-8403 | FIO-8389: Fixes 5x validations and conditionals for array data components #5646

Open mikekotikov opened 2 weeks ago

mikekotikov commented 2 weeks ago

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-8389 https://formio.atlassian.net/browse/FIO-8403 https://formio.atlassian.net/browse/FIO-8414

Description

What changed?

Previously, formio.js conditionals were failing with error / not working in scenarios when conditions were applied to array data structure components (Edit Grid, Data Grid, etc.). This PR fixes this behavior.

Why have you chosen this solution?

Tried different solutions, but since this logic never really worked fine, ended up writing a recursive function that would generate array of components paths with indexes, which are later iterated one by one to perform conditional checks.

Dependencies

None

How has this PR been tested?

I added automated tests to cover both tickets cases, also performed a good batch of manual tests through portal

Checklist: