Conversation
Prevents users changing their question from radio->checkbox and submitting without valid state
|
davidjamesstone
left a comment
There was a problem hiding this comment.
I think this is good but I'm a little nervous simply because I can't remember why we didn't do this before. Or maybe we did and reverted.
We have this, where we convert null to [] for checkbox condition evaluation purposes, which can maybe be deleted with this change?
jbarnsley10
left a comment
There was a problem hiding this comment.
I think I'm happy with this. The DeclarationField is done in a slightly different way so won't be impacted by this change.
But it does beg the question whether we should be handling all possible question type changes, and how that impacts on existing state that might be or might not be valid anymore



Proposed change
Always store checkboxes as arrays in state
Prevents users changing their question from radio->checkbox and submitting without valid state. This was caused by the stateschema relying on the formschema, which supports
.single()to support frontends only sending a single value.Jira ticket: https://eaflood.atlassian.net/browse/DF-686
Type of change
Checklist
README.mdanddocs/*(where appropriate, e.g. new features).npm run test).npm run lint).npm run format).