[DSpace-CRIS] Porting of authority framework functionalities (Frontend)#4956
[DSpace-CRIS] Porting of authority framework functionalities (Frontend)#4956FrancescoMolinaro wants to merge 40 commits intoDSpace:mainfrom
Conversation
|
Hi @FrancescoMolinaro, |
artlowel
left a comment
There was a problem hiding this comment.
Apologies for the delayed response, I’ve been out sick.
It looks like #4814 has already been merged in the meantime.
Following the referenced PR, when the relevant metadata is present, the custom URL replaces the standard UUID/ID parameter in the page URL and effectively becomes a unique identifier for the item.
For this reason, we considered it preferable to keep the validation logic inside the
findByIdmethod, as this approach minimizes the impact across the application and avoids the need to modify multiple code paths where the UUID/ID is extracted from the URL.
The reason for my original comment is that findById is used consistently throughout the application to retrieve resources by their UUID.
Handles are also unique identifiers for a resource, as are self links, and these are handled separately through dedicated methods and resolvers. While I understand that placing this logic inside findById may reduce the number of changes required, it introduces inconsistency across dataservices and increases the risk of edge cases.
In my view, this logic should be moved out of findById, either as part of this PR or in a separate, focused PR before the release of DSpace 10.
|
Hi @MarieVerdonck, thanks for the feedback, much appreciated.
Here we will have icons with colors matching the confidence of the authority. For the label in the search component in item page I believe is unrelated to this PR as the issue is present also on the demo instance, e.g. Instead for the positioning of the authors in the item page I have pushed a fix to have the list stacked vertically as it was before. Additional note: In the regular form the authority feedback is given by the circle icon in the input, that will have a different color based on the confidence:
It would be really appreciated if you could check this again, many thanks. |
There was a problem hiding this comment.
@FrancescoMolinaro : Thanks for this PR! I gave this some testing today (alongside the backend PR). Mostly, it's working. However, there are some display issues in the User interface that I'm seeing:
- When submitting a Publication, if I search up an author's name, I can choose someone from either local database or ORCID sandbox. However, the icons always show a database icon. In the screenshot below, these are all authors that only exist in the ORCID sandbox but there is no ORCID icon (like in your screenshot in the description of this PR).
- The display of authors in search results is now messed up. Authors will not be displayed unless you click the "Show More" button. But, after clicking "Show More" you see the author names vertically like this screenshot:
- If I create a Publication with three authors and then visit the publication page, the author hover-overs work well. However, it's very difficult to click the "More info" link in the hover-over for the second or third author. As soon as you move the mouse up, the popup for the author above appears. You have to carefully move the mouse in a diagonal to get to the link. This is a smaller thing, but it seems like a usability issue.
- Finally, if you succeed in clicking "More Info" in the hover-over (see the third item just above), then that hover-over will "flash" briefly in the upper right corner of the page before loading the Person page for this Author. This is also minor, but I'm consistently seeing a "flash" anytime I click this "More infor" link.
I'm still testing & haven't done a code review here yet. But, that's what I've found so far.
|
Regular author lookup issue When reviewing this PR, I’m encountering a console error during author lookup (magnifying glass icon next to author lookup through which previously existing local or import-from-orcid entity Person items were linked) in the submission flow:
Console message: Note I’m not certain this issue is introduced by this PR, but the problem does not occur on https://demo.dspace.org/. When building the current |
tdonohue
left a comment
There was a problem hiding this comment.
@FrancescoMolinaro : Thanks again for this PR! I've finished a code review and have some minor comments inline below. Most of the comments are requests for TypeDocs or small accessibility improvements.
However, I've also asked for some possible restructuring of the configuration (to group together related configs). While I'd rather do this restructuring now, we could potentially delay it if necessary. I just wanted to stress that we are trying to maintain some "order" / "hierarchy" in our config.yml, and this PR doesn't really obey those current best practices.
See inline comments below. Thanks again!
|
Hi @tdonohue, many thanks for the review, much appreciated. Regarding the missing ORCID icon in submission, I think a config on the rest side was missing under authority.cfg: cris.ItemAuthority.AuthorAuthority.source = orcid Now it should be present also on the rest PR. I have also fixed the search results layout so that the authors are visible as before and correctly placed:
In addition I have improved the closing method so to clear the HTML reference on navigation, so that the flash on the page corner won't happen. |
|
Hi @MarieVerdonck , thanks for the feedback, I just checked the issue and is indeed caused by the update we did for ng-bootstrap: #4898 I have fixed it in this PR but I have also open a separated issue that I will address asap, as this issue is unrelated from this PR: #5169 |
…earch result layout, add search manager for search enrichment
tdonohue
left a comment
There was a problem hiding this comment.
@FrancescoMolinaro : I gave this another test today (with the backend PR). The prior bugs that I found in my first test from last week have all been resolved! Thanks!
However, the code review feedback that I also gave last week (in a separate review) is mostly unresolved. For example, I'm not seeing any of the accessibility improvements I suggested. (It looks like only around the first 5 requests were fixed, while the other 20+ have mostly not been solved yet.)
In my testing today, most everything is looking must better. However, I've also found a new bug that is appearing in SSR logs. Here's what I'm seeing:
- Start the frontend in production mode (npm run build:prod && npm run serve:ssr)
- Watch the SSR logs where you ran "npm run serve:ssr")
- Visit the homepage, and you'll see an immediate error in the SSR logs which looks like this:
ERROR ReferenceError: document is not defined
at new StickyPopoverDirective2 (C:\dspace-angular\dist\server\main.js:1:1673632)
at NodeInjectorFactory.ɵfac [as factory] (C:\dspace-angular\dist\server\main.js:1:1674926)
at getNodeInjectable (C:\dspace-angular\dist\server\main.js:1:3915934)
at instantiateAllDirectives (C:\dspace-angular\dist\server\main.js:1:3979403)
at createDirectivesInstances (C:\dspace-angular\dist\server\main.js:1:3979712)
at Object.ɵɵelementStart (C:\dspace-angular\dist\server\main.js:1:4131435)
at MetadataLinkViewComponent_ng_template_2_Template (C:\dspace-angular\dist\server\main.js:1:1676800)
at executeTemplate (C:\dspace-angular\dist\server\main.js:1:3978418)
at renderView (C:\dspace-angular\dist\server\main.js:1:3985607)
at createAndRenderEmbeddedLView (C:\dspace-angular\dist\server\main.js:1:3986989)
This SSR error appears to be referencing the MetadataLinkViewComponent which is newly added in this PR.
If you can find time to address my other prior feedback, I'd love to give this an updated review. As I'm sure you're aware, this is blocking several other merger PRs. I'd really like to see this PR (and the backend) merged soon to unblock everything else.
…ctive, add descriptions to code
|
Hi @tdonohue , thanks for the feedback and sorry if missed some of the comments, now I should have addressed all the remaining open points and the new issue with the SSR error. The issue was related to the window object being accessed in SSR inside StickyPopoverDirective, therefore I have adapted the logic so that it won't execute any rendering logic if not in the browser. I believe this should be ready for another review, thanks in advance for the help. |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thank you @FrancescoMolinaro ! I retested & re-reviewed this today, and all the prior bugs that I've reported are fixed. I can also verify my feedback has all been addressed in this PR. (That said, there's still feedback on the backend PR that needs addressing before I'm +1 on that as well)
This looks good to me now! I'd encourage other testers/reviewers (like @MarieVerdonck , @artlowel and @nwoodward ) to provide updated feedback soon. I'd really like to see this PR (and the backend) move forward as quickly as plausible in order to unblock all the other DSpace-CRIS merger PRs that depend on them.
artlowel
left a comment
There was a problem hiding this comment.
Thanks @FrancescoMolinaro!
I tested this again today and it looks good. I did find another potential issue in the code
| const sectionMetadata = this.sectionService.computeSectionConfiguredMetadata(this.formConfig); | ||
| this.sectionService.updateSectionData(this.submissionId, this.sectionData.id, sectionData, errorsToShow, serverValidationErrors, sectionMetadata); | ||
| // Add created model to formBulderService | ||
| this.formBuilderService.addFormModel(this.formId, this.formModel); |
There was a problem hiding this comment.
It looks like FormModels are added using this.formId as the identifier…
| ngOnDestroy(): void { | ||
| super.ngOnDestroy(); | ||
| // Remove this model from formBulderService | ||
| this.formBuilderService.removeFormModel(this.sectionData.id); |
There was a problem hiding this comment.
… and removed using this.sectionData.id as the identifier, which could be a memory leak.
I thought those IDs might be identical, but I tried logging them to the console, and I get something like this:
addFormModel 3_traditionalpagetwo
addFormModel 2_traditionalpageone
removeFormModel traditionalpageone
removeFormModel traditionalpagetwo
You'll probably want to use this.formId for the removal as well
|
Hi @artlowel , thanks for the feedback and the catch, you are absolutely right. |











References
Description
Initial port of the DSpace-CRIS authority framework into core DSpace, enabling real-time entity lookup, confidence-based linking, and automatic graph maintenance through server-side consumers.
On the UI this PR introduces a new way to link authorithy controlled metadata to the related item, generating a link in search results or item page, this connection is handled in submission. (for configuration check the rest PR)
Through a rest configuration, is possible also to activate an "auto-fill" functionality, that will populate the submission fields based on the selected value (value must be authority controlled).
Exaple of config in cris-authority-metadatagenerator.xml:
auto-fill.webm
The information of the related item are previewed via a new pop-up component enabled on hover, visible on both search results and item page:
In addition the PR introduce also multilanguage support for authority controlled vocabularies, to achieve this we need to have a vocabulary version for each language enabled by the property: webui.supported.locales
For instance if we have
webui.supported.locales = en, de
we can create a translated vocabulary (srsc_de in this example) and then configure the authority as follows (authority.cfg):
vocabulary.plugin.srsc.hierarchy.store = true
vocabulary.plugin.srsc.hierarchy.suggest = true
vocabulary.plugin.srsc.delimiter = "::"
vocabulary.plugin.authority.store = true
authority.controlled.dc.subject = true
This will enable to display the translated value in the UI, if the language matches the translated one:
EN:
DE:
This last feature will be consolidated later in the merger with the cust layout functionality from CRIS (at the moment this is not presente in the exact same way on CRIS as there we rely on the layout feature that is not yet in scope).
The implementation will remain anyway as it will be useful also as fallback for not configured layouts.
Instructions for Reviewers
Once the item relation is enstablished (submitted) the metadata will be linking to the related item, with a preview of metadata visible on link hover.
The new configuration for the pop-hover preview is available in default-app.config.ts, under the name:
metadataLinkViewPopoverData
It provides the opportunity to customize the preview metadata based on entity type.
In submission is possible also to configure specific icons for each source of authority, see config:
sourceIcons (under authority config)
In general for the newly added configuration you can refer to the config.example.yml file.
Once submitted, the authorithy controlled value should then result in a clickable link the search results (if the value is displayed) and in a clickable link in the item page (see images above).
Is possible to configure also auto-fill and generated metadata based on the authority (see descriptio or rest PR).
For the multilanguage support on vocabularies a translated vocabulary and submission form are needed, in addition to the properties based on the vocabulary name and metadata (see description).
List of changes in this PR:
Enhanced search results and item page with linkable related items (authority controlled)
Added new popover component for metadata preview on hover.
Implemented custom pipe for icon/info handling in onebox component.
Improved editing of authority via admin view, improved handling of search filters (filter by authorithy not value).
Implemented auto-fill functionality in submission.
Added support for multilanguage visualization of controlled vocabulary values in item page.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.