-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: options value can't contain special characters #3738
Conversation
@@ -5,8 +5,19 @@ import { Field } from '~/generated-metadata/graphql'; | |||
|
|||
import { FieldMetadataOption } from '../types/FieldMetadataOption'; | |||
|
|||
const getOptionValueFromLabel = (label: string) => | |||
toSnakeCase(label.trim()).toUpperCase(); | |||
const getOptionValueFromLabel = (label: string) => { |
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.
it would be great to add tests on this function
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.
@charlesBochet I've added some tests, let me know if it's what you had in mind and if we can merge
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.
@Weiko Thanks for the tests, I've just added an emoji test
42291bc
to
79d1beb
Compare
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.
Let's go! LGTM :)
When we put special characters like emoji inside options, the value generated by the front-end should strip the special characters and accents.
Fix #3296