Interactive interface for browsing global, full-resolution satellite imagery
various tweaks and updates
Jason Kent3646060fd050
diff --git a/web/css/event-filter.css b/web/css/event-filter.cssnew file mode 100644index 000000000..a1f2c9ddd--- /dev/null+++ b/web/css/event-filter.css@@ -0,0 +1,142 @@+.filter-controls {+ background: #333;+ padding: 5px;+ border-bottom: 1px solid #666;+ .filter-dates-icons {+ display: inline-block;+ max-width: 224px;+ width: 224px;+ }+ .filter-dates {+ color: #fff;+ font-family: 'Roboto Mono';+ text-align: center;+ padding: 3px 5px 6px;+ font-size: 14px;+ }+ .filter-icons {+ margin-left: 6px;+ justify-content: center;+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(10px, max-content));+ max-width: 205px;+ max-height: 32px;+ }+ .filter-button {+ width: 40px;+ margin: 5px;+ height: 40px;+ display: inline-block;+ vertical-align: top;+ }+}++.event-filter-modal {+ width: 315px;+}++.events-filter {+ .react-daterange-picker__inputGroup__input:invalid {+ background: rgba(255, 0, 0, 0.3);+ }+ .react-daterange-picker {+ margin: 4px auto;+ width: 272px;+ text-align: center;+ input,+ .react-daterange-picker__inputGroup__leadingZero,+ .react-daterange-picker__inputGroup__month {+ color: #fff;+ font-family: 'Roboto Mono', monospace;+ font-size: 16px;+ }+ span {+ font-size: 16px;+ }+ .react-daterange-picker__range-divider {+ margin: 0 4px;+ font-size: 12px;+ }+ .react-date-picker__inputGroup__divider {+ margin-right: 2px;+ }+ svg {+ stroke: #fff;+ &:hover {+ stroke: #007bff;+ }+ }+ }+ .category-toggles {+ margin: 14px 10px 15px;+ }+ .wv-checkbox {+ margin-left: 10px;+ }+}++.event-count {+ color: #fff;+ text-align: center;+ padding: 10px 0;+ width: 284px;+ margin: 0 auto;+ border-top: 1px solid #666;+ background: #333;+ font-size: 15px;+ svg {+ margin-left: 6px;+ }+}++.react-calendar {+ color: #000;+ border-radius: 6px;+ padding: 3px;+ box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.75);+ max-width: unset;+ background: #eee;+ .react-calendar__month-view {+ background: #fefefe;+ border-radius: 6px;+ border: 1px solid #ddd;+ }+ .react-calendar__month-view__days__day--weekend {+ color: #000;+ }+ .react-calendar__navigation__label__labelText--from {+ margin-right: 100px;+ }+ .react-calendar__navigation__label__labelText--to {+ margin-left: 100px;+ }+ .react-calendar__navigation {+ button {+ min-width: 44px;+ border: 1px solid #ddd;+ border-radius: 6px;+ margin: 2px;+ font-size: 23px;+ background: #fff;+ &:hover {+ background: #e7eeff;+ }+ }+ button.react-calendar__navigation__label {+ background: #fff;+ &:hover {+ background: #e7eeff;+ }+ }+ }+ .react-calendar__year-view__months {+ background: #fff;+ }+ .react-calendar__tile:hover {+ background-color: #e7eeff;+ }+ .react-calendar__tile--active:hover {+ color: #fff;+ background: #006edc;+ }+}diff --git a/web/css/events.css b/web/css/events.cssindex 0e1f31891..86787e6bb 100644--- a/web/css/events.css+++ b/web/css/events.css@@ -363,88 +363,3 @@padding-top: 5px;border-top: 0.5px solid rgba(250, 250, 250, 0.5);}--.filter-controls {- background: #333;- padding: 5px;- border-bottom: 1px solid #666;- border-top: 1px solid #666;- & .filter-dates-icons {- display: inline-block;- max-width: 224px;- width: 224px;- }- & .filter-dates {- color: #fff;- font-family: 'Roboto Mono';- text-align: center;- padding: 3px 5px 6px;- font-size: 14px;- }- & .filter-icons {- margin-left: 6px;- justify-content: center;- display: grid;- grid-template-columns: repeat(auto-fit, minmax(10px, max-content));- max-width: 205px;- max-height: 32px;- }- & .filter-button {- width: 40px;- margin: 5px;- height: 40px;- display: inline-block;- vertical-align: top;- }- & .event-count {- color: #fff;- text-align: center;- padding: 5px 0;- width: 224px;- & svg {- margin-left: 6px;- }- }-}--.events-filter {- & .react-daterange-picker__inputGroup__input:invalid {- background: rgba(255, 0, 0, 0.3);- }- & .react-daterange-picker {- margin: 4px auto;- width: 272px;- text-align: center;- & input {- color: #fff;- font-family: 'Roboto Mono', monospace;- font-size: 16px;- }- & span {- font-size: 16px;- }- .react-date-picker__inputGroup__divider {- margin-right: 2px;- }- & svg {- stroke: #fff;- &:hover {- stroke: #007bff;- }- }- }- & .category-toggles {- margin: 14px 10px 0;- }-}--.react-calendar {- color: #000;- border-radius: 6px;- padding: 3px;- box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.75);- max-width: unset;- .react-calendar__month-view__days__day--weekend {- color: #000;- }-}diff --git a/web/css/sidebar.css b/web/css/sidebar.cssindex f6593fe0a..bb60d53ac 100644--- a/web/css/sidebar.css+++ b/web/css/sidebar.css@@ -402,25 +402,39 @@ footer .compare-toggle-button {color: #22a;}-.modal-dialog.layer-settings-modal {- background: #282828;- width: 300px;- color: #eee;-}+/* Sidear Modal Styles */+.sidebar-modal {+ margin-left: auto;+ margin-right: auto;+ top: 0;+ left: 298px;+ right: auto;+ bottom: auto;+ border-radius: 6px;+ position: absolute;-.layer-info-settings-modal .modal-header .close,-.layer-settings-modal .modal-header .close {- font-size: 22px;- padding: 12px 14px;+ .wv-label {+ color: #fff;+ width: 100%;+ position: relative;+ }++ .wv-header {+ font-size: 14px;+ margin-bottom: 8px;+ }++ .wv-header.wv-color-palette-label {+ margin-bottom: 0.5em;+ }}-.layer-info-settings-modal .modal-title,-.layer-settings-modal .modal-title {- font-size: 14px;- font-weight: 600;+.layer-info-modal {+ width: 500px;}.layer-settings-modal {+ width: 300px;.nav-tabs {border-bottom: none;}@@ -455,103 +469,71 @@ footer .compare-toggle-button {}}}-}--.layer-settings-modal .tab-content {- padding: 5px;- background: #484848;-}--.layer-settings-modal .settings-component {- margin-bottom: 14px;- padding: 0 4px;-}--.layer-settings-modal .tab-content .layer-threshold-select {- margin-top: 10px;-}--.layer-settings-modal .layer-threshold-select {- height: 58px;-}--.layer-settings-modal .tab-content .wv-palette-selector {- width: 266px;-}--.layer-settings-modal .wv-label {- color: #fff;- width: 100%;- position: relative;-}--.layer-settings-modal .wv-label-opacity {- text-align: right;-}--.layer-settings-modal .wv-label-range {- color: #fff;-}--.layer-settings-modal .wv-label-range-min {- float: left;-}+ .tab-content {+ padding: 5px;+ background: #484848;+ .noUi-target {+ margin: 10px 18px;+ }+ .layer-threshold-select {+ margin-top: 10px;+ }+ .wv-palette-selector {+ width: 266px;+ }+ .wv-palette-selector-row label {+ margin-left: 3px;+ }+ }-.layer-settings-modal .wv-label-range-max {- float: right;-}+ .settings-component {+ margin-bottom: 14px;+ padding: 0 4px;+ }-.layer-settings-modal .wv-palette-squash {- float: right;- margin-top: -26px;- .wv-checkbox.gray span {- color: #eee;+ .layer-threshold-select {+ height: 58px;}-}-/** inline-block extra spacing */-.wv-palette-selector .wv-checkbox input {- margin-left: 6px;-}+ .wv-label-opacity {+ text-align: right;+ }-.layer-settings-modal .tab-content .noUi-target {- margin: 10px 18px;-}+ .wv-label-range {+ color: #fff;+ }-.layer-settings-modal .wv-header {- font-size: 14px;- margin-bottom: 8px;-}+ .wv-label-range-min {+ float: left;+ }-.layer-opacity-select .wv-header {- margin-top: 0;-}+ .wv-label-range-max {+ float: right;+ }-.layer-orbit-tracks .wv-checkbox {- margin: 10px 0 10px 10px;- & label {- display: inline;- text-transform: capitalize;- margin-left: 5px;+ .wv-palette-squash {+ float: right;+ margin-top: -26px;+ .wv-checkbox.gray span {+ color: #eee;+ }}-}-.layer-settings-modal .wv-header.wv-color-palette-label {- margin-bottom: 0.5em;-}+ /** inline-block extra spacing */+ .wv-palette-selector .wv-checkbox input {+ margin-left: 6px;+ }-.tab-content .wv-palette-selector-row label {- margin-left: 3px;-}+ .layer-opacity-select .wv-header {+ margin-top: 0;+ }-.layer-info-settings-modal {- margin-left: auto;- margin-right: auto;- top: 0;- left: 298px;- right: auto;- bottom: auto;- border-radius: 6px;- position: absolute;- width: 500px;+ .layer-orbit-tracks .wv-checkbox {+ margin: 10px 0 10px 10px;+ & label {+ display: inline;+ text-transform: capitalize;+ margin-left: 5px;+ }+ }}diff --git a/web/js/app.js b/web/js/app.jsindex b1ed52878..02a5a97dc 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -65,6 +65,7 @@ import '../css/projection.css';import '../css/tour.css';import '../css/products.css';import '../css/events.css';+import '../css/event-filter.css';import '../css/smart-handoff.css';import '../css/sidebar.css';import '../css/layer-categories.css';diff --git a/web/js/components/sidebar/events-filter.js b/web/js/components/sidebar/events-filter.jsindex c25093b91..cffb8c245 100644--- a/web/js/components/sidebar/events-filter.js+++ b/web/js/components/sidebar/events-filter.js@@ -5,8 +5,10 @@ import { Button, ModalFooter } from 'reactstrap';import DateRangePicker from '@wojtekmaj/react-daterange-picker';import moment from 'moment';import Switch from '../util/switch';+import Checkbox from '../util/checkbox';import {setEventsFilter as setEventsFilterAction,+ toggleListAll as toggleListAllAction,} from '../../modules/natural-events/actions';import util from '../../util/util';@@ -18,6 +20,8 @@ function EventsFilter (props) {selectedEndDate,setFilter,closeModal,+ toggleListAll,+ showAll} = props;const [allNone, setAllNone] = useState(!!selectedCategories.length);@@ -39,6 +43,19 @@ function EventsFilter (props) {setCategories(newCategories);};+ const toggleListAllCheckbox = () => {+ toggleListAll();+ if (showAll) {+ googleTagManager.pushEvent({+ event: 'natural_events_current_view_only',+ });+ } else {+ googleTagManager.pushEvent({+ event: 'natural_events_show_all',+ });+ }+ }+const applyFilter = () => {const start = startDate && util.toISOStringDate(startDate);const end = endDate && util.toISOStringDate(endDate);@@ -79,9 +96,11 @@ function EventsFilter (props) {dayPlaceholder="DD"monthPlaceholder="MM"yearPlaceholder="YYYY"- format="y-M-dd"+ format="y-MM-dd"+ rangeDivider=" to "showDoubleView- hideCalenderOnInputFocus+ openCalendarOnFocus={false}+ closeCalendar={false}/><div className="category-toggles">@@ -102,10 +121,9 @@ function EventsFilter (props) {const switchId = `${id}-switch`;const isActive = categories.some((c) => c.title === title);return (- <div className="category-switch-row">+ <div className="category-switch-row" key={switchId}><Switchid={switchId}- key={switchId}label={title}active={isActive}tooltip={description}@@ -116,6 +134,15 @@ function EventsFilter (props) {})}</div>+ <Checkbox+ className="red"+ id="events-footer-checkbox"+ label="Only show events in current map view"+ onCheck={toggleListAll}+ text="List All"+ checked={!showAll}+ />+<ModalFooter><Buttonid="filter-apply-btn"@@ -142,18 +169,20 @@ EventsFilter.propTypes = {selectedStartDate: PropTypes.string,selectedEndDate: PropTypes.string,setFilter: PropTypes.func,+ showAll: PropTypes.bool,};const mapStateToProps = (state) => {const { events } = state;const {- selectedCategories, selectedDates, allCategories,+ selectedCategories, selectedDates, allCategories, showAll} = events;return {eventCategories: allCategories,selectedCategories,selectedStartDate: selectedDates.start,selectedEndDate: selectedDates.end,+ showAll,};};@@ -166,6 +195,7 @@ const mapDispatchToProps = (dispatch) => ({endDate,),);+ dispatch(toggleListAllAction());},});diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.jsindex 719050f06..2e01c47b2 100644--- a/web/js/containers/sidebar/events.js+++ b/web/js/containers/sidebar/events.js@@ -2,6 +2,7 @@ import React from 'react';import PropTypes from 'prop-types';import { connect } from 'react-redux';import { get as lodashGet } from 'lodash';+import moment from 'moment';import {Button,UncontrolledTooltip,@@ -55,6 +56,9 @@ function Events(props) {const selectedEventNotInData = !isLoading && selected.id && (eventsData || []).filter((event) => event.id === selected.id).length === 0;let showInactiveEventAlert = missingEventDate || selectedEventNotInData;+ const startDate = moment(selectedStartDate).format('YYYY MMM DD');+ const endDate = moment(selectedEndDate).format('YYYY MMM DD');+const errorOrLoadingText = isLoading? 'Loading ...': hasRequestError@@ -69,7 +73,7 @@ function Events(props) {<div className="filter-dates-icons"><div className="filter-dates">- {showDates && `${selectedStartDate} - ${selectedEndDate}`}+ {showDates && `${startDate} - ${endDate}`}</div><div className="filter-icons">@@ -95,24 +99,6 @@ function Events(props) {><FontAwesomeIcon icon="filter" /></Button>- {eventLimitReach && (- <div className="event-count">- Showing first- {` ${eventsData ? eventsData.length : ''} `}- events- <FontAwesomeIcon id="filter-info-icon" icon="info-circle" />- <UncontrolledTooltip- placement="right"- target="filter-info-icon"- >- <div>- More than- {` ${LIMIT_EVENT_REQUEST_COUNT} `}- events matched the current filter criteria.- </div>- </UncontrolledTooltip>- </div>- )}</div><Scrollbars@@ -156,6 +142,25 @@ function Events(props) {</div></Scrollbars>+ {eventLimitReach && (+ <div className="event-count">+ Showing the first+ {` ${eventsData ? eventsData.length : ''} `}+ events+ <FontAwesomeIcon id="filter-info-icon" icon="info-circle" />+ <UncontrolledTooltip+ placement="right"+ target="filter-info-icon"+ >+ <div>+ More than+ {` ${LIMIT_EVENT_REQUEST_COUNT} `}+ events matched the current filter criteria.+ </div>+ </UncontrolledTooltip>+ </div>+ )}+{showInactiveEventAlert && (<AlertUtilid="event-unavailable-alert"@@ -189,7 +194,7 @@ const mapDispatchToProps = (dispatch) => ({// Using clickableBehindModal: true here causes an issue where switching sidebar// tabs does not close this modalwrapClassName: 'clickable-behind-modal',- modalClassName: ' layer-info-settings-modal layer-settings-modal',+ modalClassName: 'sidebar-modal event-filter-modal',timeout: 150,}));},diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.jsindex 48e5f82b7..a375292f9 100644--- a/web/js/containers/sidebar/footer-content.js+++ b/web/js/containers/sidebar/footer-content.js@@ -8,111 +8,68 @@ import ModeSelection from '../../components/sidebar/mode-selection';import { toggleCompareOnOff, changeMode } from '../../modules/compare/actions';import SearchUiProvider from '../../components/layer/product-picker/search-ui-provider';import { openCustomContent } from '../../modules/modal/actions';-import { toggleListAll } from '../../modules/natural-events/actions';import { stop as stopAnimationAction } from '../../modules/animation/actions';-class FooterContent extends React.Component {- constructor(props) {- super(props);- this.toggleListAll = this.toggleListAll.bind(this);- }-- toggleListAll() {- const {- toggleListAll,- showAll,- } = this.props;- toggleListAll();- if (showAll) {- googleTagManager.pushEvent({- event: 'natural_events_current_view_only',- });- } else {- googleTagManager.pushEvent({- event: 'natural_events_show_all',- });- }- }-- render() {- const {- isCompareActive,- compareMode,- isMobile,- isPlaying,- activeTab,- changeCompareMode,- addLayers,- toggleCompare,- compareFeature,- showAll,- stopAnimation,- } = this.props;- const compareBtnText = !isCompareActive- ? `Start Comparison${isMobile ? ' Mode' : ''}`- : `Exit Comparison${isMobile ? ' Mode' : ''}`;- if (activeTab === 'layers') {- return (- <>- <ModeSelection- isActive={isCompareActive}- isMobile={isMobile}- selected={compareMode}- onclick={changeCompareMode}+const FooterContent = (props) => {+ const {+ isCompareActive,+ compareMode,+ isMobile,+ isPlaying,+ activeTab,+ changeCompareMode,+ addLayers,+ toggleCompare,+ compareFeature,+ stopAnimation,+ } = props;+ const compareBtnText = !isCompareActive+ ? `Start Comparison${isMobile ? ' Mode' : ''}`+ : `Exit Comparison${isMobile ? ' Mode' : ''}`;+ return (activeTab === 'layers') ? (+ <footer>+ <ModeSelection+ isActive={isCompareActive}+ isMobile={isMobile}+ selected={compareMode}+ onclick={changeCompareMode}+ />+ <div className="product-buttons">+ <Button+ id="layers-add"+ aria-label="Add layers"+ className="layers-add red"+ text="+ Add Layers"+ onClick={(e) => {+ e.stopPropagation();+ if (isPlaying) {+ stopAnimation();+ }+ addLayers();+ googleTagManager.pushEvent({+ event: 'add_layers',+ });+ }}/>- <div className="product-buttons">- <Button- id="layers-add"- aria-label="Add layers"- className="layers-add red"- text="+ Add Layers"- onClick={(e) => {- e.stopPropagation();- if (isPlaying) {- stopAnimation();- }- addLayers();- googleTagManager.pushEvent({- event: 'add_layers',- });- }}- />- <Button- id="compare-toggle-button"- aria-label={compareBtnText}- className="compare-toggle-button"- style={!compareFeature ? { display: 'none' } : null}- onClick={(e) => {- e.stopPropagation();- toggleCompare();- googleTagManager.pushEvent({- event: 'comparison_mode',- });- }}- text={compareBtnText}- />- </div>- </>- );- } if (activeTab === 'events') {- return (- <div className="events-footer-case">- <Checkbox- className="red"- id="events-footer-checkbox"- label="Only show events in current view"- onCheck={this.toggleListAll}- text="List All"- checked={!showAll}+ <Button+ id="compare-toggle-button"+ aria-label={compareBtnText}+ className="compare-toggle-button"+ style={!compareFeature ? { display: 'none' } : null}+ onClick={(e) => {+ e.stopPropagation();+ toggleCompare();+ googleTagManager.pushEvent({+ event: 'comparison_mode',+ });+ }}+ text={compareBtnText}/></div>- );- }- return (- <div className="data-download-footer-case" />- );- }-}+ </footer>+ ) : null;+};+const mapDispatchToProps = (dispatch) => ({toggleCompare: () => {dispatch(toggleCompareOnOff());@@ -120,9 +77,6 @@ const mapDispatchToProps = (dispatch) => ({changeCompareMode: (str) => {dispatch(changeMode(str));},- toggleListAll: () => {- dispatch(toggleListAll());- },addLayers: () => {dispatch(openCustomContent('LAYER_PICKER_COMPONENT', {@@ -138,23 +92,22 @@ const mapDispatchToProps = (dispatch) => ({dispatch(stopAnimationAction());},});-function mapStateToProps(state) {++const mapStateToProps = (state) => {const {animation, config, compare, browser,} = state;- const { showAll } = state.events;const { isPlaying } = animation;return {- showAll,isMobile: browser.lessThan.medium,isPlaying,compareFeature: config.features.compare,isCompareActive: compare.active,compareMode: compare.mode,- toggleListAll,};}+export default connect(mapStateToProps,mapDispatchToProps,@@ -172,5 +125,4 @@ FooterContent.propTypes = {showAll: PropTypes.bool,stopAnimation: PropTypes.func,toggleCompare: PropTypes.func,- toggleListAll: PropTypes.func,};diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.jsindex b507c9fb3..611775878 100644--- a/web/js/containers/sidebar/layer-row.js+++ b/web/js/containers/sidebar/layer-row.js@@ -402,7 +402,7 @@ const mapDispatchToProps = (dispatch) => ({// Using clickableBehindModal: true here causes an issue where switching sidebar// tabs does not close this modalwrapClassName: 'clickable-behind-modal',- modalClassName: ' layer-info-settings-modal layer-settings-modal',+ modalClassName: ' sidebar-modal layer-settings-modal',timeout: 150,bodyComponentProps: {layer,@@ -423,7 +423,7 @@ const mapDispatchToProps = (dispatch) => ({// Using clickableBehindModal: true here causes an issue where switching sidebar// tabs does not close this modalwrapClassName: 'clickable-behind-modal',- modalClassName: ' layer-info-settings-modal layer-info-modal',+ modalClassName: ' sidebar-modal layer-info-modal',timeout: 150,size: 'lg',bodyComponentProps: {diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.jsindex ca83c7e6a..17fb8368e 100644--- a/web/js/containers/sidebar/sidebar.js+++ b/web/js/containers/sidebar/sidebar.js@@ -341,11 +341,12 @@ class Sidebar extends React.Component {/>)}</TabPane>- <footer- ref={(footerElement) => { this.footerElement = footerElement; }}- >- <FooterContent tabTypes={tabTypes} activeTab={activeTab} />- </footer>++ <FooterContent+ tabTypes={tabTypes}+ activeTab={activeTab}+ />+</TabContent></>)}