Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cardinalities aren't taken into account when adding or removing relationships #1107

Open
artlowel opened this issue Apr 16, 2021 · 1 comment

Comments

@artlowel
Copy link
Member

Describe the bug
We don't take cardinalities into account when adding or removing relationships in the submission or on the edit relationships tab for an archived item.

For example, if you submit a new item that has a relationship with minCardinality 1, you can add that relationship once. But afterwards you can't remove it or replace it. Rest refuses a DELETE request, because that would leave the item without that required relationship, and replacing the relationship is currently implemented as a DELETE followed by a POST.

A PUT would likely work, so we could solve this by checking the cardinality and sending a PUT in the case both min and max are 1. But that would essentially make that relationship a required field for that submission, and that's not how other required fields work

If a title is required, and you fill it in, you're still allowed to clear it afterwards. You get an error message, and you can't deposit your submission until you enter a title, but you can clear it.

I think for the best user experience it should work the same way for relationships in the submission. That is perhaps something we can achieve in the context of #858

We should also keep in mind that the all operations should also be possible for an admin on an archived item in the edit relationships tab. In that case I wouldn't think it is a big problem if we simply disable the remove button for the last relationship that would put the item under the minCardinality limit, ideally with a tooltip explaining why.

To Reproduce
Steps to reproduce the behavior:

  1. Submit an item to a collection that has a relationship with minCardinality 1
  2. Add a related item for that relationship
  3. Try to remove it, or replace it

Expected behavior
To be discussed

Related work
#858

@artlowel artlowel added bug needs discussion needs triage New issue needs triage and/or scheduling labels Apr 16, 2021
@tdonohue
Copy link
Member

@artlowel : Based on your description & linking to the larger Submission refactor, it sounds like you are implying we should wait to fix this for 7.1, as it may require a larger amount of work/discussion that isn't easily achievable in the 7.0 timeline. Based on all that, I'm moving this to the 7.1 board alongside #858.

@tdonohue tdonohue added this to the 7.1 milestone Apr 16, 2021
@tdonohue tdonohue removed the needs triage New issue needs triage and/or scheduling label Oct 6, 2021
@tdonohue tdonohue removed this from the 7.1 milestone Oct 6, 2021
@tdonohue tdonohue moved this to To Do in DSpace 7.5 release Oct 11, 2022
@tdonohue tdonohue moved this to 📋 To Do in DSpace 7.6 Release Feb 27, 2023
FrancescoMolinaro added a commit to 4Science/dspace-angular that referenced this issue Dec 18, 2023
CST-12904 breadcrumbs qa

Approved-by: Giuseppe Digilio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants