A customer uses a combination of saveDraft and skipDraftRestore to automatically save but manually load draft submissions in their application. However, change events from nested forms bubble up to the parent with modified: false, ensuring that a change in the child form will not trigger a call to saveDraft 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 to true. That way, changes in the child form will be seen by the parent so that the call to saveDraft() 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:
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation (if applicable)
[ ] My changes generate no new warnings
[ ] My changes include tests that prove my fix is effective (or that my feature works as intended)
[ ] New and existing unit/integration tests pass locally with my changes
[ ] Any dependent changes have corresponding PRs that are listed above
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-8510
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: