Enable optional form fields #193
Merged
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.

This PR adds a new field during form creation that enables users to mark fields as optional. The wording I chose is "required" rather than "optional" because I think the resulting language and logic is more natural. As far as I can tell, this works with existing forms in the database by virtue of the field being optional and defaulting to true.
A couple of highlights to keep in mind:
I added a limited set of the daisyUI plugin on
app.cssso that I could just use an HTML checkbox input and style it with thetoggleclass. I feel we've got a lot going on in theassetsfolder that we could clean up, but felt that this change was small and convenient enough. I'd be happy to clean up cross-app styles in future PR(s).We're not validating form responses. This was the case before. I did a quick research to figure out the best way to do that and couldn't find one using Ecto. I haven't added validation because of this, but if you know of a way to add this, let me know and we can improve. Maybe we can add to the backlog.
Closes #144. Let me know what you think.