Skip to content

Conversation

@egabancho
Copy link
Member

@egabancho egabancho commented Jan 27, 2026

This is how you can use it

import { getInputFromDOM } from "@js/invenio_rdm_records";
import { DepositFormApp } from "@js/invenio_rdm_records/src/deposit/api/DepositFormApp";
import { AwesomeSerializer} from "@js/site/records/deposit/DepositRecordSerializer"

const depositConfig = getInputFromDOM("deposits-config");
const parametrizedRDMDepositForm = parametrize(DepositFormApp, {
  recordSerializer: new AwesomeSerializer(
    depositConfig.default_locale,
    depositConfig.custom_fields.vocabularies,
  ),
});

export const overriddenComponents = {
  // Deposit
  "InvenioAppRdm.Deposit.RDMDepositForm.layout": parametrizedRDMDepositForm,
...
}

@egabancho egabancho force-pushed the override-deposit-serializer branch from f1a9f3f to 6e64528 Compare January 28, 2026 08:50
groupsEnabled={groupsEnabled}
allowEmptyFiles={allowEmptyFiles}
customFieldsUI={customFieldsUI}
recordSerializer={null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain how setting the prop to null helps to override it, because I am not sure I understand?
https://github.com/inveniosoftware/invenio-rdm-records/pull/2243/changes#diff-6dc2b45d8268fce47e87bb05cff1c6cd6b968ed03e0b6cc91b5675bcf485b641R157 here the default prop is already undefined, isn't it enough ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you need to add it to the overridable context to be able to parametrize it. I simply set it to null to preserve the same behaviour, but we could also set it to RDMDepositRecordSerializer, and the result will be the same (or undefined for that matter).

@egabancho egabancho force-pushed the override-deposit-serializer branch from 6e64528 to 35b634d Compare February 11, 2026 09:49
@egabancho egabancho merged commit 35b634d into inveniosoftware:master Feb 11, 2026
4 checks passed
@egabancho egabancho deleted the override-deposit-serializer branch February 11, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants