Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Implement event actions/reducers in redux #1623

Benjamin Kingb07e6d5da412
diff --git a/web/js/combine-ui.js b/web/js/combine-ui.js
index fc23dd723..e0ca33b76 100644
--- a/web/js/combine-ui.js
+++ b/web/js/combine-ui.js
@@ -116,8 +116,8 @@ export function combineUi(models, config, MapMouseEvents) {
ui.data = dataUi(models, ui, config);
}
if (config.features.naturalEvents) {
- var request = naturalEventsRequest(models, ui, config);
- ui.naturalEvents = naturalEventsUI(models, ui, config, request);
+ // var request = naturalEventsRequest(models, ui, config);
+ // ui.naturalEvents = naturalEventsUI(models, ui, config, request);
}
if (config.features.compare) {
ui.compare = compareUi(models, ui, config);
diff --git a/web/js/components/sidebar/events/event.js b/web/js/components/sidebar/events/event.js
index 48aead7ed..1821ceded 100644
--- a/web/js/components/sidebar/events/event.js
+++ b/web/js/components/sidebar/events/event.js
@@ -107,6 +107,7 @@ class Event extends React.Component {
if (eventDate.getUTCFullYear() !== util.today().getUTCFullYear()) {
dateString += ', ' + eventDate.getUTCFullYear();
}
+ console.log(event.categories);
return (
<li
className={
diff --git a/web/js/components/sidebar/events/events.js b/web/js/components/sidebar/events/events.js
index 03d0f6ddb..17ac47259 100644
--- a/web/js/components/sidebar/events/events.js
+++ b/web/js/components/sidebar/events/events.js
@@ -2,50 +2,101 @@ import React from 'react';
import PropTypes from 'prop-types';
import Event from './event';
import Scrollbars from '../../util/scrollbar';
+import { connect } from 'react-redux';
+import {
+ requestEvents,
+ requestCategories,
+ requestSources
+} from '../../../modules/natural-events/actions';
+import { getEventsWithinExtent } from '../../../modules/natural-events/selectors';
+import { get as lodashGet } from 'lodash';
class Events extends React.Component {
+ constructor(props) {
+ super(props);
+ this.initRequests();
+ }
+ initRequests() {
+ const {
+ requestSources,
+ requestCategories,
+ requestEvents,
+ apiURL,
+ config
+ } = this.props;
+
+ let eventsRequestURL = apiURL + '/events';
+ let categoryRequestURL = apiURL + '/categories';
+ let sourceRequestURL = apiURL + '/sources';
+
+ const mockEvents = lodashGet(config, 'config.parameters.mockEvents');
+ const mockCategories = lodashGet(
+ config,
+ 'config.parameters.mockCategories'
+ );
+ const mockSources = lodashGet(config, 'config.parameters.mockSources');
+
+ if (mockEvents) {
+ console.warn('Using mock events data: ' + mockEvents);
+ eventsRequestURL = 'mock/events_data.json-' + mockEvents;
+ }
+ if (mockCategories) {
+ console.warn('Using mock categories data: ' + mockCategories);
+ categoryRequestURL = 'mock/categories_data.json-' + mockCategories;
+ }
+ if (mockSources) {
+ console.warn('Using mock categories data: ' + mockSources);
+ sourceRequestURL = 'mock/categories_data.json-' + mockSources;
+ }
+ requestEvents(eventsRequestURL);
+ requestCategories(categoryRequestURL);
+ requestSources(sourceRequestURL);
+ }
render() {
const {
events,
+ showAll,
+ isLoading,
selectEvent,
- selectedEvent,
+ selected,
visibleEvents,
sources,
height,
- deselectEvent,
- tabTypes
+ deselectEvent
} = this.props;
- if (!tabTypes.events) return null;
+
return (
<Scrollbars style={{ maxHeight: height + 'px' }}>
<div id="wv-events">
<span
className="events-loading-text"
- style={!events.length ? { display: 'block' } : { display: 'none' }}
+ style={isLoading ? { display: 'block' } : { display: 'none' }}
>
Loading...
</span>
<div
className="wv-eventslist sidebar-panel"
- style={events.length ? { display: 'block' } : { display: 'none' }}
+ style={events ? { display: 'block' } : { display: 'none' }}
>
<ul id="wv-eventscontent" className="content map-item-list">
- {events.map(event => (
- <Event
- key={event.id}
- event={event}
- selectEvent={selectEvent}
- deselectEvent={deselectEvent}
- selectedDate={
- selectedEvent.id === event.id &&
- (visibleEvents.all || visibleEvents[event.id])
- ? selectedEvent.date
- : null
- }
- isVisible={visibleEvents.all || visibleEvents[event.id]}
- sources={sources}
- />
- ))}
+ {events && sources
+ ? events.map(event => (
+ <Event
+ key={event.id}
+ event={event}
+ selectEvent={selectEvent}
+ deselectEvent={deselectEvent}
+ selectedDate={
+ selected.id === event.id &&
+ (showAll || visibleEvents[event.id])
+ ? selected.date
+ : null
+ }
+ isVisible={visibleEvents[event.id] || showAll}
+ sources={sources}
+ />
+ ))
+ : ''}
</ul>
</div>
</div>
@@ -53,15 +104,66 @@ class Events extends React.Component {
);
}
}
+const mapDispatchToProps = dispatch => ({
+ requestEvents: url => {
+ dispatch(requestEvents(url));
+ },
+ requestSources: url => {
+ dispatch(requestSources(url));
+ },
+ requestCategories: url => {
+ dispatch(requestCategories(url));
+ }
+});
+function mapStateToProps(state) {
+ const {
+ requestedEvents,
+ requestedEventSources,
+ requestedEventCategories,
+ config
+ } = state;
+ const { selected, showAll } = state.events;
+ const apiURL = lodashGet(state, 'config.features.naturalEvents.host');
+ const isLoading =
+ requestedEvents.isLoading ||
+ requestedEventSources.isLoading ||
+ requestedEventCategories.isLoading;
+
+ let visibleEvents = {};
+ const events = lodashGet(requestedEvents, 'response');
+ const sources = lodashGet(requestedEventSources, 'response');
+ console.log(events);
+ if (events) {
+ visibleEvents = getEventsWithinExtent(
+ events,
+ selected,
+ state.legacy.map.extent,
+ state
+ );
+ }
+
+ return {
+ events,
+ showAll,
+ isLoading,
+ sources,
+ selected,
+ visibleEvents,
+ apiURL,
+ config
+ };
+}
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(Events);
+
Events.propTypes = {
events: PropTypes.array,
sources: PropTypes.array,
- selectEvent: PropTypes.func,
- selectedEvent: PropTypes.object,
+ selected: PropTypes.object,
visibleEvents: PropTypes.object,
height: PropTypes.number,
deselectEvent: PropTypes.func,
tabTypes: PropTypes.object
};
-
-export default Events;
diff --git a/web/js/components/sidebar/footer-content.js b/web/js/components/sidebar/footer-content.js
index 1986ef901..9ade87ffa 100644
--- a/web/js/components/sidebar/footer-content.js
+++ b/web/js/components/sidebar/footer-content.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Button from '../util/button';
import ModeSelection from './mode-selection';
import googleTagManager from 'googleTagManager';
+import { connect } from 'react-redux';
class FooterContent extends React.Component {
render() {
@@ -122,6 +123,14 @@ class FooterContent extends React.Component {
}
}
}
+const mapDispatchToProps = dispatch => ({});
+function mapStateToProps(state) {
+ return {};
+}
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(FooterContent);
FooterContent.propTypes = {
showListAllButton: PropTypes.bool,
@@ -139,4 +148,3 @@ FooterContent.propTypes = {
getDataSelectionSize: PropTypes.func,
compareFeature: PropTypes.bool
};
-export default FooterContent;
diff --git a/web/js/containers/sidebar.js b/web/js/containers/sidebar.js
index d922a1ad9..e39e19c52 100644
--- a/web/js/containers/sidebar.js
+++ b/web/js/containers/sidebar.js
@@ -154,17 +154,17 @@ class Sidebar extends React.Component {
onWheel={wheelCallBack}
>
{/* <NavCase activeTab={activeTab} onTabClick={onTabClick} /> */}
- <TabContent activeTab={activeTab}>
+ <TabContent activeTab={'events'}>
<TabPane tabId="layers">
{this.getProductsToRender(activeTab, isCompareMode)}
</TabPane>
- {/* <TabPane tabId="events">
+ <TabPane tabId="events">
<Events
isActive={activeTab === 'events'}
height={subComponentHeight}
/>
</TabPane>
- <TabPane tabId="download">
+ {/* <TabPane tabId="download">
<Data
isActive={activeTab === 'download'}
height={subComponentHeight}
diff --git a/web/js/modules/browser/actions.js b/web/js/modules/browser/actions.js
deleted file mode 100644
index 9d06871ed..000000000
--- a/web/js/modules/browser/actions.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { SCREEN_RESIZE } from './constants';
-
-export function screenResize(width, height) {
- return {
- type: SCREEN_RESIZE,
- screenWidth: width,
- screenHeight: height
- };
-}
diff --git a/web/js/modules/browser/constants.js b/web/js/modules/browser/constants.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/web/js/modules/browser/reducers.js b/web/js/modules/browser/reducers.js
deleted file mode 100644
index 46bee7304..000000000
--- a/web/js/modules/browser/reducers.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { assign as lodashAssign } from 'lodash';
-import { SCREEN_RESIZE } from './constants';
-
-// https://stackoverflow.com/a/39670754
-const initialState = {
- screenWidth: typeof window === 'object' ? window.innerWidth : null,
- screenHeight: typeof window === 'object' ? window.innerHeight : null
-};
-export function browserReducer(state = initialState, action) {
- switch (action.type) {
- case SCREEN_RESIZE:
- return lodashAssign({}, state, {
- screenWidth: action.screenWidth,
- screenHeight: action.screenHeight
- });
- }
- return state;
-}
diff --git a/web/js/modules/combine-reducers.js b/web/js/modules/combine-reducers.js
index 83213d17f..bbe1b5c66 100644
--- a/web/js/modules/combine-reducers.js
+++ b/web/js/modules/combine-reducers.js
@@ -5,6 +5,13 @@ import legacyReducer from './migration/reducers';
import feedbackReducer from './feedback/reducers';
import projectionReducer from './projection/reducer';
import { shortLink } from './link/reducers';
+import {
+ requestedEvents,
+ requestedEventSources,
+ requestedEventCategories,
+ eventsReducer,
+ eventRequestResponse
+} from './natural-events/reducers';
import {
notificationsRequest,
notificationsReducer
@@ -16,6 +23,7 @@ import {
layerReducer,
getInitialState as getLayersInitialState
} from './layers/reducers';
+import { get as lodashGet } from 'lodash';
const responsiveStateReducer = createResponsiveStateReducer(
{
@@ -33,13 +41,20 @@ const responsiveStateReducer = createResponsiveStateReducer(
}
);
export function getInitialState(models, config, parameters) {
+ const eventsIgnoreArray = {
+ ignore: lodashGet(config, 'naturalEvents.skip') || []
+ };
+
return {
parameters,
config,
models,
legacy: models,
proj: getProjInitialState(config),
- layers: getLayersInitialState(config)
+ layers: getLayersInitialState(config),
+ requestedEvents: eventRequestResponse(eventsIgnoreArray),
+ requestedEventSources: eventRequestResponse(eventsIgnoreArray),
+ requestedEventCategories: eventRequestResponse(eventsIgnoreArray)
};
}
const defaultReducer = (state = {}) => state;
@@ -56,6 +71,10 @@ const reducers = {
sidebar: sidebarReducer,
compare: compareReducer,
layers: layerReducer,
+ events: eventsReducer,
+ requestedEvents,
+ requestedEventSources,
+ requestedEventCategories,
modalAboutPage,
shortLink,
notificationsRequest
diff --git a/web/js/modules/core/reducers.js b/web/js/modules/core/reducers.js
index aabe113c8..ab2791305 100644
--- a/web/js/modules/core/reducers.js
+++ b/web/js/modules/core/reducers.js
@@ -16,7 +16,8 @@ export function requestReducer(actionName, state, action, callback) {
switch (action.type) {
case START:
return requestResponse({
- isLoading: true
+ isLoading: true,
+ response: null
});
case SUCCESS:
return requestResponse({
@@ -25,10 +26,11 @@ export function requestReducer(actionName, state, action, callback) {
});
case FAILURE:
return requestResponse({
+ response: null,
error: action.error,
isLoading: false
});
default:
- return requestResponse({});
+ return requestResponse(state);
}
}
diff --git a/web/js/modules/natural-events/actions.js b/web/js/modules/natural-events/actions.js
new file mode 100644
index 000000000..09571cb00
--- /dev/null
+++ b/web/js/modules/natural-events/actions.js
@@ -0,0 +1,60 @@
+import {
+ REQUEST_EVENTS,
+ REQUEST_SOURCES,
+ REQUEST_CATEGORIES,
+ SELECT_EVENT,
+ SHOW_ALL_EVENTS,
+ ONLY_SHOW_VISIBLE
+} from './constants';
+import { requestAction } from '../core/actions';
+
+export function requestEvents(location) {
+ return dispatch => {
+ return requestAction(
+ dispatch,
+ REQUEST_EVENTS,
+ location,
+ 'application/json'
+ );
+ };
+}
+export function requestCategories(location) {
+ return dispatch => {
+ return requestAction(
+ dispatch,
+ REQUEST_CATEGORIES,
+ location,
+ 'application/json'
+ );
+ };
+}
+export function requestSources(location) {
+ return dispatch => {
+ return requestAction(
+ dispatch,
+ REQUEST_SOURCES,
+ location,
+ 'application/json'
+ );
+ };
+}
+
+export function selectEvent(id, date) {
+ return {
+ type: SELECT_EVENT,
+ id: id,
+ date: date
+ };
+}
+
+export function showAll() {
+ return {
+ type: SHOW_ALL_EVENTS
+ };
+}
+
+export function onlyShowVisible() {
+ return {
+ type: ONLY_SHOW_VISIBLE
+ };
+}
diff --git a/web/js/modules/natural-events/constants.js b/web/js/modules/natural-events/constants.js
new file mode 100644
index 000000000..897881956
--- /dev/null
+++ b/web/js/modules/natural-events/constants.js
@@ -0,0 +1,18 @@
+export const REQUEST_EVENTS = 'EVENTS/REQUEST_EONET_EVENTS';
+export const REQUEST_EVENTS_START = 'EVENTS/REQUEST_EONET_EVENTS_START';
+export const REQUEST_EVENTS_FAILURE = 'EVENTS/REQUEST_EONET_EVENTS_FAILURE';
+export const REQUEST_EVENTS_SUCCESS = 'EVENTS/REQUEST_EONET_EVENTS_SUCCESS';
+
+export const REQUEST_SOURCES = 'EVENTS/REQUEST_SOURCES';
+export const REQUEST_SOURCES_START = 'EVENTS/REQUEST_SOURCES_START';
+export const REQUEST_SOURCES_FAILURE = 'EVENTS/REQUEST_SOURCES_FAILURE';
+export const REQUEST_SOURCES_SUCCESS = 'EVENTS/REQUEST_SOURCES_SUCCESS';
+
+export const REQUEST_CATEGORIES = 'EVENTS/REQUEST_CATEGORIES';
+export const REQUEST_CATEGORIES_START = 'EVENTS/REQUEST_CATEGORIES_START';
+export const REQUEST_CATEGORIES_FAILURE = 'EVENTS/REQUEST_CATEGORIES_FAILURE';
+export const REQUEST_CATEGORIES_SUCCESS = 'EVENTS/REQUEST_CATEGORIES_SUCCESS';
+
+export const SELECT_EVENT = 'EVENTS/SELECT_EVENT';
+export const SHOW_ALL_EVENTS = 'EVENTS/SHOW_ALL_EVENTS';
+export const ONLY_SHOW_VISIBLE = 'EVENTS/ONLY_SHOW_VISIBLE';
diff --git a/web/js/modules/natural-events/reducers.js b/web/js/modules/natural-events/reducers.js
new file mode 100644
index 000000000..17d09a173
--- /dev/null
+++ b/web/js/modules/natural-events/reducers.js
@@ -0,0 +1,125 @@
+import {
+ REQUEST_EVENTS,
+ REQUEST_SOURCES,
+ REQUEST_CATEGORIES,
+ SELECT_EVENT,
+ SHOW_ALL_EVENTS,
+ ONLY_SHOW_VISIBLE
+} from './constants';
+import {
+ assign as lodashAssign,
+ orderBy as lodashOrderBy,
+ uniqBy as lodashUniqBy
+} from 'lodash';
+
+const sortEvents = function(events) {
+ return events.map(function(e) {
+ e.geometries = lodashOrderBy(e.geometries, 'date', 'desc');
+ // Discard duplicate geometry dates
+ e.geometries = lodashUniqBy(e.geometries, function(g) {
+ return g.date.split('T')[0];
+ });
+ return e;
+ });
+};
+const formatResponse = function(item, ignored) {
+ if (item.categories) {
+ var category = Array.isArray(item.categories)
+ ? item.categories[0]
+ : item.categories;
+ // Add slug to categories
+ category.slug = category.title
+ .toLowerCase()
+ .split(' ')
+ .join('-');
+ return !ignored.includes(category.title);
+ } else {
+ return !ignored.includes(item.title);
+ }
+};
+
+export const eventsReducerState = {
+ selected: {
+ id: '',
+ date: null
+ },
+ showAll: true
+};
+
+export function eventsReducer(state = eventsReducerState, action) {
+ switch (action.type) {
+ case SELECT_EVENT:
+ return lodashAssign({}, state, {
+ selected: {
+ id: action.id,
+ date: action.date || null
+ }
+ });
+ case SHOW_ALL_EVENTS:
+ return lodashAssign({}, state, {
+ showAll: true
+ });
+ case ONLY_SHOW_VISIBLE:
+ return lodashAssign({}, state, {
+ showAll: false
+ });
+ default:
+ return state;
+ }
+}
+export const defaultRequestState = {
+ isLoading: false,
+ error: null,
+ response: null,
+ type: null,
+ ignore: []
+};
+export function eventRequestResponse(props = {}) {
+ return lodashAssign({}, defaultRequestState, props);
+}
+export function eventsRequestReducer(actionName, state, action) {
+ const START = `${actionName}_START`;
+ const SUCCESS = `${actionName}_SUCCESS`;
+ const FAILURE = `${actionName}_FAILURE`;
+ switch (action.type) {
+ case START:
+ return eventRequestResponse({
+ isLoading: true,
+ response: null
+ });
+ case SUCCESS:
+ const key =
+ actionName === REQUEST_EVENTS
+ ? 'events'
+ : actionName === REQUEST_CATEGORIES
+ ? 'categories'
+ : 'sources';
+ const filtered = action.response[key].filter(item => {
+ return formatResponse(item, state.ignore);
+ });
+ return eventRequestResponse({
+ response:
+ actionName === REQUEST_EVENTS ? sortEvents(filtered) : filtered,
+ isLoading: false
+ });
+ case FAILURE:
+ return eventRequestResponse({
+ response: null,
+ error: action.error,
+ isLoading: false
+ });
+ default:
+ return eventRequestResponse(state);
+ }
+}
+export function requestedEvents(state = {}, action) {
+ return eventsRequestReducer(REQUEST_EVENTS, state, action);
+}
+
+export function requestedEventCategories(state = {}, action) {
+ return eventsRequestReducer(REQUEST_CATEGORIES, state, action);
+}
+
+export function requestedEventSources(state = {}, action) {
+ return eventsRequestReducer(REQUEST_SOURCES, state, action);
+}
diff --git a/web/js/modules/natural-events/selectors.js b/web/js/modules/natural-events/selectors.js
new file mode 100644
index 000000000..a041321cb
--- /dev/null
+++ b/web/js/modules/natural-events/selectors.js
@@ -0,0 +1,67 @@
+import { find as lodashFind, get as lodashGet } from 'lodash';
+import * as olProj from 'ol/proj';
+import * as olExtent from 'ol/extent';
+
+export function getEventsWithinExtent(loadedEvents, selected, extent, state) {
+ const selectedProj = lodashGet(state, 'proj.selected');
+ var maxExtent = selectedProj.maxExtent;
+ var visibleListEvents = {};
+
+ loadedEvents.forEach(function(naturalEvent) {
+ var isSelectedEvent = selected.id === naturalEvent.id;
+ var date = getDefaultEventDate(naturalEvent);
+ if (selected && selected.date) {
+ date = selected.date;
+ }
+ var geometry =
+ lodashFind(naturalEvent.geometries, function(geometry) {
+ return geometry.date.split('T')[0] === date;
+ }) || naturalEvent.geometries[0];
+
+ var coordinates = geometry.coordinates;
+
+ if (selectedProj.id !== 'geographic') {
+ // check for polygon geometries for targeted projection coordinate transform
+ if (geometry.type === 'Polygon') {
+ let coordinatesTransform = coordinates[0].map(coordinate => {
+ return olProj.transform(coordinate, 'EPSG:4326', selectedProj.crs);
+ });
+ let geomExtent = olExtent.boundingExtent(coordinatesTransform);
+ coordinates = olExtent.getCenter(geomExtent);
+ } else {
+ // if normal geometries, transform given lon/lat array
+ coordinates = olProj.transform(
+ coordinates,
+ 'EPSG:4326',
+ selectedProj.crs
+ );
+ }
+ } else {
+ if (geometry.type === 'Polygon') {
+ let geomExtent = olExtent.boundingExtent(geometry.coordinates[0]);
+ coordinates = olExtent.getCenter(geomExtent);
+ }
+ }
+
+ // limit to maxExtent while allowing zoom and filter 'out of extent' events
+ var isVisible =
+ olExtent.containsCoordinate(extent, coordinates) &&
+ olExtent.containsCoordinate(maxExtent, coordinates);
+
+ if (isVisible || isSelectedEvent) {
+ visibleListEvents[naturalEvent.id] = true;
+ }
+ });
+ return visibleListEvents;
+}
+export function getDefaultEventDate(event) {
+ var date = new Date(event.geometries[0].date).toISOString().split('T')[0];
+ if (event.geometries.length < 2) return date;
+ var category = event.categories.title || event.categories[0].title;
+ var today = new Date().toISOString().split('T')[0];
+ // For storms that happened today, get previous date
+ if (date === today && category === 'Severe Storms') {
+ date = new Date(event.geometries[1].date).toISOString().split('T')[0];
+ }
+ return date;
+}
diff --git a/web/js/modules/notifications/constants.js b/web/js/modules/notifications/constants.js
index 5e4d51ba9..4ce17a6cd 100644
--- a/web/js/modules/notifications/constants.js
+++ b/web/js/modules/notifications/constants.js
@@ -1,12 +1,13 @@
-export const REQUEST_NOTIFICATIONS = 'REQUEST_APP_NOTIFICATIONS';
-export const REQUEST_NOTIFICATIONS_START = 'REQUEST_APP_NOTIFICATIONS_START';
+export const REQUEST_NOTIFICATIONS = 'NOTIFICATIONS/REQUEST_APP_NOTIFICATIONS';
+export const REQUEST_NOTIFICATIONS_START =
+ 'NOTIFICATIONS/REQUEST_APP_NOTIFICATIONS_START';
export const REQUEST_NOTIFICATIONS_SUCCESS =
- 'REQUEST_APP_NOTIFICATIONS_SUCCESS';
+ 'NOTIFICATIONS/REQUEST_APP_NOTIFICATIONS_SUCCESS';
export const REQUEST_NOTIFICATIONS_FAILURE =
- 'REQUEST_APP_NOTIFICATIONS_FAILURE';
+ 'NOTIFICATIONS/REQUEST_APP_NOTIFICATIONS_FAILURE';
+export const SET_NOTIFICATIONS = 'NOTIFICATIONS/SET_NOTIFICATION_RESPONSE';
+export const NOTIFICATIONS_SEEN = 'NOTIFICATIONS/NOTIFICATIONS_HAVE_BEEN_SEEN';
-export const SET_NOTIFICATIONS = 'SET_NOTIFICATION_RESPONSE';
-export const NOTIFICATIONS_SEEN = 'NOTIFICATIONS_HAVE_BEEN_SEEN';
export const STATUS_REQUEST_URL =
'https://status.earthdata.nasa.gov/api/v1/notifications?domain=https%3A%2F%2Fworldview.earthdata.nasa.gov';
export const MOCK_RESPONSE_BODY = [