dspace-angular
dspace-angular copied to clipboard
[Port dspace-7_x] Add support for non repeatable relationships
References
DSpace 7-x version of #3142
Description
This PR fixes an issue in the edit relationship list component where the search modal is always repeatable, regardless of the relationship max cardinality while in the submission forms, you can set it to non-repeatable.
To make the behaviour more consistent between the submission form modal and the edit relationships modal, the edit relationships modal will now show radio buttons when the max cardinality is set to 1.
Instructions for Reviewers
- Make sure there is a relationship with max cardinality of one on either the left or the right side and that items are present for both sides of the relationship
- Navigate to an entity that can be linked with the the type with max cardinality 1
- Go to the edit item page > Edit relationships tab and click add on the relevant relationship
- Verify that the modal shows radio buttons and that you can only add one linked item
- Verify that for other relationships you can still add multiple items
Checklist
- [x] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
- [x] My PR passes ESLint validation using
yarn lint - [x] My PR doesn't introduce circular dependencies (verified via
yarn check-circ-deps) - [x] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
- [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
- [x] If my PR includes new libraries/dependencies (in
package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation. - [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
- [x] If my PR fixes an issue ticket, I've linked them together.