Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

filter data available layers to show available based on date coverage, expand modal msg to reflect, add e2e

Ed Platodd382aa6f16f
diff --git a/e2e/features/smart-handoff/smart-handoff-test.js b/e2e/features/smart-handoff/smart-handoff-test.js
index b877dbf73..3dc657df4 100644
--- a/e2e/features/smart-handoff/smart-handoff-test.js
+++ b/e2e/features/smart-handoff/smart-handoff-test.js
@@ -14,7 +14,7 @@ const cloudRadiusRadioButton = '#C1443536017-LAADS-MODIS_Aqua_Cloud_Effective_Ra
const SSTRadioButton = '#C1664741463-PODAAC-GHRSST_L4_MUR_Sea_Surface_Temperature-collection-choice-label';
const urlParams = '?l=Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m&t=2019-12-01';
const permalinkParams = '?l=GHRSST_L4_MUR_Sea_Surface_Temperature,MODIS_Aqua_Aerosol_Optical_Depth_3km&lg=true&sh=MODIS_Aqua_Aerosol_Optical_Depth_3km,C1443528505-LAADS&t=2020-02-06-T06%3A00%3A00Z';
-
+const permalinkParams1980 = '?l=GHRSST_L4_MUR_Sea_Surface_Temperature,MODIS_Aqua_Aerosol_Optical_Depth_3km&lg=true&sh=MODIS_Aqua_Aerosol_Optical_Depth_3km,C1443528505-LAADS&t=1980-02-06-T06%3A00%3A00Z';
module.exports = {
@@ -97,6 +97,14 @@ module.exports = {
c.assert.urlContains('&sh=GHRSST_L4_MUR_Sea_Surface_Temperature,C1664741463-PODAAC');
},
+ 'Layers outside of their coverage date range are hidden from layers available for download': (c) => {
+ c.url(c.globals.url + permalinkParams1980);
+ c.expect.element(dataTabButton).to.be.visible;
+ c.expect
+ .element('.smart-handoff-side-panel > h1')
+ .to.have.text.equal('None of your current layers are available for download.');
+ },
+
after(c) {
c.end();
},
diff --git a/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js b/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
index ed7233532..44b5524b8 100644
--- a/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
+++ b/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
@@ -5,7 +5,11 @@ export default function SmartHandoffNotAvailableModal() {
<div className="basic-modal">
<h1>Why are some layers not available for download?</h1>
<p>
- Some layers in Worldview do not have corresponding source data products available for download.
+ Data will not be available on dates outside of each layers respective coverage date range.
+ These layers will be hidden from the layers available to download.
+ </p>
+ <p>
+ In addition, some layers in Worldview do not have corresponding source data products available for download.
These include Geostationary, Reference, Orbit Tracks, Earth at Night, and MODIS Corrected Reflectance products.
</p>
<p>
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index c17f3c93d..620e12899 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -18,7 +18,7 @@ import GranuleAlertModalBody from '../../components/smart-handoffs/smart-handoff
import GranuleCount from '../../components/smart-handoffs/granule-count';
import { imageUtilGetCoordsFromPixelValues } from '../../modules/image-download/util';
import { onClose, openCustomContent } from '../../modules/modal/actions';
-import { getActiveLayers } from '../../modules/layers/selectors';
+import { memoizedAvailable as availableSelector, getActiveLayers } from '../../modules/layers/selectors';
import { getSelectedDate } from '../../modules/date/selectors';
import safeLocalStorage from '../../util/local-storage';
import openEarthDataSearch from '../../components/smart-handoffs/util';
@@ -518,9 +518,12 @@ const mapStateToProps = (state) => {
const selectedDateFormatted = moment.utc(selectedDate).format('YYYY-MM-DD'); // 2020-01-01
const displayDate = moment.utc(selectedDate).format('YYYY MMM DD'); // 2020 JAN 01
const filterForSmartHandoff = (layer) => {
- const { projections, disableSmartHandoff, conceptIds } = layer;
+ const {
+ id, projections, disableSmartHandoff, conceptIds,
+ } = layer;
+ const isAvailable = availableSelector(state)(id);
const filteredConceptIds = (conceptIds || []).filter(({ type, value, version }) => type && value && version);
- return projections[proj.id] && !disableSmartHandoff && !!filteredConceptIds.length;
+ return isAvailable && projections[proj.id] && !disableSmartHandoff && !!filteredConceptIds.length;
};
const availableLayers = getActiveLayers(state).filter(filterForSmartHandoff);