Skip to content

deposit: Add support for dynamic field prop overrides #299

@palkerecsenyi

Description

@palkerecsenyi

At the moment, users can specify 'static' prop overrides for certain form field components:

import { parametrize } from "react-overridable";
import { DescriptionsField } from "@js/invenio_rdm_records/src/deposit/fields";

export const overriddenComponents = {
  "InvenioRdmRecords.DepositForm.DescriptionsField": parametrize(DescriptionsField, {
    helpText: "What is your research about?",
    required: true,
  }),
}

These props cannot depend on data such as the values of other form fields. It is set statically in the overrides file and is always applied as the same prop value for all instances of that field.

This issue is for adding a way to make the user-specified override props depend on the form context, including for example the values of form fields. This way, it will be possible to e.g. show/hide a form field based on the resource_type of the record.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    To release 🤖

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions