Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Name of util function to fit convention #818

Benjamin King7b5d73df7a67
diff --git a/web/js/naturalEvents/track.js b/web/js/naturalEvents/track.js
index 63e5b7ba1..61f8bcca5 100644
--- a/web/js/naturalEvents/track.js
+++ b/web/js/naturalEvents/track.js
@@ -7,7 +7,7 @@ import OlStyleStyle from 'ol/style/style';
import OlGeomMultiLineString from 'ol/geom/multilinestring';
import lodashEach from 'lodash/each';
import lodashDebounce from 'lodash/debounce';
-import { getEventById } from './util';
+import { naturalEventsUtilGetEventById } from './util';
import {
naturalEventsClusterPointToGeoJSON,
naturalEventsClusterGetPoints,
@@ -36,7 +36,7 @@ export default function naturalEventsTrack (models, ui, config) {
} else {
let selectedEvent = ui.naturalEvents.selected;
if (selectedEvent.date) {
- let event = getEventById(model.data.events, selectedEvent.id);
+ let event = naturalEventsUtilGetEventById(model.data.events, selectedEvent.id);
debounceTrackUpdate(event, selectedEvent.date, map, ui.naturalEvents.selectEvent);
}
}
diff --git a/web/js/naturalEvents/ui.js b/web/js/naturalEvents/ui.js
index b5f803051..526d44d93 100644
--- a/web/js/naturalEvents/ui.js
+++ b/web/js/naturalEvents/ui.js
@@ -8,7 +8,7 @@ import track from './track';
import wvui from '../ui/ui';
import util from '../util/util';
-import { getEventById } from './util';
+import { naturalEventsUtilGetEventById } from './util';
const zoomLevelReference = {
'Wildfires': 8,
@@ -90,13 +90,13 @@ export default function naturalEventsUI (models, ui, config, request) {
self.selectEvent = function (id, date) {
var isIdChange = (!self.selected || self.selected.id !== id);
var prevId = self.selected.id ? self.selected.id : false;
- var prevEvent = prevId ? getEventById(model.data.events, prevId) : false;
+ var prevEvent = prevId ? naturalEventsUtilGetEventById(model.data.events, prevId) : false;
var prevCategory = prevEvent ? prevEvent.categories[0].title : false;
// Store selected id and date in model
self.selected = { id: id };
- var event = getEventById(model.data.events, id);
+ var event = naturalEventsUtilGetEventById(model.data.events, id);
if (!event) {
wvui.notify('The event with an id of ' + id + ' is no longer active.');
diff --git a/web/js/naturalEvents/util.js b/web/js/naturalEvents/util.js
index d03820472..0b3c1435c 100644
--- a/web/js/naturalEvents/util.js
+++ b/web/js/naturalEvents/util.js
@@ -7,7 +7,7 @@ import lodashFind from 'lodash/find';
* @param {String} id Event Id
* @return {Object} Eonet Event Object
*/
-export function getEventById (events, id) {
+export function naturalEventsUtilGetEventById (events, id) {
return lodashFind(events, function (e) {
return e.id === id;
});