Interactive interface for browsing global, full-resolution satellite imagery
add alert for new geostationary features
Jason Kent748e0c934703
diff --git a/web/images/geostationary/animation.png b/web/images/geostationary/animation.pngnew file mode 100644index 000000000..0f5da667aBinary files /dev/null and b/web/images/geostationary/animation.png differdiff --git a/web/images/geostationary/featured.png b/web/images/geostationary/featured.pngnew file mode 100644index 000000000..3a352f47fBinary files /dev/null and b/web/images/geostationary/featured.png differdiff --git a/web/images/geostationary/timeline.png b/web/images/geostationary/timeline.pngnew file mode 100644index 000000000..e7ad7e5c1Binary files /dev/null and b/web/images/geostationary/timeline.png differdiff --git a/web/js/app.js b/web/js/app.jsindex d84775cfc..b2f23bf16 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -15,6 +15,7 @@ import Modal from './containers/modal';// Otherimport Brand from './brand';import MeasureButton from './components/measure-tool/measure-button';+import FeatureAlert from './components/feature-alert/alert';// actionsimport { calculateResponsiveState } from 'redux-responsive';@@ -103,6 +104,7 @@ class App extends React.Component {return (<div className="wv-content" id="wv-content" data-role="content"><Toolbar />+ <FeatureAlert /><Sidebar />{isTourActive ? <Tour /> : null}<div id="layer-modal" className="layer-modal" />diff --git a/web/js/components/feature-alert/alert.js b/web/js/components/feature-alert/alert.jsnew file mode 100644index 000000000..edb42ebd6--- /dev/null+++ b/web/js/components/feature-alert/alert.js@@ -0,0 +1,70 @@+import React from 'react';+import { connect } from 'react-redux';+import PropTypes from 'prop-types';+import { openCustomContent } from '../../modules/modal/actions';+import GeostationaryModalBody from './geostationary-modal';+import AlertUtil from '../util/alert';+import util from '../../util/util';++class FeaturedAlert extends React.Component {+ constructor(props) {+ super(props);+ this.state = {+ showAlert: true+ };+ this.dismissAlert = this.dismissAlert.bind(this);++ if (util.browser.localStorage) {+ // const hideAlertTime = localStorage.getItem('featured-alert');+ }+ }++ dismissAlert() {+ if (util.browser.localStorage) {+ localStorage.setItem('featured-alert', new Date());+ }+ this.setState({ showAlert: false });+ }++ render() {+ const { showAlert } = this.state;+ return (+ <>+ <AlertUtil+ isOpen={showAlert}+ iconClassName='fa fa-layer-group fa-fw'+ onClick={this.props.showModal.bind(this)}+ // TODO consider hiding the close button if no onDismiss prop supplied+ onDismiss={this.dismissAlert}+ message="Check out our new geostationary layers!"+ />+ </>+ );+ }+}++const mapDispatchToProps = (dispatch) => ({+ showModal: () => {+ dispatch(+ openCustomContent('geostationary_info', {+ headerText: 'New - Geostationary Layers',+ backdrop: false,+ size: 'lg',+ wrapClassName: 'clickable-behind-modal',+ bodyComponent: GeostationaryModalBody,+ desktopOnly: true,+ isDraggable: true+ })+ );+ }+});++FeaturedAlert.propTypes = {+ buildDate: PropTypes.number,+ showModal: PropTypes.func+};++export default connect(+ null,+ mapDispatchToProps+)(FeaturedAlert);diff --git a/web/js/components/feature-alert/geostationary-modal.js b/web/js/components/feature-alert/geostationary-modal.jsnew file mode 100644index 000000000..ce3d1ca94--- /dev/null+++ b/web/js/components/feature-alert/geostationary-modal.js@@ -0,0 +1,112 @@+import React from 'react';+import { connect } from 'react-redux';+import PropTypes from 'prop-types';+import { history } from '../../main';+import update from 'immutability-helper';+import { Button } from 'reactstrap';++class GeostationaryModalBody extends React.Component {+ render() {+ const { addLayer, setTime, prepareAnimate } = this.props;++ return (+ <div className="compare-dialog">+ <p>How to get started?</p>+ <ul>++ <li className="compare-dialog-list-item">+ <img src="images/geostationary/featured.png" />+ <p>+ Our latest release includes a number of new layers for geostationary products. These new layers+ can be found in the new "Featured" tab of the "Add Layers" menu.+ </p>+ <p>+ To jump right in, <a href="#" onClick={addLayer}>click here to add a geostationary layer</a> to the+ currently active overlays.+ </p>+ </li>++ <li className="compare-dialog-list-item">+ <p>Geostationary products are updated more frequently than others. For example, the+ set of geostationary layers included in this release are updated in increments of 10 minutes. </p>+ <p>To take full advantage of this, the time and timescale of the timeline can now be set+ down to the hour and minute whenever any geostatinary products are in+ the current list of overlays. </p>+ <p> For an optimal experience, <a href="#" onClick={setTime}>click here to set a custom interval </a>+ to match the GOES East Red Visible layer's interval time of 10 minutes.</p>+ <img src="images/geostationary/timeline.png" />+ </li>++ <li className="compare-dialog-list-item">+ <img src="images/geostationary/animation.png" />+ <p>Of course, the animation tool has also been updated to allow adjustments down to the hours and minutes as well.+ Click the play button to see geostationary in action!+ </p>+ <Button+ className="btn-sm btn-primary"+ onClick={prepareAnimate}>Try it!+ </Button>+ </li>++ </ul>+ </div>+ );+ }+}++const getLocation = (search) => {+ search = search.split('/?').pop();+ const location = update(history.location, {+ search: { $set: search }+ });+ return location;+};++const mapDispatchToProps = (dispatch) => ({+ addLayer: () => {+ const paramArr = [+ 'p=geographic&',+ 'l=GOES-East_ABI_Band2_Red_Visible,Reference_Labels(hidden),Reference_Features(hidden),Coastlines,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&',+ 't=2019-09-01-T20%3A00%3A41Z'+ ];+ const urlParams = paramArr.reduce((prev, curr) => prev + curr, '');+ const location = getLocation(urlParams);+ dispatch({ type: 'REDUX-LOCATION-POP-ACTION', payload: location });+ },+ setTime: () => {+ const paramArr = [+ 'p=geographic&',+ 'l=GOES-East_ABI_Band2_Red_Visible,Reference_Labels(hidden),Reference_Features(hidden),Coastlines,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&',+ 't=2019-09-01-T20%3A00%3A41Z&',+ 'z=5&ics=true&ici=5&icd=10&t=2019-09-01-T20%3A00%3A41Z'+ ];+ const urlParams = paramArr.reduce((prev, curr) => prev + curr, '');+ const location = getLocation(urlParams);+ dispatch({ type: 'REDUX-LOCATION-POP-ACTION', payload: location });+ },+ prepareAnimate: () => {+ const paramArr = [+ 'p=geographic&',+ 'l=GOES-East_ABI_Band2_Red_Visible,Reference_Labels(hidden),Reference_Features(hidden),Coastlines,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&',+ 't=2019-09-01-T20%3A00%3A41Z&',+ 'v=-86.93586254108634,22.191846804617647,-70.13996410358634,33.95161242961765&',+ 'z=5&ics=true&ici=5&icd=10&t=2019-09-01-T20%3A00%3A41Z&',+ 'ab=on&as=2019-09-01-T16%3A00%3A00Z&ae=2019-09-01-T21%3A00%3A00Z&al=true'+ ];+ const urlParams = paramArr.reduce((prev, curr) => prev + curr, '');+ const location = getLocation(urlParams);+ dispatch({ type: 'REDUX-LOCATION-POP-ACTION', payload: location });+ }+});++export default connect(+ null,+ mapDispatchToProps+)(GeostationaryModalBody);++GeostationaryModalBody.propTypes = {+ addLayer: PropTypes.func,+ openProducts: PropTypes.func,+ prepareAnimate: PropTypes.func,+ setTime: PropTypes.func+};diff --git a/web/js/components/util/alert.js b/web/js/components/util/alert.jsindex 9d6d796c5..aa2537610 100644--- a/web/js/components/util/alert.js+++ b/web/js/components/util/alert.js@@ -6,7 +6,7 @@ import { Portal } from 'react-portal';* A react component, Builds a rather specific* interactive widget*- * @class OpacitySlider+ * @class AlertComponent* @extends React.Component*/export default class AlertComponent extends React.Component {