-
Notifications
You must be signed in to change notification settings - Fork 433
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
Implement vocabulary value selectors in item’s metadata edit form #2653
Conversation
src/app/dso-shared/dso-edit-metadata/confidence-icon/confidence-icon.component.html
Outdated
Show resolved
Hide resolved
src/app/dso-shared/dso-edit-metadata/confidence-icon/confidence-icon.component.html
Outdated
Show resolved
Hide resolved
@toniprieto this is very cool. I tested your changes on DSpace 7.6.1 and it Just Works™. The technique of using the mechanism as in the submission form is clever because it doesn't require any extra configuration. We have about ten fields that use controlled vocabularies. I tested editing and saving on several fields that have a mix of |
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.
@toniprieto i'd try to re-use the existing directive https://github.com/DSpace/dspace-angular/blob/main/src/app/shared/form/directives/authority-confidence-state.directive.ts instead of implementing a new component to do the same.
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 @atarix83 ! You're right, I just removed the new component and used the directive instead although I still want to check if I can improve the display of the indicator when it is displayed outside of an input field like in this PR.
Hi @toniprieto, |
Just want to add my feedback, not a full review, but I've tried out this PR and it is working great with some new external data lookups (via choiceauthority) and traditional CV in various presentations |
b720aec
to
630f130
Compare
Testing this again via a squashed version of this commit (I think the final pull request should be the finished version of this, without the intermediate work, and without the whitespace additions). Still working well on DSpace 7.6.2-SNAPSHOT. |
630f130
to
77f7318
Compare
I think this is ready for review. I have squashed/reorganized the commits and updated the PR description with more information. |
Thanks, @toniprieto! Happy to see the unnecessary whitespace removed and extra commits squashed. I rebased this patch on DSpace 7.6.1 and it works well. I don't have any more feedback on the functionality, so I will let someone with Angular experience comment on the implementation. @tdonohue since this technically restores functionality that was in DSpace 6 I think we should consider porting this to |
- Implement getVocabularyByMetadataAndCollection in VocabularyService - Add aria-label and loadingInitialValue property to DsDynamicOneboxComponent - Add support for MetadataValue class to AuthorityConfidenceStateDirective - Implementation of controlled vocabularies value selectors during item editing See: DSpace#2653
@alanorth : Per a decision by Steering, DSpace 7.6.x will have no new features added in future releases (as 7.6.x is in maintenance mode). So, this new feature will only be possible to add to 8.x. |
Hi @toniprieto, |
77f7318
to
1b89c36
Compare
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.
@toniprieto : I'm testing this today and I'm running into several bugs (at least they appear to be bugs to me...but correct me if I'm wrong).
- On the "Edit Metadata" tab, if I just click "+ Add", there's no option to search in an authority / controlled vocab. It appears you first must type in a value, click "Confirm" (green checkmark) and then edit it again to see the vocabulary search. Is that purposeful? Here's a small video to show the behavior.
- If I type in an author name that matches an existing authority value, sometimes the authority is auto-assigned without my approval. In this video, there is an authority record in my SolrAuthorAuthority for "Donohue, Timothy". Notice how it gets auto-assigned in this video without my selecting it.
- It appears I can select
virtual::*
authority fields which are managed by Configurable Entities. When I do so, I can no longer save the metadata value... all buttons are disabled with popups that explain that I cannot edit this field anymore. Here's a video again:
- The lookup for Publisher is changing my initial value when I edit it. In this video, I add a new Publisher named "School". If I edit it, this triggers the lookup which changes my value automatically to "Association of Schools of Allied Health Professions". It doesn't let me select a value.. it selects one for me.
Overall, the basics appear to work. I'm just finding the experience to be very buggy. I'm running this using production mode (yarn build:prod; yarn serve:ssr
) with a configuration similar to that you recommended (I also have a sherpa romeo key and ORCID sandbox configured alongside this):
solr.authority.server=${solr.server}/authority
plugin.named.org.dspace.content.authority.ChoiceAuthority = \
org.dspace.content.authority.SolrAuthority = SolrAuthorAuthority, \
org.dspace.content.authority.SHERPARoMEOPublisher = SRPublisher,\
org.dspace.content.authority.SHERPARoMEOJournalTitle = SRJournalTitle
choices.plugin.dc.contributor.author = SolrAuthorAuthority
choices.presentation.dc.contributor.author = authorLookup
authority.controlled.dc.contributor.author = true
authority.author.indexer.field.1=dc.contributor.author
choices.plugin.dc.publisher = SRPublisher
choices.presentation.dc.publisher = lookup
authority.controlled.dc.publisher = true
choices.plugin.dc.relation.ispartof = SRJournalTitle
choices.presentation.dc.relation.ispartof = lookup
authority.controlled.dc.relation.ispartof = true
@tdonohue Thanks for the detailed feedback! Yes, I also think they are bugs, I will try to fix them these days. Regarding the first one, although it is done on purpose, I now think it is better if it is also implemented for the new fields. I'll work on that. I think some of these bugs are backend issues and can possibly be reproduced in the current submission form as well. For example, the |
@toniprieto : Just wanted to make sure you are aware that our 8.0 feature PR merger deadline is coming up next week on Friday, Feb 23. I'd love to see this PR included in 8.0, if you can find time to get those bugs fixed. (Extensions are possible if the PR is really close, but ideally we'd get this re-reviewed and merged in the next week.) |
1b89c36
to
5d2977a
Compare
@tdonohue I have updated the PR, the 4 issues should be addressed:
I have added a change to hide the authority key when the confidence value is equals to 0 (NOVALUE) or -1 (UNSET) to address this issue. Additional note: To make the value of the confidence field more apparent while editing, I have made a change to the Confidence directive to allow its use in a different "mode" that uses fontawesome icons, which should be more identifiable. I have tried to limit this change to a single commit in case it turns out to be odd and needs to be reverted (5d2977a)
|
@tdonohue Additional note, I'm investigating another issue that can be reproduced with:
I think it is a bug in the |
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.
@toniprieto : Re-tested this today with the two backend PRs. It's working much better.... and the prior issues appear to be fixed. That said, I'm able to reproduce two new issues (one of which you found too).
- First, I can reproduce the issue you described in your latest comment
- Second, when I edit an text entry that does NOT have an authority entry, I'm finding the experience odd. Here's a video of what I see. This Author is not linked to an authority, but when I click edit it appears to be linked to an authority entry
To set this second bug up I did the following:
- Add a new Author who has a name that matches an authority record. Do not select the authority record. Just leave the author name unattached to an authority.
- Save that Author
- Now, click edit on that Author. The matching authority ID appears in the edit screen & a green circle appears. Both imply the Author is attached to an authority record, but it is not.
Beyond those two issues, everything else is looking good. Thanks!
…fontawesome icons instead of class defined in style property
…namicOneBoxComponent when the user doesn't select any typeahead suggestion. The previous code attempted to maintain focus on the input field to not lose changes but it wasn't working.
…odel into the DsDynamicOneboxComponent. Previously, the accepted confidence value was always displayed if a valid vocabulary entry was retrieved, incorrectly displaying it for values without accepted authority.
5d2977a
to
1fc0462
Compare
Hi @tdonohue, The first issue should be resolved. About the second, I have done a change to prevent the green circle from being displayed when the current confidence value is not ACCEPTED. The behavior has improved, although it is not perfect. The authority key still appears, but it is because the SolrAuthority plugin used for the dc.contributor.author field always adds them when saving a value without authority, although with an invalid confidence. An e2e test has failed, i don't know if it is a random failure. |
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 @toniprieto ! I retested today, and verified everything is fixed except for the minor issue you noted
In my opinion, that's "good enough" for 8.0, as the behavior is much better than in 7.x (where these options didn't exist). We can solve anything else in future PRs as necessary. Thanks again!
Adding the |
@tdonohue I have updated the submission settings section of the "User Interface Configuration" to update the icon configuration modified by this PR: https://wiki.lyrasis.org/display/DSDOC8x/User+Interface+Configuration#UserInterfaceConfiguration-SubmissionSettings And I have added a new section "Add or edit authority controlled metadata fields" to the Edit Metadata page: https://wiki.lyrasis.org/display/DSDOC8x/Edit+Metadata |
References
Description
This PR uses the existent
DsDynamicOneboxComponent
andDsDynamicScrollableDropdownComponent
components to be able to edit metadata controlled by vocabularies in item's metadata edit form in the same way that is done in submission form.Instructions for Reviewers
List of changes in this PR:
DsDynamicOneboxComponent
andDsDynamicScrollableDropdownComponent
in item's metadata edit form for fields controlled by vocabularies:DsDynamicOneboxComponent
: is used for vocabularies that use a autocomplete functionality and for hierarchical vocabulariesDsDynamicScrollableDropdownComponent
: is used for vocabularies configured with value-pairs element in input-forms.xml (dc.type, dc.language.iso, etc.)AuthorityConfidenceStateDirective
to work withMetadataValue
btn-group
to fix border displayDsDynamicOneboxComponent
:aria-label
attribute for accessibility. This component normally uses thearia-labelledby
attribute but these labels are not included in the edit formFor testing vocabularies that use a autocomplete functionality, include this in local.cfg (uses the authorities from Sherpa Romeo and ORCID).
For use ORCID integration is also required to edit your
config/spring/api/orcid-authority-services.xml
uncommenting the ORCID part.NOTE: although it should be possible to implement it, these changes do not apply right now to the first field to add new metadata
Checklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.