MENDELU/Convert full item metadata to hyperlinks#1246
Open
jr-rk wants to merge 5 commits intocustomer/mendelufrom
Open
MENDELU/Convert full item metadata to hyperlinks#1246jr-rk wants to merge 5 commits intocustomer/mendelufrom
jr-rk wants to merge 5 commits intocustomer/mendelufrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the full item view to render URL-like metadata values as clickable hyperlinks, improving usability when metadata contains resolvable links (e.g., handle URLs).
Changes:
- Added an
isUrlhelper onFullItemPageComponentto detect http(s) URLs. - Updated the full item metadata table to render detected URLs as
<a>links (new tab +noopener noreferrer). - Added unit tests covering URL detection and link rendering behavior in the metadata table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/app/item-page/full/full-item-page.component.ts | Introduces isUrl helper used by the template to decide link vs. plain text rendering. |
| src/app/item-page/full/full-item-page.component.html | Renders metadata values as <a> when isUrl(...) returns true. |
| src/app/item-page/full/full-item-page.component.spec.ts | Adds tests for isUrl and verifies URL values render as clickable links in the metadata table. |
…lize input with trim/lowercase
Comment on lines
+122
to
+128
| /** | ||
| * Check if a metadata value is an HTTP(S) URL. | ||
| */ | ||
| isHttpUrl(value: string | null | undefined): boolean { | ||
| const v = value?.trim().toLowerCase(); | ||
| return !!v && (v.startsWith('http://') || v.startsWith('https://')); | ||
| } |
There was a problem hiding this comment.
This introduces a second, slightly different HTTP(S) URL detection implementation compared to MetadataRepresentationListElementComponent.isLink() (regex-based). Consider centralizing URL detection in a shared util/pipe so future tweaks (e.g., trimming, stricter validation) stay consistent across the UI.
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.
Problem description
Copilot review