Skip to content

Commit

Permalink
Make external link openable in separate tab by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewelinagr committed Jan 2, 2025
1 parent 5e4cee0 commit 7212381
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export const ReferringValue = ({property, entry}) => {
// External links should be represented by a direct link to the URI itself
// Other iri entities should be opened in the metadata editor
return property.isExternalLink ? (
<a href={entry.id}>{entry.id}</a>
<a href={entry.id} target="_blank" rel="noreferrer">
{entry.id}
</a>
) : (
<LinkedDataLink uri={entry.id}>{displayValue}</LinkedDataLink>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ describe('ReferringValue', () => {
property,
entry
})
).toEqual(<a href="https://thehyve.nl">https://thehyve.nl</a>);
).toEqual(
<a rel="noreferrer" target="_blank" href="https://thehyve.nl">
https://thehyve.nl
</a>
);
});

it('should render a generic iri resource as link to editor', () => {
Expand Down

0 comments on commit 7212381

Please sign in to comment.