diff --git a/CHANGELOG.md b/CHANGELOG.md index f4aff471..8dfec8fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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 + +- UI no longer throws an error if the STAC API does not support a queryables endpoint. + ## 5.1.0 - 2024-04-10 ### Added diff --git a/src/components/CloudSlider/CloudSlider.jsx b/src/components/CloudSlider/CloudSlider.jsx index 97694169..cf0dfbeb 100644 --- a/src/components/CloudSlider/CloudSlider.jsx +++ b/src/components/CloudSlider/CloudSlider.jsx @@ -26,7 +26,7 @@ const CloudSlider = () => { useEffect(() => { if (_selectedCollectionData) { const supportsCloudCover = - _selectedCollectionData.queryables['eo:cloud_cover'] + _selectedCollectionData.queryables?.['eo:cloud_cover'] if (supportsCloudCover) { setDisabled(!supportsCloudCover) dispatch(setShowCloudSlider(true)) diff --git a/src/utils/searchHelper.js b/src/utils/searchHelper.js index ad1d21bc..d2505917 100644 --- a/src/utils/searchHelper.js +++ b/src/utils/searchHelper.js @@ -122,13 +122,13 @@ function buildSearchScenesParams(gridCodeToSearchIn) { } const query = {} - if (_selectedCollection.queryables['eo:cloud_cover']) { + if (_selectedCollection.queryables?.['eo:cloud_cover']) { query['eo:cloud_cover'] = { gte: 0, lte: store.getState().mainSlice.cloudCover } } - if (_selectedCollection.queryables['sar:polarizations']) { + if (_selectedCollection.queryables?.['sar:polarizations']) { query['sar:polarizations'] = { in: ['VV', 'VH'] } } if (gridCodeToSearchIn) { @@ -208,13 +208,13 @@ function buildSearchAggregateParams(gridType) { } const query = {} - if (_selectedCollection.queryables['eo:cloud_cover']) { + if (_selectedCollection.queryables?.['eo:cloud_cover']) { query['eo:cloud_cover'] = { gte: 0, lte: store.getState().mainSlice.cloudCover } } - if (_selectedCollection.queryables['sar:polarizations']) { + if (_selectedCollection.queryables?.['sar:polarizations']) { query['sar:polarizations'] = { in: ['VV', 'VH'] } }