Closed kennsippell closed 3 months ago
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
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.
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:
Either options are added directly in the configs (Gender) or in a separate CSV file (Level Of Study).
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:
@inromualdo , we will have select multiple
with roles
(related #86 )
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.
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.
https://github.com/medic/cht-user-management/pull/40#issuecomment-1931829645