FIO-8510: changes in nested forms trigger modified
change in the parent
#5650
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-8510
https://formio.atlassian.net/browse/FIO-8586
Description
A customer uses a combination of
saveDraft
andskipDraftRestore
to automatically save but manually load draft submissions in their application. However, change events from nested forms bubble up to the parent withmodified: false
, ensuring that a change in the child form will not trigger a call tosaveDraft
in the parent. In other words, when manually loading the parent form's submissions, the nested forms will always come back empty.This PR ensures that, when a Webform is nested, it will pass it's change metadata up to its parent form with the
modified
flag set totrue
. That way, changes in the child form will be seen by the parent so that the call tosaveDraft()
will be made both in the parent and the child. This is consistent (at least conceptually) with what happens when we submit a parent form that contains nested children; not only does the child form submit its data, but the parent form's submission object contains the child form's data as well.Dependencies
n/a
How has this PR been tested?
I added automated tests to cover [all/the following] cases, including ...
Checklist: