Interactive interface for browsing global, full-resolution satellite imagery
update text. add close button to the alert. dismiss modal when user clicks 'try it!'
Jason Kent74cf2a5d1f38
diff --git a/web/js/components/feature-alert/alert.js b/web/js/components/feature-alert/alert.jsindex 449604480..dd37cb3b8 100644--- a/web/js/components/feature-alert/alert.js+++ b/web/js/components/feature-alert/alert.js@@ -9,24 +9,20 @@ import util from '../../util/util';class FeaturedAlert extends React.Component {constructor(props) {super(props);-let alertHasBeenShown;if (util.browser.localStorage) {alertHasBeenShown = localStorage.getItem('featured-alert:geostationary');}-this.state = {showAlert: !alertHasBeenShown};- this.readMore = this.readMore.bind(this);}- readMore() {+ dismissAlert() {if (util.browser.localStorage) {localStorage.setItem('featured-alert:geostationary', true);}this.setState({ showAlert: false });- this.props.showModal();}render() {@@ -36,7 +32,8 @@ class FeaturedAlert extends React.Component {<AlertUtilisOpen={showAlert}iconClassName='fa fa-layer-group fa-fw'- onClick={this.readMore}+ onClick={this.props.showModal.bind(this)}+ onDismiss={this.dismissAlert.bind(this)}message="Check out our new geostationary layers!"/></>@@ -52,6 +49,7 @@ const mapDispatchToProps = (dispatch) => ({backdrop: false,size: 'md',wrapClassName: 'clickable-behind-modal',+ clickableBehindModal: true,bodyComponent: GeostationaryModalBody}));diff --git a/web/js/components/feature-alert/geostationary-modal.js b/web/js/components/feature-alert/geostationary-modal.jsindex 6ef715260..dc5503216 100644--- a/web/js/components/feature-alert/geostationary-modal.js+++ b/web/js/components/feature-alert/geostationary-modal.js@@ -8,24 +8,45 @@ import {} from 'reactstrap';class GeostationaryModalBody extends React.Component {- render() {- const { prepareAnimate } = this.props;+ tryIt() {+ this.props.prepareAnimate();+ this.props.closeModal();+ }+ render() {return (<div className="compare-dialog">- <p>Our latest release includes new layers from geostationary satellites – GOES East, GOES West and Himawari-8. Find these new layers in the new “Featured” tab of the “Add Layers” menu.</p>-- <p>These geostationary layers are updated much more frequently than other imagery in Worldview. For example, the set of geostationary layers included in this release are updated every 10 minutes.</p>+ <p>+ Our latest release includes new layers from geostationary satellites –+ GOES East, GOES West and Himawari-8. Find these new layers in the new+ “Featured” tab of the “Add Layers” menu.+ </p>+ <p>+ These geostationary layers are updated much more frequently than+ other imagery in Worldview. For example, the set of geostationary+ layers included in this release are updated every 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 geostationary products+ are in the current list of overlays.+ </p>+ <p>+ For an optimal experience, set the time increment in the custom+ interval selector to 10 minute.+ </p>+ <p>+ The animation tool has also been updated to allow adjustments down to+ the hour and minute. Click below to set up an animation to see+ geostationary in action!+ </p>- <p>The time (and timescale) of the timeline can now be set down to the hour and minute whenever any geostationary products are in the current list of overlays.</p>-- <p>For an optimal experience, set the time increment in the custom interval selector to 10 minute.</p>-- <p>The animation tool has also been updated to allow adjustments down to the hours and minute. Click “Play” in the animation widget to see the geostationary imagery in action!</p><ButtonclassName="btn-lg btn-primary mx-auto w-100"- onClick={prepareAnimate}>Try it!+ onClick={this.tryIt.bind(this)}>+ Try it!</Button>+</div>);}@@ -46,7 +67,7 @@ const mapDispatchToProps = (dispatch) => ({'l=Reference_Labels,Reference_Features(hidden),Coastlines(hidden),GOES-East_ABI_Band2_Red_Visible,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&','t=2019-09-01-T20%3A00%3A41Z&','v=-84.25409131402579,21.881949559541848,-69.48846631402579,30.213980809541848&',- 'z=5&ics=true&ici=5&icd=10&t=2019-09-01-T20%3A00%3A41Z&',+ 'z=4&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, '');@@ -61,8 +82,6 @@ export default connect()(GeostationaryModalBody);GeostationaryModalBody.propTypes = {- addLayer: PropTypes.func,- openProducts: PropTypes.func,- prepareAnimate: PropTypes.func,- setTime: PropTypes.func+ closeModal: PropTypes.func,+ prepareAnimate: PropTypes.func};diff --git a/web/js/containers/modal.js b/web/js/containers/modal.jsindex ef28350b2..5acaf1491 100644--- a/web/js/containers/modal.js+++ b/web/js/containers/modal.js@@ -93,14 +93,15 @@ class ModalContainer extends Component {const style = this.getStyle(newProps);const lowerCaseId = lodashToLower(id);const BodyComponent = bodyComponent || '';+ const allowOuterClick = !isOpen || type === 'selection' || clickableBehindModal;+ const DraggableWrap = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;const toggleWithClose = () => {onToggle();if (onClose && isOpen) {onClose();}};- const DraggableWrap = ({ condition, wrapper, children }) =>- condition ? wrapper(children) : children;+if (isMobile && isOpen && desktopOnly) {toggleWithClose();}@@ -113,45 +114,39 @@ class ModalContainer extends Component {<ModalisOpen={isOpen}toggle={toggleWithClose}- backdrop={backdrop && type !== 'selection'}+ backdrop={backdrop}id={lowerCaseId}size={size}- className={- isTemplateModal- ? 'template-modal'- : modalClassName || 'default-modal'- }+ className={isTemplateModal ? 'template-modal' : modalClassName || 'default-modal'}autoFocus={autoFocus || false}style={style}wrapClassName={wrapClassName + ' ' + lowerCaseId}modalTransition={{ timeout: timeout || 100 }}>- {CompletelyCustomModal ? (- <CompletelyCustomModal {...customProps} />- ) : (- <DetectOuterClick- onClick={toggleWithClose}- disabled={!isOpen || type === 'selection' || clickableBehindModal}- >- {headerComponent || headerText ? (- <ModalHeader toggle={toggleWithClose}>- {headerComponent ? <headerComponent /> : headerText || ''}- </ModalHeader>- ) : (- ''- )}- <ModalBody>- {bodyHeader ? <h3>{bodyHeader}</h3> : ''}- {BodyComponent ? (- <BodyComponent {...bodyComponentProps} screenHeight={screenHeight} />- ) : isTemplateModal ? (- this.getTemplateBody()- ) : (- bodyText || ''+ {CompletelyCustomModal+ ? (<CompletelyCustomModal {...customProps} />)+ : (+ <DetectOuterClick+ onClick={toggleWithClose}+ disabled={allowOuterClick}+ >+ {(headerComponent || headerText) && (+ <ModalHeader toggle={toggleWithClose}>+ {headerComponent ? <headerComponent /> : headerText || ''}+ </ModalHeader>)}- </ModalBody>- </DetectOuterClick>- )}+ <ModalBody>+ {bodyHeader && <h3>{bodyHeader}</h3>}+ {BodyComponent+ ? (+ <BodyComponent {...bodyComponentProps}+ screenHeight={screenHeight}+ closeModal={toggleWithClose}/>+ )+ : isTemplateModal ? this.getTemplateBody() : bodyText || ''}+ </ModalBody>+ </DetectOuterClick>+ )}</Modal></DraggableWrap></ErrorBoundary>diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.jsindex 9f2bd4273..14fe4ded1 100644--- a/web/js/containers/toolbar.js+++ b/web/js/containers/toolbar.js@@ -31,7 +31,7 @@ const CUSTOM_MODAL_PROPS = {headerText: null,type: 'toolbar',modalClassName: 'toolbar-list-modal toolbar-projection-modal toolbar-modal',- backdrop: true,+ backdrop: false,bodyComponent: Projection,wrapClassName: 'toolbar_modal_outer toolbar_modal_outer'},