-
Notifications
You must be signed in to change notification settings - Fork 164
Bulk Edit: render default editor if field uses custom appereance [MAPS-97] #10268
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
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| const ERROR_MESSAGE = 'Failed to initialize field editor. Please try again.'; | ||
| const SUPPORTED_WIDGET_IDS = [ |
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.
Small suggestion: Make this a map/hashmap data structure instead of an array to make the lookup efficient on line 147
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.
Good catch, I've changed it to use a Set so the lookup is faster
ryunsong-contentful
left a comment
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.
Overall looks good, let me know what you think of the small fix and I can approve afterwards
| }, [field, value, onChange, locale]); | ||
|
|
||
| const getWidgetId = (field: ContentTypeField) => { | ||
| const fieldTypeToDefaultWidget: Record<string, 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.
Is there a reason why this isn't a constant outside of the component so that this data doesn't rerender?
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.
Not really, I've moved it
Purpose
The app currently displays an error message if a field uses a custom appearance.
Approach
We are not able to render the custom appearance but we can still render the default field editor for the underlying field type.
Before
Screen.Recording.2025-11-20.at.11.22.51.mov
After
Screen.Recording.2025-11-20.at.11.33.11.mov