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
[ ] Code meets acceptance criteria from issue
[ ] Unit tests are written and all pass
[ ] User Test Scripts (if required) are written and have been run through
[ ] Code documentation and related non-code documentation has all been updated
Reviewer Checklist
Reviewers should review and confirm each of these items before approvalIf there are multiple reviewers, this section can be duplicated for each reviewer
[ ] Code meets acceptance criteria from issue
[ ] Unit tests are written and all pass
[ ] User Test Scripts (if required) are written and have been run through
[ ] Code documentation and related non-code documentation has all been updated
[ ] Migation has been created and tested
Testing
List user test scripts that need to be run
List any non-unit test scripts that need to be run
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 theOptionalRoleCreatibutorsField
class (and equivalents for other components) that allows control of the rendering of the role field based on theincludeRole
prop. It also adds ahelpText
prop and renders this. Inmapping.js
it then parametrizes the class with appropriateincludeRole
andhelpText
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