Allow signup fields to be ordered #103
Open
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 is a somewhat speculative PR as it involves a potentially breaking change. I need more customisation of the signup page - at the moment it's possible to add additional fields, but they show after a set of hardcoded fields (
name
,email
,password
,confirmPassword
). Whilst this will be fine in many cases, I have separatefirstName
andlastName
fields and I wanted them to show before theemail
andpassword
fields, and there didn't seem to be a way to do this.This PR will order the fields based on the contents of
signUpFields
; if any of the required fields are not specified, they'll be added in subject to the existing business logic (nameRequired
etc). There's also a special case handlingsignUpFields
being set to["name"]
i.e. the default, with a view to making it as backwards-compatible as possible.As a result, the only way somebody should be impacted by this is if they are currently including one or more of the required fields in their signUpFields property e.g. a value of
["foo", "bar", "email", "password"]
would result in their field order unexpectedly changing fromname
,email
,password
,foo
,bar
toname
,foo
,bar
,email
,password
. This feels like quite an edge case but is important to note.Would welcome thoughts and suggestions!