Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

use additonal metadata properties in smart handoffs

Jason Kent0288ea9f3826
diff --git a/tasks/buildOptions.sh b/tasks/buildOptions.sh
index 2162b0f56..a61dd1ca1 100755
--- a/tasks/buildOptions.sh
+++ b/tasks/buildOptions.sh
@@ -126,11 +126,11 @@ fi
# Get visualization metadata (if configured)
"$PYTHON_SCRIPTS_DIR/getVisMetadata.py" "$BUILD_DIR/features.json" \
- "$BUILD_DIR/config/wv.json/layerOrder.json" "$BUILD_DIR/config/wv.json/layer-metadata.json"
+ "$BUILD_DIR/config/wv.json/layerOrder.json" "$BUILD_DIR/config/wv.json/layerMetadata.json"
# Run getCollectionData.py to fetch collection metadata
-if [ -e "$BUILD_DIR/config/wv.json/layer-metadata.json" ] ; then
- "$PYTHON_SCRIPTS_DIR/getCollectionData.py" "$BUILD_DIR/config/wv.json/layer-metadata.json"
+if [ -e "$BUILD_DIR/config/wv.json/layerMetadata.json" ] ; then
+ "$PYTHON_SCRIPTS_DIR/getCollectionData.py" "$BUILD_DIR/config/wv.json/layerMetadata.json"
fi
# Run mergeConfig.py on all directories in /config
diff --git a/web/css/smart-handoff.css b/web/css/smart-handoff.css
index 5d581b801..e18d6f115 100644
--- a/web/css/smart-handoff.css
+++ b/web/css/smart-handoff.css
@@ -57,16 +57,17 @@
}
.smart-handoff-layer-list .layer-item {
- padding: 10px 15px;
+ padding: 5px;
.layer-title {
font-size: 14px;
+ line-height: 15px;
}
.layer-subtitle {
margin: 3px 0 8px;
color: #999;
}
.collection-choice {
- margin: 5px 5px 10px;
+ margin: 10px 5px 10px 15px;
input {
cursor: pointer;
top: 2px;
@@ -76,7 +77,7 @@
color: #eee;
cursor: pointer;
margin: 0 5px 0 7px;
- font-size: 12px;
+ font-size: 13px;
}
}
}
diff --git a/web/js/components/smart-handoffs/smart-handoff-modal.js b/web/js/components/smart-handoffs/smart-handoff-modal.js
index ebe248fdc..ba70fb085 100644
--- a/web/js/components/smart-handoffs/smart-handoff-modal.js
+++ b/web/js/components/smart-handoffs/smart-handoff-modal.js
@@ -17,7 +17,7 @@ function SmartHandoffModal({
// Hides Earthdata Search information by default
const [showMoreInfo, toggleInfo] = useState(false);
const { title, subtitle } = selectedLayer;
- const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${selectedCollection}.html`;
+ const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${selectedCollection.value}.html`;
return (
@@ -79,7 +79,7 @@ function SmartHandoffModal({
<div className="smart-handoff-layer-info row">
<div className="col">
- <h1> Selected layer: </h1>
+ <h1> Selected Worldview layer: </h1>
<p className="smart-handoff-layer-name">
{title}
</p>
@@ -94,9 +94,9 @@ function SmartHandoffModal({
</div>
<div className="col">
- <h1> Selected collection: </h1>
+ <h1> Collection details: </h1>
<a href={cmrSearchDetailURL} target="_blank" rel="noopener noreferrer">
- <p>{selectedCollection}</p>
+ <p>{`${selectedCollection.title}`}</p>
</a>
</div>
@@ -149,6 +149,7 @@ const hideModal = () => {
SmartHandoffModal.propTypes = {
continueToEDS: PropTypes.func,
displayDate: PropTypes.string,
+ selectedCollection: PropTypes.string,
selectedLayer: PropTypes.object,
};
diff --git a/web/js/components/smart-handoffs/util.js b/web/js/components/smart-handoffs/util.js
index eaa54d37e..caaf2d79f 100644
--- a/web/js/components/smart-handoffs/util.js
+++ b/web/js/components/smart-handoffs/util.js
@@ -23,8 +23,8 @@ export default function openEarthDataSearch(proj, selectedDate, selectedCollecti
const startDate = `${selectedDate}T00:00:00.000Z`;
const endDate = `${selectedDate}T23:59:59.999Z`;
const params = {
- q: selectedCollection,
- p: selectedCollection,
+ q: selectedCollection.value,
+ p: selectedCollection.value,
'[qt]': `${startDate},${endDate}`,
m: PROJ_CODES[proj],
'sb[0]': showBoundingBox ? `${southWest},${northEast}` : undefined,
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index 98399f48e..50c7a7729 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -6,6 +6,7 @@ import { debounce as lodashDebounce, get as lodashGet } from 'lodash';
import googleTagManager from 'googleTagManager';
import moment from 'moment';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { UncontrolledTooltip } from 'reactstrap';
import SmartHandoffModal from '../../components/smart-handoffs/smart-handoff-modal';
import Button from '../../components/util/button';
import Checkbox from '../../components/util/checkbox';
@@ -19,6 +20,11 @@ import getSelectedDate from '../../modules/date/selectors';
import safeLocalStorage from '../../util/local-storage';
import openEarthDataSearch from '../../components/smart-handoffs/util';
+const STD_NRT_MAP = {
+ STD: 'Standard',
+ NRT: 'Near Real-Time',
+};
+
/**
* The Smart-Handoff components replaces the existing data download capability
* by directing users to select specific layer products within Worldview and 'hand' them 'off'
@@ -267,7 +273,7 @@ class SmartHandoff extends Component {
const dateRange = `${startDate},${endDate}`;
const params = {
temporal: dateRange,
- collection_concept_id: selectedCollection,
+ collection_concept_id: selectedCollection.value,
include_facets: 'v2',
page_size: 0,
};
@@ -293,6 +299,26 @@ class SmartHandoff extends Component {
this.setState(newState);
}
+ renderCollectionTooltip = ({ value, title, type }) => {
+ const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${value}.html`;
+ return (
+ <UncontrolledTooltip
+ className="zot-tooltip"
+ boundariesElement="window"
+ target={`${util.encodeId(value)}-tooltp`}
+ placement="right"
+ trigger="hover"
+ autohide={false}
+ delay={{ show: 50, hide: 500 }}
+ >
+ <div>{title}</div>
+ <div>
+ <a href={cmrSearchDetailURL} target="_blank" rel="noreferrer"> View Details in CMR </a>
+ </div>
+ </UncontrolledTooltip>
+ );
+ }
+
/**
* Render radio buttons for layer selection
*/
@@ -308,22 +334,24 @@ class SmartHandoff extends Component {
<div className="layer-title">{layer.title}</div>
<div className="layer-subtitle">{layer.subtitle}</div>
- {layer.conceptIds.map(({ type, value }) => {
+ {layer.conceptIds.map((collection) => {
+ const {
+ type, value, version,
+ } = collection;
const inputId = `${util.encodeId(value)}-collection-choice`;
- const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${value}.html`;
+
return (
<div className="collection-choice" key={inputId}>
<input
id={inputId}
type="radio"
name="smart-handoff-layer-radio"
- checked={selectedCollection === value}
- onChange={() => this.onLayerChange(layer, value, currentExtent)}
+ checked={(selectedCollection || {}).value === value}
+ onChange={() => this.onLayerChange(layer, collection, currentExtent)}
/>
- <label htmlFor={inputId}>{`${type} - ${value}`}</label>
- <a href={cmrSearchDetailURL} target="_blank" rel="noreferrer">
- <FontAwesomeIcon icon="info-circle" />
- </a>
+ <label htmlFor={inputId}>{`${STD_NRT_MAP[type]} - v${version}`}</label>
+ <FontAwesomeIcon id={`${util.encodeId(value)}-tooltp`} icon="info-circle" />
+ {this.renderCollectionTooltip(collection)}
</div>
);
})}
@@ -566,7 +594,7 @@ const mapStateToProps = (state) => {
* @param {*} dispatch | A function of the Redux store that is triggered upon a change of state.
*/
const mapDispatchToProps = (dispatch) => ({
- showWarningModal: (displayDate, selectedLayer, continueToEDS) => {
+ showWarningModal: (displayDate, selectedLayer, selectedCollection, continueToEDS) => {
googleTagManager.pushEvent({
event: 'smart_handoffs_open_warning_modal',
});
@@ -578,6 +606,7 @@ const mapDispatchToProps = (dispatch) => ({
bodyComponentProps: {
displayDate,
selectedLayer,
+ selectedCollection,
continueToEDS,
},
size: 'lg',