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

Gender form input should be a dropdown instead of freetext field #55

Closed
kennsippell opened this issue Feb 8, 2024 · 6 comments · Fixed by #96
Closed

Gender form input should be a dropdown instead of freetext field #55

kennsippell opened this issue Feb 8, 2024 · 6 comments · Fixed by #96
Assignees
Labels

Comments

@kennsippell
Copy link
Member

Sex should be a drop down with just male and female

#40 (comment)

@inromualdo
Copy link
Contributor

I propose removing this type and replacing it with a select_one type. This not only addresses the gender issue but also enables the selected items to be transformed into a dropdown. The parameter will be an object with key = select-option value and value = label.

@kennsippell

@kennsippell
Copy link
Member Author

kennsippell commented Mar 12, 2024

Sounds good @inromualdo! Interested to learn which of these tests will work after the change. If we break a few, I think that'd be okay - let's just be clear on what the new select_one (or just select?) interface supports when data comes from CSVs,

This may also be useful for @paulpascal to address this feedback.

@inromualdo
Copy link
Contributor

It could just be select. I initially used select_one, thinking we might add select_multiple later. However, in the contact creation forms across several projects, I haven't seen any multiple-choice elements. So, we can simply stick with select.

It would look like this:
Screenshot 2024-03-12 at 2 19 22 PM

Either options are added directly in the configs (Gender) or in a separate CSV file (Level Of Study).

Screenshot 2024-03-12 at 2 27 54 PM

After the change, all gender tests will fail unless we leave the type gender and add the select type alongside it.

The genarated html will be:

Screenshot 2024-03-12 at 2 36 16 PM

@paulpascal
Copy link
Contributor

@inromualdo , we will have select multiple with roles (related #86 )

@kennsippell
Copy link
Member Author

kennsippell commented Mar 12, 2024

How many levels of study are there? Interested in why you're thinking a csv is needed here since parameter already supports array[] (eg. "parameter": ["one", "two", "three"])

After the change, all gender tests will fail unless we leave the type gender and add the select type alongside it.

Gender supports some weird cases like mapping F > Female and Woman > Female. I doubt those would be easily handled by this select_one type.

@inromualdo
Copy link
Contributor

How many levels of study are there?

This is just an example. Here, there is 5. But in the CIV project we have a select_one with more than 200 items.

parameter already supports array[]

In this example, I use object, so that I can display a friendly label

I doubt those would be easily handled by this select_one type

Those would be handled.

inromualdo added a commit that referenced this issue Mar 14, 2024
@kennsippell kennsippell moved this from March 22 Milestone to In Progress in CHT User Management Roadmap Mar 14, 2024
paulpascal added a commit that referenced this issue Mar 27, 2024
paulpascal added a commit that referenced this issue Mar 27, 2024
paulpascal added a commit that referenced this issue Mar 27, 2024
paulpascal added a commit that referenced this issue Mar 29, 2024
paulpascal added a commit that referenced this issue Mar 29, 2024
paulpascal added a commit that referenced this issue Mar 29, 2024
paulpascal added a commit that referenced this issue Mar 29, 2024
* feat(#55): add select_one and select_multiple

* feat(#55): remove gender validator file

* feat(#55): update readme

* fix(#55): address feedback

* fix(#55): address feedback part 2

* test(#55): update test cases

* fix(#55): address feedback part 3

* fix(#55): address final feedback

* 1.3.5

---------

Co-authored-by: Kenn Sippell <[email protected]>
Co-authored-by: paulpascal <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Done in CHT User Management Roadmap Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done (March Sprint)
Development

Successfully merging a pull request may close this issue.

3 participants