Skip to content

Commit

Permalink
Ontology field should only show descriptions of type ontology
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinvanschoren committed Jan 12, 2024
1 parent c87c21b commit 3a056b5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions server/src/client/app/src/pages/search/ItemDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,20 @@ export class FeatureDetail extends React.Component {
</TableCell>
<TableCell className={"itemDetail-small"}>
{this.props.item.descriptions ? this.props.item.descriptions.map((obj, index) => {
const url = new URL(obj.value);
const lastSegment = url.pathname.split('/').pop();
if (obj.type === 'ontology') {
const url = new URL(obj.value);
const lastSegment = url.pathname.split('/').pop();

return (
<span key={index}>
<a href={obj.value} target="_blank" rel="noopener noreferrer">
{lastSegment}
</a>
{index < this.props.item.descriptions.length - 1 ? ', ' : ''}
</span>
);
return (
<span key={index}>
<a href={obj.value} target="_blank" rel="noopener noreferrer">
{lastSegment}
</a>
{index < this.props.item.descriptions.length - 1 ? ', ' : ''}
</span>
);
}
return null;
}) : ""}
</TableCell>
</TableRow>
Expand Down

0 comments on commit 3a056b5

Please sign in to comment.