Interactive interface for browsing global, full-resolution satellite imagery
WIP: Determined best path forward to get current layer listing of what the user has selected. Beginning refactor period.
Stephan Wlodarczyk790f92cf8dc5
diff --git a/web/css/smart-handoff.css b/web/css/smart-handoff.cssindex a0b3f0273..ade42c56b 100644--- a/web/css/smart-handoff.css+++ b/web/css/smart-handoff.css@@ -1,40 +1,62 @@-/** Overrides default modal-content CSS */-#transferring-to-earthdata-search .modal-content {- background: #191a1b !important;- border: 1px solid #444 !important;-}--/** Overrides default modal-content CSS */-#transferring-to-earthdata-search .modal-header {- border-bottom: 1px solid #444 !important;-}--h1 {+/** Smart handoff side panel **/+#smart-handoff-side-panel h1 {margin-top: 10px;margin-left: 5px;color: gray;}+#smart-handoff-product-list {+ color: white;+}+#button-group {+ text-align: center;+}+#cancel-btn, #continue-btn {+ width: 200px;+ margin: 5px;+}+#download-btn {+ display: block;+ margin: 15px auto;+}+-#modal-heading {- text-align: right;+/** Overrides react image crop component **/+.ReactCrop {+ cursor: pointer !important;+ z-index: 0 !important;+}++/** Smart handoff modal */+#smart-handoff-heading {+ margin-bottom: 15px;+}+#smart-handoff-heading h1 {+ float: right;font-size: 14pt;+ line-height: 32px;color: #e94d19;- margin-bottom: 15px;}-+#smart-handoff-message {+ line-height: 1.25em;+ text-align: left;+ font-size: 12pt;+ color: #DDD;+}+#about-section {+ overflow-y: scroll;+ height: 175px;+}+#about-section p {+ color: #BBB;+ margin-bottom: 10px;+ margin-right: 5px;+}#about-heading {font-size: 9pt;color: #e94d19;- margin: 15px 0;-+ margin: 25px 0 10px 0;}--#download-btn {- display: block;- margin: 15px auto;-}-#layer-info {text-align: center;background: #535353;@@ -43,27 +65,33 @@ h1 {padding: 20px;margin: 25px 0;}-#layer-info h1 {font-size: 10pt;color: #AAA;margin: 0;margin-bottom: 0.5em;}--#button-group {+#toggle-more-info {+ margin-top: 25px;+ color: #777;+ font-size: 12pt;text-align: center;+ text-decoration: underline;+}+#toggle-more-info:hover {+ color: #e94d19;+ cursor: pointer;+ text-decoration: none;}-#cancel-btn, #continue-btn {- width: 200px;- margin: 5px;+/** Overrides the modal component styles */+#transferring-to-earthdata-search .modal-content {+ background: #191a1b !important;+ border: 1px solid #444 !important;+}+#transferring-to-earthdata-search .modal-header {+ border-bottom: 1px solid #444 !important;}-/** Override CSS rules for crop component **/-.ReactCrop {- cursor: pointer !important;- z-index: 0 !important;-}diff --git a/web/js/containers/sidebar/smart-handoff-modal.js b/web/js/containers/sidebar/smart-handoff-modal.jsindex 0add8575b..6cd65ad39 100644--- a/web/js/containers/sidebar/smart-handoff-modal.js+++ b/web/js/containers/sidebar/smart-handoff-modal.js@@ -1,4 +1,4 @@-import React from 'react';+import React, { useState } from 'react';import PropTypes from 'prop-types';import { connect } from 'react-redux';import Button from '../../components/util/button';@@ -10,41 +10,50 @@ import Button from '../../components/util/button';* layer data and granule files that are available for download.*/function SmartHandoffModal({ extentCoords, goToEarthDataSearch }) {+ // Hides Earthdata Search information by default+ const [showMoreInfo, toggleInfo] = useState(false);+return (<div>- <div id="modal-heading">+ <div id="smart-handoff-heading"><img src="../../../images/earth-data-search-logo.jpg" />- search.earthdata.nasa.gov+ <h1>search.earthdata.nasa.gov</h1></div>- <div id="modal-message">+ <div id="smart-handoff-message">You are about to be transferred to the NASA Earthdata Search tool. This tool is used to download- data granules using the currently selected layer, area of interest, and date.+ data granules using the selected layer, area of interest, and current date.</div>- <hr />-- <span>{extentCoords.southWest}</span>-- <div id="toggle-more-info">Show more</div>-- <h1 id="about-heading">About Earthdata Search</h1>-- <p>- Earthdata Search provides the only means for data discovery, filtering, visualization, and- access across all of NASA Earth science data holdings. Excepteur sint occaecat cupidatat non proident,- sunt in culpa qui officia deserunt mollit anim id est laborum.- </p>+ { showMoreInfo+ && (+ <div id="smart-handoff-about">+ <h1 id="about-heading">About Earthdata Search</h1>+ <div id="about-section">+ <p>+ Earthdata Search provides the only means for data discovery, filtering, visualization, and+ access across all of NASA Earth science data holdings. The current selected layer and the designated+ viewport region within Worldview will be transferred to Earthdata Search.+ </p>+ <p>+ More information to be documented later... Earthdata Search provides the only means for data discovery, filtering, visualization, and+ access across all of NASA Earth science data holdings. The current selected layer and the designated+ viewport region within Worldview will be transferred to Earthdata Search.+ </p>+ <p>+ More information to be documented later... Earthdata Search provides the only means for data discovery, filtering, visualization, and+ access across all of NASA Earth science data holdings. The current selected layer and the designated+ viewport region within Worldview will be transferred to Earthdata Search.+ </p>+ </div>+ </div>+ )}- <p>- The current selected layer and the designated viewport region within Worldview will be transferred to- Earthdata Search. At vero eostui noir benet accusamus et iusto odio dignissimos ducimus qui blanditiis- praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati- cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum- et dolorum fuga- </p>+ <div id="toggle-more-info" onClick={() => toggleInfo(!showMoreInfo)}>+ {showMoreInfo ? 'Hide Info' : 'Show More Info'}+ </div><div id="layer-info"><h1> Selected layer to download: </h1>@@ -73,7 +82,6 @@ function SmartHandoffModal({ extentCoords, goToEarthDataSearch }) {);}-/*** Handle type-checking of defined properties*/diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.jsindex 9c7aa2051..df368bed5 100644--- a/web/js/containers/sidebar/smart-handoff.js+++ b/web/js/containers/sidebar/smart-handoff.js@@ -72,11 +72,11 @@ class SmartHandoff extends Component {render() {const {isLayerSelected,- // products,map,screenWidth,screenHeight,proj,+ products,// selectedProduct,// selectProduct,isActive,@@ -114,28 +114,51 @@ class SmartHandoff extends Component {/** Contains available imagery data that can be downloaded in Earthdata Search */// const dataArray = Object.entries(products); // TO-DO: Display the correct products based on availablility+ const dataArray = Object.entries(products);+ // if (dataArray.length > 0 && !selectedProduct && isActive) {+ // findProductToSelect(activeLayers, selectedProduct);+ // } else if (selectedProduct && !doesSelectedExist(dataArray, selectedProduct)) {+ // findProductToSelect(activeLayers, selectedProduct);+ // }return (- <div>+ <div id="smart-handoff-panel"><h1>Select a layer to download:</h1>{ /** Listing of layers that are available to download via Earthdata Search */ }- <div id="wv-data">- <div className="wv-datalist sidebar-panel content">- <div id="wv-datacontent">- { /**- {dataArray.map((product, i) => (- <Products- key={product[0]}- id={product[0]}- productObject={product[1]}- isSelected={selectedProduct === product[0]}- selectProduct={selectProduct}- />- ))}- */}- </div>- </div>+ <div id="smart-handoff-product-list">+ {dataArray.map((product, i) => {+ if (!product[1].notSelectable) {+ return (+ <ul key={product[0]}>+ <li>+ Label:+ {' '}+ {product[1].items[0].label}+ </li>+ <li>+ Sub Label:+ {' '}+ {product[1].items[0].sublabel}+ </li>+ <li>+ Value:+ {' '}+ {product[1].items[0].value}+ </li>+ <li>+ Title:+ {' '}+ {product[1].title}+ </li>+ <li>{product[0]}</li>+ </ul>+ );+ }+ return (+ <div>Nothing to see here...</div>+ );+ })}</div>{ /** Download button that transfers user to NASA's Earthdata Search */ }@@ -186,6 +209,17 @@ const openEarthDataSearch = (extentCoords) => () => {// TO-DO: Need to capture boundaries, layer data, etc; whatever essentials for Earthdata Searchwindow.open(`https://search.earthdata.nasa.gov/search?sb=${extentCoords.southWest},${extentCoords.northEast}&m=-30.59375!-210.9375!0!1!0!0,2`, '_blank');++ /*+ https://search.earthdata.nasa.gov/search/granules?+ p=C1000001167-NSIDC_ECS+ &pg[0][qt]=2017-11-15T00%3A00%3A00.000Z%2C2017-11-15T23%3A59%3A59.999Z+ &pg[0][dnf]=DAY+ &sb=-156.69223022460938%2C54.284636794532624%2C-133.9395446777344%2C70.07726383377425+ &m=59.6953125!-179.015625!3!1!0!0%2C2+ &ff=Customizable+ &tl=1571168792!4!!+ */};/**@@ -194,9 +228,9 @@ const openEarthDataSearch = (extentCoords) => () => {SmartHandoff.propTypes = {isLayerSelected: PropTypes.bool,isActive: PropTypes.bool,- // products: PropTypes.object,- // selectedProduct: PropTypes.string,- // selectProduct: PropTypes.func,+ products: PropTypes.object,+ selectedProduct: PropTypes.string,+ selectProduct: PropTypes.func,map: PropTypes.object.isRequired,onBoundaryChange: PropTypes.func,boundaries: PropTypes.object,