-
Notifications
You must be signed in to change notification settings - Fork 52
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
Enum custom field UI #2210
base: main
Are you sure you want to change the base?
Enum custom field UI #2210
Changes from 3 commits
26beb6c
04b859b
b0be7ed
43d4e6b
a2ffcdb
d326a04
0a1d389
4367150
1d0dffb
e3e5469
31d681a
9faecf9
2f136fe
c6f88b5
56adf2d
660e657
d641dd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,6 +7,7 @@ | |||||||||
IconButton, | ||||||||||
InputLabel, | ||||||||||
MenuItem, | ||||||||||
NativeSelect, | ||||||||||
Select, | ||||||||||
} from '@mui/material'; | ||||||||||
import dayjs, { Dayjs } from 'dayjs'; | ||||||||||
|
@@ -221,6 +222,31 @@ | |||||||||
value={fieldValues[field.slug]?.toString() ?? ''} | ||||||||||
/> | ||||||||||
); | ||||||||||
} else if (field.type === CUSTOM_FIELD_TYPE.ENUM_TEXT) { | ||||||||||
return ( | ||||||||||
<Box alignItems="flex-start" display="flex" flex={1}> | ||||||||||
<FormControl fullWidth> | ||||||||||
<InputLabel>{field.title}</InputLabel> | ||||||||||
<Select | ||||||||||
fullWidth | ||||||||||
value={fieldValues[field.slug]?.toString() ?? ''} | ||||||||||
onChange={(ev) => { | ||||||||||
onChange(field.slug, ev.target.value); | ||||||||||
}} | ||||||||||
label={field.title} | ||||||||||
> | ||||||||||
<MenuItem key="" value=""> | ||||||||||
<em>None</em> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing internationalization here.
Comment on lines
+244
to
+245
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can using Is it not possible to do this?
Suggested change
|
||||||||||
</MenuItem> | ||||||||||
{field.enum_choices.map((c) => ( | ||||||||||
<MenuItem key={c.key} value={c.key}> | ||||||||||
{c.label} | ||||||||||
</MenuItem> | ||||||||||
))} | ||||||||||
</Select> | ||||||||||
</FormControl> | ||||||||||
</Box> | ||||||||||
); | ||||||||||
} else { | ||||||||||
return ( | ||||||||||
<EditPersonField | ||||||||||
|
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.
Here we need to translate from
""
tonull
.