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

Add question duplication feature #10

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

Balastrong
Copy link
Member

@Balastrong Balastrong commented Apr 29, 2024

Related to #5

Adds duplication functionality to both text and choice question types in the survey generator, allowing users to duplicate questions directly from the UI.

  • Implements a new duplication button in the QuestionCardButtonsBar for both TextFormField and ChoiceFormField components. This button uses the Copy icon from lucide-react.
  • Adds duplication logic in the onClick handler of the new button, which duplicates the question using the form.insertFieldValue method from TanStack Form API. The duplicated question is inserted right below the original question, with a new unique ID generated for it using the generateId function.
  • Maintains the existing functionality and structure of the question cards, ensuring that the addition of the duplication feature integrates seamlessly with the current design and operations.

For more details, open the Copilot Workspace session.

@Balastrong Balastrong merged commit 4fca982 into main Apr 29, 2024
1 check passed
@Balastrong Balastrong deleted the Balastrong/feat/add-duplicate-question-button branch April 29, 2024 21:02
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.

1 participant