Skip to content

deposit: add default values for custom fields on deposit form#3435

Open
tmorrell wants to merge 2 commits into
inveniosoftware:masterfrom
caltechlibrary:custom-field-defaults
Open

deposit: add default values for custom fields on deposit form#3435
tmorrell wants to merge 2 commits into
inveniosoftware:masterfrom
caltechlibrary:custom-field-defaults

Conversation

@tmorrell
Copy link
Copy Markdown
Contributor

❤️ Thank you for your contribution!

Description

There isn't currently a way to set defaults for custom fields in the deposit field. This adds a new config variable and implements it in basically the same way as the existing field.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@tmorrell tmorrell added this to v14 Apr 24, 2026
@tmorrell tmorrell moved this to 👀 In review in v14 Apr 24, 2026
Comment thread invenio_app_rdm/records_ui/views/deposits.py Outdated
Comment thread invenio_app_rdm/config.py
APP_RDM_DEPOSIT_FORM_CUSTOM_FIELD_DEFAULTS = {}
"""Default values for custom fields in new records in the deposit UI.

The keys denote the dot-separated path, where in the record's custom field
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: should we copy paste the documentation from APP_RDM_DEPOSIT_FORM_DEFAULTS or should link to APP_RDM_DEPOSIT_FORM_DEFAULTS so that those two doc strings will not get out of sync?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've copy pasted. I'm not sure how one would do a link, such that it would be appropriately pulled into the code. Have any examples?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i have thought of writing something like format of the field follows the structure of APP_RDM_DEPOSIT_FORM_DEFAULTS, please have a look to that documentation. so it is clear that both have the same form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants