-
Notifications
You must be signed in to change notification settings - Fork 447
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
Repeatable fields with look up still broken in some cases #1092
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alemarte! The code looks good, and the issues reported in #1091 are fixed.
An issue I reported for #1025 is back however: if you enter a query in a mixed field (e.g. the author field in the Publications 2 collection), then do a lookup and select an entity. The relationship is saved, but your query is also saved as metadata
Also, disabling the trash can on the final field doesn't seem like the best approach to me.
For example, if you have a relationship as your only value and you want to replace it with something else, you have to add a new field first, only then can you remove the original. That's not very intuitive in my opinion.
It makes more sense to me to always allow the deletion of a field, and to show the initial empty field we show when you first arrive on the submission if all fields have been deleted.
@artlowel thanks for your quick review!
I spent time with @atarix83 to investigate this. We can reproduce this and you're right. This bug has been reintroduced after the fix of the other related issue (opening the modal and closing it without select anything makes the field empty). It's seems that it is almost impossible to fix both.
We can't make assumption on what happens inside the modal. The user could select many options, or none. To fix this we should get the user to choose only one option every time he opens the modal, and the selected option without doubts can then replace the originator plain value. @tdonohue what could be the preferable option which cause the minor damage, waiting for the ideal solution which is planned to be implemented in upcoming releases?
It makes sense, we have a solution for this and we'll implement on next monday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alemarte and @artlowel : I did some testing as well here.
I agree with @artlowel that the trash can should not be disabled when you have a relationship as the only value, because this means that last value cannot be modified/removed.
Regarding the lookup button behavior: For the purposes of this PR, if you enter a name and then click Lookup, I think the name should remain in the plain text field -- as there's no guarantee your lookup will match any values. I agree that this behavior is less than ideal, but I'd rather the value remain instead of being deleted/cleared when the modal window opens.
As a sidenote (not necessarily for this PR, but perhaps for 7.0 final), I'm starting the realize the behavior of the lookup popup window is not user friendly. The lookup window acts like it should only appear once per metadata field (in that all your current selections always appear in the popup & you can add multiple relationships at once from the popup). However, as we know, we changed it to appear once per metadata value (next to each value). The fact that it appears once per value seems to be causing these unexpected behavior issues, since it is able to modify more than that single value & is not actually "linked" back to that specific value. I'm now starting to wonder if we should change Lookup back to appearing once per field (i.e. next to the "+ Add more" link), as this would remove a number of these issues regarding how it behaves for individual values. If we agree this is a more appropriate fix to the issues posed in this PR, I'd be OK with changing the Lookup to only appear once per field (at least for now), whether in this PR or in a followup PR.
we are fixing it
@tdonohue we agree with this approch, indeed it was the first solution used when we've opened repeatable fields PR. If all agree we can restore that implementation in a follow-up PR. It should take about 2/3 hours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR in combination with DSpace/DSpace#3224 sadly still doesn't fix the bugs introduced in #1025
I've tested it with Tim's configuration and database from #3232, but the submission of a Person entity, and relating it to a Publication entity, keeps failing
I just noticed you've updated it while I was reviewing it, I will review again |
The latest update seems to fix:
It doesn't seem to fix:
|
IMHO relationships not linked to a metadata cannot be supported at this time as the relationship support in the submission was build in the wrong way since its conception, see DSpace/DSpace#2953 The current options are
|
This functionality has always worked. It's not because it was recently broken in #1025 that it suddenly doesn't need to be supported anymore I've re-tested it with an older instance I still had (codebase from start of February), and this all worked correctly |
Since its introduction the lookup button has created tons of issues, indeed it was agreed that it must be redone as it was faulty. |
I agree it's not in scope of this PR to perform a full refactor of the functionality. An alternative solution can be to reverse the commits from #1025 which did break the entities submission, but based on the behavior it seems the only remaining problem is related to an observables error, or a lack of reading the item's status. If it's helpful, it's always possible to check out how this worked start of February, that codebase did still work correctly |
The current solution is much more stable and less problematic than what we had in February. Moreover, this PR comes from specific issues that were left pending when #1025 was merged see #1025 (review) and all of them are fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alemarte : I tested this today. It mostly works, but I found a bug in the Publication form. If you select (one or more) existing Authors, the textbox disappears (text entry is no longer possible) and the Author names are shown instead. This seems unexpected, as you should still be able to add a free-text Author name even after linking up an existing Person entity (as an Author). Here's how to reproduce with the api7.dspace.org as the backend:
- Login as an Admin
- Create a new Submission to the "Articles" Collection...this will use the Publication form.
- Click the lookup button next to Author and select 1-2 Persons. Close the window
- The 1-2 Persons will appear on the Submission form, but the Author textbox will now be gone.
@benbosman and @abollini : I also did some thorough testing regarding your comments/discussion above. The relationship bug reported by @benbosman in this comment does not appear to be related to this PR, so I've moved it into a separate ticket (along with all my detailed testing notes), See #1094. I'll also note that I've verified that this same bug existed before #1025 was applied...I'm not yet sure when it started though. But, please refer to all my testing details to the new ticket.
For the purposes of this PR, I'd therefore like to keep the scope very small. We are only looking to resolve the issues detailed in #1091 without introducing any new issues.
Finally, I'd like to again note that I'm starting to think the behavior of the "Lookup" button may require it to only appear once per field (not once per value). I mentioned this in my previous comment, and I still think it is true. I'd like @artlowel 's feedback on that concept though before we change anything regarding the "Lookup" button...specifically I'm not sure if it'd make solving #1094 easier or harder. In any case, we may want to keep it out of the scope of this current PR for now.
@tdonohue with the last modification this also should now work properly. |
The only reason I'm a bit hesitant to agree is because we'd lose the behavior where type in a value in the metadata field, and click the lookup button next to it to use it as a query. Perhaps we can do both? Keep the little spyglass button we have next to each metadata value, but also add a bigger lookup button at the bottom next to "add more"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks @alemarte . This appears to now solve the initially reported issues (at least for me).
(As a sidenote, I'm still not certain the behavior of the Lookup field is correct.. I'm less and less sure it should be on each value, but we can leave it that way for now until we get feedback from actual users on the current behavior.)
@artlowel or @benbosman : Any objections to moving this PR forward? It seems to me like all prior feedback was resolved....but feel free to give one last test if you feel it's needed.
Go ahead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alemarte
References
Description
With a working REST implementation of the PATCH ADD entire array with virtual metadata, some minor bugs arose angular side.
This PR aims to solve them.
Instructions for Reviewers
Fixes:
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn run lint
package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.