twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Field name and options should be normalized to A-Z+0-9

Open FelixMalfait opened this issue 1 year ago • 3 comments

I tried to create a field "industry" on the company object. One of the options had emoji in its value: Screenshot 2024-01-08 at 12 15 35

But now my workspace is broken and I get this error everywhere: Screenshot 2024-01-08 at 12 04 54

Related: #3066 #2146

FelixMalfait avatar Jan 08 '24 11:01 FelixMalfait

Sentry issue: PROD-3C

sentry-io[bot] avatar Jan 08 '24 14:01 sentry-io[bot]

Hey @FelixMalfait I encountered a similar issue in #3270.

It looks like while create options, we are assigning value property as the Name of enum. This error is thrown because GraphQL has internal validation on GraphQLEnumType. I did a workaround from the front end to solve this, but I guess that shouldn't be long term solution.

AdityaPimpalkar avatar Jan 08 '24 21:01 AdityaPimpalkar

@AdityaPimpalkar You're right the problem is actually also related to #3270, but in that case the name inside the enum are chosen by the user. We should change the regex to only accept [a-zA-Z]+, and drop number and emoji support.

We should add a new field inside FieldMetadataDefaultOptions for emoji, and contact it in the front side.

magrinj avatar Jan 09 '24 07:01 magrinj