Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

showing first n events message/tooltip

Jason Kente06e64871ea7
diff --git a/web/css/events.css b/web/css/events.css
index 503f81334..7e9164130 100644
--- a/web/css/events.css
+++ b/web/css/events.css
@@ -396,6 +396,15 @@
display: inline-block;
vertical-align: top;
}
+ & .event-count {
+ color: #fff;
+ text-align: center;
+ padding: 5px 0;
+ width: 224px;
+ & svg {
+ margin-left: 6px;
+ }
+ }
}
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 49ae58fb2..a5bddb883 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -4,6 +4,7 @@ import { connect } from 'react-redux';
import { get as lodashGet } from 'lodash';
import {
Button,
+ UncontrolledTooltip,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -22,6 +23,7 @@ import { getSelectedDate } from '../../modules/date/selectors';
import { toggleCustomContent } from '../../modules/modal/actions';
import AlertUtil from '../../components/util/alert';
import util from '../../util/util';
+import { LIMIT_EVENT_REQUEST_COUNT } from '../../modules/natural-events/constants';
function Events(props) {
const {
@@ -58,6 +60,7 @@ function Events(props) {
: hasRequestError
? 'There has been an ERROR retrieving events from the EONET events API. Please try again later.'
: '';
+ const eventLimitReach = eventsData && eventsData.length === LIMIT_EVENT_REQUEST_COUNT;
return (
<div className="event-container">
@@ -91,6 +94,24 @@ 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="top"
+ target="filter-info-icon"
+ >
+ More than
+ {' '}
+ {LIMIT_EVENT_REQUEST_COUNT}
+ {' '}
+ events matched the current filter criteria.
+ </UncontrolledTooltip>
+ </div>
+ )}
</div>
<Scrollbars
@@ -209,7 +230,6 @@ const mapStateToProps = (state, ownProps) => {
}
return {
- eventsData,
showAll,
selected,
visibleWithinMapExtent,
diff --git a/web/js/map/natural-events/util.js b/web/js/map/natural-events/util.js
index 7722442f0..6ad53f174 100644
--- a/web/js/map/natural-events/util.js
+++ b/web/js/map/natural-events/util.js
@@ -6,11 +6,12 @@ import * as olProj from 'ol/proj';
import { getCenter, boundingExtent, containsCoordinate } from 'ol/extent';
import moment from 'moment';
import util from '../../util/util';
+import { LIMIT_EVENT_REQUEST_COUNT } from '../../modules/natural-events/constants';
export function getEventsRequestURL (baseUrl, startDate, endDate, categories = []) {
const params = {
status: 'all',
- limit: 100,
+ limit: LIMIT_EVENT_REQUEST_COUNT,
};
if (startDate && endDate) {
params.start = moment.utc(startDate).format('YYYY-MM-DD');
diff --git a/web/js/modules/natural-events/constants.js b/web/js/modules/natural-events/constants.js
index 64291c2b1..c135c0e8f 100644
--- a/web/js/modules/natural-events/constants.js
+++ b/web/js/modules/natural-events/constants.js
@@ -17,3 +17,5 @@ export const REMOVE_CATEGORY = 'EVENTS/REMOVE_CATEGORY';
export const ONLY_SHOW_VISIBLE = 'EVENTS/ONLY_SHOW_VISIBLE';
export const TOGGLE_SHOW_ALL = 'EVENTS/TOGGLE_SHOW_ALL';
export const FINISHED_ANIMATING_TO_EVENT = 'EVENTS/FINISHED_ANIMATING_TO_EVENT';
+
+export const LIMIT_EVENT_REQUEST_COUNT = 50;