What to Override When (modular deposit form)¶
1. Replace the whole widget for a section¶
You want: A completely different implementation for that section (e.g. different dates UI, different community picker, different submit area).
Override: The slot id in the instance’s assets/js/invenio_app_rdm/overridableRegistry/mapping.js → overriddenComponents.
Ids (one per section):
Section |
Overridable id |
|---|---|
Additional dates |
|
Community |
|
DOI/PIDs |
|
Languages |
|
Resource type |
|
Submit / status box |
|
Access |
|
Creators |
|
Contributors |
|
Descriptions |
|
Form feedback |
|
File upload |
|
Modular package default (paths relative to invenio_modular_deposit_form/assets/semantic-ui/js/invenio_modular_deposit_form/): the deposit FormFeedback slot is filled by FormFeedback in replacement_components/alternate_components/FormFeedback.jsx, with the section summary in replacement_components/alternate_components/form_feedback_components/FormFeedbackSummary.jsx. See Built-in field widget components for the optional hideMessageIcon prop.
| Funding | InvenioAppRdm.Deposit.FundingField.container |
| Identifiers | InvenioAppRdm.Deposit.IdentifiersField.container |
| License | InvenioAppRdm.Deposit.LicenseField.container |
| Publication date | InvenioAppRdm.Deposit.PublicationDateField.container |
| Publisher | InvenioAppRdm.Deposit.PublisherField.container |
| Related works | InvenioAppRdm.Deposit.RelatedWorksField.container |
| Subjects | InvenioAppRdm.Deposit.SubjectsField.container |
| Titles | InvenioAppRdm.Deposit.TitlesField.container |
| Version | InvenioAppRdm.Deposit.VersionField.container |
Example: Replace the whole dates section with our alternate implementation:
overriddenComponents["InvenioAppRdm.Deposit.DateField.container"] = OverrideAdditionalDatesComponent;
Props your override receives: When you override a slot, react-overridable passes your component the same props the default child would get: the props that were on the default child (from FieldComponentWrapper’s React.cloneElement or the parent wrapper). So you receive fieldPath, label, labelIcon, description, helpText, required, and any section-specific props (e.g. options, recordUI for titles) without re-implementing the wrapper or reading from the store for those. You do not need to wrap your override in FieldComponentWrapper again.
3. Change layout: which sections exist, order, or which wrapper is used by name¶
You want: Add/remove/reorder sections, or have the layout resolve a different component when it asks for e.g. “DescriptionsField” by name.
Use: Form layout config (COMMON_FIELDS / FIELDS_BY_TYPE) and/or the component registry (componentsRegistry.js from the invenio_modular_deposit_form.components_registry entry point).
Layout config: decides which section names appear and in what order.
Component registry: maps section name →
[Component, fieldPaths]. If you register e.g.DescriptionsField: [MyDescriptionsWrapper, ["metadata.description"]], then whenever the layout says “DescriptionsField”, your wrapper is mounted. Your wrapper can then render<Overridable id="InvenioAppRdm.Deposit.DescriptionsField.container">and pass props or default content as you like.
This is not the same as (1): here you’re changing which component is mounted for that section name; in (1) you’re leaving the wrapper as-is and replacing only what’s inside the Overridable for that slot.
Quick decision¶
“Replace the whole [dates / community / submit / …] section” → override the slot id in (1) in
mapping.js.“Change one part inside a widget” → find and override the inner id in (2) in
mapping.js.“Change what section names mean or what appears in the layout” → use (3): layout config + component registry.