Skip to content

fix(designer): duplicate unsaved survey questions#829

Open
mohiuddinshahrukh wants to merge 2 commits into
devfrom
fix-737-duplicate-unsaved-survey-item
Open

fix(designer): duplicate unsaved survey questions#829
mohiuddinshahrukh wants to merge 2 commits into
devfrom
fix-737-duplicate-unsaved-survey-item

Conversation

@mohiuddinshahrukh
Copy link
Copy Markdown
Collaborator

What changed

  • Save the duplicated form view model instead of re-saving the original when using the duplicate action.
  • Initialize question response option validity with an empty map so newly created, unsaved questions can be copied before they have been loaded from the domain model.
  • Add focused coverage for the duplicate action and copying newly created question data.

Why

Part of #737. Duplicating a newly added survey question could fail before the questionnaire itself was saved. Saved questions worked because their response option validity was initialized during domain-model loading; newly created questions did not go through that path.

Testing

  • flutter test test\features\forms\form_view_model_collection_actions_test.dart
  • Manual Designer frontend test: added a new unsaved survey question, duplicated it before saving the parent questionnaire, and confirmed the duplicate appears correctly.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Visit the preview URL for this PR (updated for commit 4e1e391):

(expires Mon, 11 May 2026 14:01:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant