Skip to content

Commit

Permalink
find self link by rel for STAC API Item link href (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner authored May 7, 2024
1 parent bf765ac commit 4b363b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## unreleased

### Fixed

- STAC API Item link used the first link in the links array, instead of looking
up the "self" relation link by "rel" value

## 5.1.0 - 2024-04-10

### Added
Expand Down
4 changes: 3 additions & 1 deletion src/components/PopupResult/PopupResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const PopupResult = (props) => {
{_appConfig.STAC_LINK_ENABLED && (
<div className="detailRow">
<a
href={props.result.links[0].href.toString()}
href={props.result?.links
?.find((x) => x?.rel === 'self')
?.href?.toString()}
target="_blank"
rel="noreferrer"
className="popupResultDetailsRowValue popupResultDetailsHrefLink"
Expand Down

0 comments on commit 4b363b3

Please sign in to comment.