FIO-4871: Fixed calculated value for data grid component #5448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-4871
Description
When the DataGrid component has the default 1st row, we can find some fields already have empty values in JSON. This is a reason why the calculated value doesn't apply for DataGrid with allow override. I tried to change this logic and save DataGrid with an empty array without nested fields. As a result, it caused a lot of tests to fail and can be an issue with the compatibility of existing forms. So I changed the isEmpty method for DataGrid to skip default empty fields and apply calculated value.
How has this PR been tested?
Unit testing
Checklist: