ImperialCollegeLondon / fair-data-repository

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Creatibutor form update #81

Open cc-a opened 6 days ago

cc-a commented 6 days ago

This PR hides the role field for the creator form field and adds help text beneath both the creator and contributor form fields. The third item referenced in the issue is to make the search field within the modal more obvious as a search field but I believe the root cause of this issue is that the placeholder text is hidden. I've added a comment to #68 as this appears to be closely related.

The implementation subclasses the relevant form components from invenio_rdm_records in order to override render methods and update the logic. It creates the OptionalRoleCreatibutorsField class (and equivalents for other components) that allows control of the rendering of the role field based on the includeRole prop. It also adds a helpText prop and renders this. In mapping.js it then parametrizes the class with appropriate includeRole and helpText prop values for the creator and contributor fields and overrides the components in the deposit form.

Overall the implementation is pretty horrible hence why it's been left in draft and requires copying quite a lot of code for the render method of relevant form components from invenio_rdm_records as there is no clean extension point to hook into for rendering of the role field. Adding just the help text could be done much more cleanly via subclassing as . This implementation will be brittle w.r.t updates of InvenioRDM version.

All in all I'm open to other suggestions. If we could get some of this (most notably hiding the role field) pulled into invenio_rdm_records then that would be cleanest from our point of view.


Enter a brief description of the PR contents here

Developer Checklist

Developers should review and confirm each of these items before requesting review

Reviewer Checklist

Reviewers should review and confirm each of these items before approval If there are multiple reviewers, this section can be duplicated for each reviewer

Testing

List user test scripts that need to be run

List any non-unit test scripts that need to be run