-
Notifications
You must be signed in to change notification settings - Fork 2.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 array edit option #8697
Fix array edit option #8697
Conversation
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.
PR Summary
Added support for editing array type fields in the MultiItemFieldInput component by implementing a case handler for FieldMetadataType.Array in the edit functionality.
- Added
case FieldMetadataType.Array
inhandleEditButtonClick
function within/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/MultiItemFieldInput.tsx
to handle array item editing - Implemented array item editing to treat items as strings, similar to email field handling
- Fixed issue cannot edit array item #8578 where clicking edit on array items would throw an error
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
case FieldMetadataType.Array: | ||
item = items[index] as string; | ||
setInputValue(item); | ||
break; |
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.
style: The Array case implementation is identical to Emails case. Consider extracting this common logic to reduce duplication.
Hey @ehconitin, I understood what you said about needing an explicit statement for the Array block. I thought it would be repetitive to write the same code again. But what you said makes sense and I've made the changes requested. I created a fresh PR with the changes specified. |
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.
LGTM!
Thank you! |
Thanks @BKM14 for your contribution! |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Closes #8578
There was no case to handle a FieldMetadataType.Array and thus an error was thrown every time the edit button was clicked on an Array type.
It has been added now with an explicit break statement.