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

Sort radionbuttoninline field choices #543

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

NC-jsAhonen
Copy link
Contributor

@NC-jsAhonen NC-jsAhonen commented Nov 11, 2024

If the radiobuttoninline field is 'hakija', the choices will be sorted by value so that Yritys is first and Henkilö is last.

src/util/helpers.tsx Outdated Show resolved Hide resolved
@NC-jsAhonen NC-jsAhonen force-pushed the MVJ-189-company-first-in-applicant-type branch from fb7737b to 16381f5 Compare November 13, 2024 12:28
@NC-jsAhonen NC-jsAhonen changed the title Sort order to radionbuttoninline field choices Sort radionbuttoninline field choices Nov 13, 2024
};

export const getRadioButtonInlineFieldChoicesSorted = (field: FormField, choices: FormFieldChoice[]): FormFieldChoice[] => {
Copy link
Contributor

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.

Copy link
Contributor

@juho-kettunen-nc juho-kettunen-nc left a 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.

@juho-kettunen-nc
Copy link
Contributor

Good idea to name the function with intention to make it expandable.

@NC-jsAhonen NC-jsAhonen merged commit 70b265b into develop Nov 14, 2024
3 checks passed
@NC-jsAhonen NC-jsAhonen deleted the MVJ-189-company-first-in-applicant-type branch November 14, 2024 10:17
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.

3 participants