-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sort radionbuttoninline field choices #543
Conversation
fb7737b
to
16381f5
Compare
src/application/helpers.ts
Outdated
}; | ||
|
||
export const getRadioButtonInlineFieldChoicesSorted = (field: FormField, choices: FormFieldChoice[]): FormFieldChoice[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a documentation comment here, saying what is the goal of the function in this case. Or maybe even better to rename the function to getRadioButtonApplicantFieldChoicesSorted
, to make it clear from the outside that it is only intended for the applicant field and no other use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment about function name/documentation.
Good idea to name the function with intention to make it expandable. |
If the radiobuttoninline field is 'hakija', the choices will be sorted by value so that Yritys is first and Henkilö is last.