153 ror shared helper#159
Merged
Merged
Conversation
…eativework.publisher Follow-up cleanup on the ROR publisher support (PR #153): - Add buildAuthoritySearchFilter() in clarin-shared-util.ts and use it from getLinkToSearch (generic item field), the search-result box view, and loadItemAuthors, so the authority-vs-equals operator logic lives in one place. - Drop creativework.publisher from the CLARIN item view (untyped-item fields, the ROR icon condition and convertMetadataFieldIntoSearchType) so the item page and the search card agree on dc.publisher. Journal entity pages, which use the upstream ds-generic-item-page-field, are unaffected. - Add a clarin-generic-item-field spec covering getLinkToSearch branches and a unit test for the new helper.
There was a problem hiding this comment.
Pull request overview
This PR extracts repeated “authority vs equals” search-filter construction logic into a shared helper and updates components to use it, with accompanying unit tests to validate the new behavior.
Changes:
- Added
buildAuthoritySearchFilterhelper to centralize discovery filter query fragment generation (authority-aware). - Refactored author/publisher search-link creation to use the helper.
- Added unit tests for the helper and for
ClarinGenericItemFieldComponent.getLinkToSearch.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/clarin-shared-util.ts | Introduces buildAuthoritySearchFilter and reuses it for author search links. |
| src/app/shared/clarin-shared-util.spec.ts | Adds unit coverage for buildAuthoritySearchFilter and convertMetadataFieldIntoSearchType. |
| src/app/shared/clarin-item-box-view/clarin-item-box-view.component.ts | Switches publisher search-link building to the shared helper and broadens publisher metadata lookup. |
| src/app/shared/clarin-item-box-view/clarin-item-box-view.component.html | Simplifies publisher link rendering (but currently introduces an async-initialization link issue). |
| src/app/item-page/simple/field-components/clarin-generic-item-field/clarin-generic-item-field.component.ts | Refactors search link creation to use the shared helper and handle explicit-value searches. |
| src/app/item-page/simple/field-components/clarin-generic-item-field/clarin-generic-item-field.component.spec.ts | Adds unit tests for authority vs equals link generation and edge cases. |
| <div *ngIf="isSearchResult" class="pt-1"> | ||
| <div class="font-weight-bold">{{ 'item.view.box.publisher.message' | translate }}</div> | ||
| <span>(<span *ngIf="itemPublisher != null"><a *ngIf="publisherRedirectLink" [href]="publisherRedirectLink">{{itemPublisher}} <img *ngIf="hasPublisherRorAuthority" src="assets/images/ror-icon.svg" alt="ROR ID" height="16" class="ml-1 align-middle"></a><span *ngIf="!publisherRedirectLink">{{itemPublisher}}</span> / </span>{{itemDate}})</span> | ||
| <span>(<span *ngIf="itemPublisher != null"><a [href]="publisherRedirectLink">{{itemPublisher}} <img *ngIf="hasPublisherRorAuthority" src="assets/images/ror-icon.svg" alt="ROR ID" height="16" class="ror-icon ml-1 align-middle"></a> / </span>{{itemDate}})</span> |
amadulhaxxani
approved these changes
Jun 30, 2026
Use [attr.href] instead of [href] so Angular omits the attribute while publisherRedirectLink is still undefined (before assignBaseUrl resolves), rendering the publisher as plain text until the URL is ready.
f1386ca
into
151-support-for-ror-identifiers
7 of 9 checks passed
kosarko
added a commit
that referenced
this pull request
Jul 1, 2026
* fix(item-view): use authority value for publisher search links (ROR) fix(item-view): use authority value for publisher search links (ROR) * fix(search-results): use authority value for publisher links on result cards fix(search-results): use authority value for publisher links on result cards * feat(ror): add ROR icon to publisher links on item view and search cards feat(ror): add ROR icon to publisher links on item view and search cards * fix(ror-itempage-search-results): put the image in the publisher redirect fix(ror-itempage-search-results): put the image in the publisher redirect * fix(ror-icon): add icon in the item page fix(ror-icon): add icon in the item page * fix(lint): remove redundant type annotation for hasPublisherAuthority fix(lint): remove redundant type annotation for hasPublisherAuthority * feat(ror): add ROR icon and authority-based publisher search links feat(ror): add ROR icon and authority-based publisher search links * 153 ror shared helper (#159) * refactor(ror): extract shared authority search-filter helper, drop creativework.publisher Follow-up cleanup on the ROR publisher support (PR #153): - Add buildAuthoritySearchFilter() in clarin-shared-util.ts and use it from getLinkToSearch (generic item field), the search-result box view, and loadItemAuthors, so the authority-vs-equals operator logic lives in one place. - Drop creativework.publisher from the CLARIN item view (untyped-item fields, the ROR icon condition and convertMetadataFieldIntoSearchType) so the item page and the search card agree on dc.publisher. Journal entity pages, which use the upstream ds-generic-item-page-field, are unaffected. - Add a clarin-generic-item-field spec covering getLinkToSearch branches and a unit test for the new helper. * don't remove the creativework.publisher * Avoid transient broken publisher href during async base-URL fetch Use [attr.href] instead of [href] so Angular omits the attribute while publisherRedirectLink is still undefined (before assignBaseUrl resolves), rendering the publisher as plain text until the URL is ready. --------- Co-authored-by: Ondřej Košarko <kosarko@ufal.mff.cuni.cz>
milanmajchrak
pushed a commit
to dataquest-dev/dspace-angular
that referenced
this pull request
Jul 2, 2026
* 151 support for ror identifiers (ufal#153) * fix(item-view): use authority value for publisher search links (ROR) fix(item-view): use authority value for publisher search links (ROR) * fix(search-results): use authority value for publisher links on result cards fix(search-results): use authority value for publisher links on result cards * feat(ror): add ROR icon to publisher links on item view and search cards feat(ror): add ROR icon to publisher links on item view and search cards * fix(ror-itempage-search-results): put the image in the publisher redirect fix(ror-itempage-search-results): put the image in the publisher redirect * fix(ror-icon): add icon in the item page fix(ror-icon): add icon in the item page * fix(lint): remove redundant type annotation for hasPublisherAuthority fix(lint): remove redundant type annotation for hasPublisherAuthority * feat(ror): add ROR icon and authority-based publisher search links feat(ror): add ROR icon and authority-based publisher search links * 153 ror shared helper (ufal#159) * refactor(ror): extract shared authority search-filter helper, drop creativework.publisher Follow-up cleanup on the ROR publisher support (PR ufal#153): - Add buildAuthoritySearchFilter() in clarin-shared-util.ts and use it from getLinkToSearch (generic item field), the search-result box view, and loadItemAuthors, so the authority-vs-equals operator logic lives in one place. - Drop creativework.publisher from the CLARIN item view (untyped-item fields, the ROR icon condition and convertMetadataFieldIntoSearchType) so the item page and the search card agree on dc.publisher. Journal entity pages, which use the upstream ds-generic-item-page-field, are unaffected. - Add a clarin-generic-item-field spec covering getLinkToSearch branches and a unit test for the new helper. * don't remove the creativework.publisher * Avoid transient broken publisher href during async base-URL fetch Use [attr.href] instead of [href] so Angular omits the attribute while publisherRedirectLink is still undefined (before assignBaseUrl resolves), rendering the publisher as plain text until the URL is ready. --------- Co-authored-by: Ondřej Košarko <kosarko@ufal.mff.cuni.cz> (cherry picked from commit 5bab4f1) * fix: prevent undefined value in authority search filter encoding --------- Co-authored-by: Amad Ul Hassan <hassan@ufal.mff.cuni.cz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extracted the repeated code to a helper method
autogenerated tests