Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIO-8510: changes in nested forms trigger modified change in the parent #5650

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

brendanbond
Copy link
Contributor

@brendanbond brendanbond commented Jun 18, 2024

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 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

@brendanbond brendanbond marked this pull request as ready for review October 1, 2024 13:02
@TanyaGashtold TanyaGashtold merged commit 5933d8e into master Oct 10, 2024
5 checks passed
lane-formio pushed a commit that referenced this pull request Oct 15, 2024
…rent (#5650)

* bubble modified changes to the parents of nested forms

* fix lint errors

* WIP: add tests

* WIP: add changes from 4.x branch to this one

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants