-
Notifications
You must be signed in to change notification settings - Fork 1
Can't override core mapWidgetTypes #3
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Question or comment
Please include as much detail as possible so we can help more quickly.
- The way it is written,
self.options.mapWidgetTypestakes any user-entered configuration, spreads it, then adds core widget config. This prevents users from overriding the core widget mapping. For image widgets it could be especially useful to be able to identify a different widget type and data structure
Details
Current mapping:
self.options.mapWidgetTypes = {
...self.options.mapWidgetTypes,
'apostrophe-rich-text': '@apostrophecms/rich-text',
'apostrophe-images': async (widget) => ({
...widget,
type: '@apostrophecms/image',
imageFields: widget.relationships,
imageIds: (widget.pieceIds || []).slice(0, 1)
}),
'apostrophe-video': '@apostrophecms/video',
'apostrophe-html': '@apostrophecms/html'
};
Lines 29 to 40 in f405ce4
| self.options.mapWidgetTypes = { | |
| ...self.options.mapWidgetTypes, | |
| 'apostrophe-rich-text': '@apostrophecms/rich-text', | |
| 'apostrophe-images': async (widget) => ({ | |
| ...widget, | |
| type: '@apostrophecms/image', | |
| imageFields: widget.relationships, | |
| imageIds: (widget.pieceIds || []).slice(0, 1) | |
| }), | |
| 'apostrophe-video': '@apostrophecms/video', | |
| 'apostrophe-html': '@apostrophecms/html' | |
| }; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested