inveniosoftware / invenio-vocabularies

Invenio module for managing vocabularies.
https://invenio-vocabularies.readthedocs.io
MIT License
2 stars 40 forks source link

funder: Custom funder should support free text entry #293

Open tmorrell opened 4 months ago

tmorrell commented 4 months ago

Package version (if known): v9-v12

Describe the bug

In the API you can provide either the name OR the id for a funder https://inveniordm.docs.cern.ch/reference/metadata/#funding-references-0-n. However, the deposit form doesn't have an "Add ..." option show up to allow you to add a funder that is not in the vocabulary. This makes it impossible for users to add funders that are not yet in ROR.

Steps to Reproduce

  1. Go to the deposit form
  2. Click on Funding, Add Custom
  3. Type in a Funder that doesn't exist in ROR (Caltech Library).
  4. There is no option to add the funder

Additional context

In theory, this should be as simple as removing false from https://github.com/inveniosoftware/invenio-vocabularies/blob/a180d29f38f366b37d228314accac96fc74b6d81/invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js#L69. However this doesn't work because everything typed (C, Ca, Cal,...) gets added as an "Add' suggestion. The allowAdditions behavior works correctly on the affiliation and subjects fields, but there are enough differences between the implementations that a refactor might be needed. Screenshot 2024-02-09 at 3 17 09 PM