Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2819: ESLint - no-param-reassign (#6367)

Jason Hurley796d47311777
diff --git a/web/.eslintrc b/web/.eslintrc
index 92fed5948..acd02a174 100644
--- a/web/.eslintrc
+++ b/web/.eslintrc
@@ -89,12 +89,6 @@
"no-shadow": "warn", // 110 errors across 40 files
"max-len": "error",
"no-underscore-dangle": "error",
- "no-param-reassign": [ // 198 errors across 46 files
- "warn",
- {
- "props": false
- }
- ],
// Import rules overrides
"import/no-cycle": "warn",
// Accesibility rules overrides
diff --git a/web/js/components/date-selector/date-input-column.js b/web/js/components/date-selector/date-input-column.js
index 2fd702790..e7a913c6a 100644
--- a/web/js/components/date-selector/date-input-column.js
+++ b/web/js/components/date-selector/date-input-column.js
@@ -180,39 +180,40 @@ class DateInputColumn extends Component {
const {
date, type, minDate, maxDate, updateTimeUnitInput,
} = this.props;
+ let inputValue = value;
let newDate;
const validateDate = (dateParam) => dateParam > minDate && dateParam <= maxDate && dateParam;
switch (type) {
case 'year':
- newDate = yearValidation(value, date, validateDate);
+ newDate = yearValidation(inputValue, date, validateDate);
break;
case 'month':
- newDate = monthValidation(value, date, validateDate);
+ newDate = monthValidation(inputValue, date, validateDate);
// transform month number to string (e.g., 3 -> 'MAR')
// eslint-disable-next-line no-restricted-globals
- if (newDate !== null && !isNaN(value)) {
- value = MONTH_STRING_ARRAY[value - 1];
+ if (newDate !== null && !isNaN(inputValue)) {
+ inputValue = MONTH_STRING_ARRAY[inputValue - 1];
}
break;
case 'day':
- newDate = dayValidation(value, date, validateDate);
+ newDate = dayValidation(inputValue, date, validateDate);
break;
case 'hour':
- newDate = hourValidation(value, date, validateDate);
+ newDate = hourValidation(inputValue, date, validateDate);
break;
case 'minute':
- newDate = minuteValidation(value, date, validateDate);
+ newDate = minuteValidation(inputValue, date, validateDate);
break;
default:
break;
}
// add leading '0' to single string number
- if (newDate !== null && value.length === 1) {
- value = `0${value}`;
+ if (newDate !== null && inputValue.length === 1) {
+ inputValue = `0${inputValue}`;
}
- // update parent level time unit type value
+ // update parent level time unit type inputValue
if (newDate !== null) {
- updateTimeUnitInput(type, value);
+ updateTimeUnitInput(type, inputValue);
}
return newDate;
};
diff --git a/web/js/components/layer/product-picker/browse/category-grid.js b/web/js/components/layer/product-picker/browse/category-grid.js
index 4d1935fff..33326846b 100644
--- a/web/js/components/layer/product-picker/browse/category-grid.js
+++ b/web/js/components/layer/product-picker/browse/category-grid.js
@@ -31,7 +31,9 @@ function CategoryGrid(props) {
gutter: 10,
};
categories.forEach((item) => {
- item.sortOrder = item.placement === 'first' ? 1 : item.placement === 'last' ? 3 : 2;
+ let { sortOrder } = item;
+ sortOrder = item.placement === 'first' ? 1 : item.placement === 'last' ? 3 : 2;
+ return sortOrder;
});
const orderedCategories = lodashOrderBy(
categories,
diff --git a/web/js/components/layer/settings/layer-settings.js b/web/js/components/layer/settings/layer-settings.js
index d939b45c3..c5b4d1a91 100644
--- a/web/js/components/layer/settings/layer-settings.js
+++ b/web/js/components/layer/settings/layer-settings.js
@@ -382,7 +382,7 @@ function mapStateToProps(state, ownProps) {
getPaletteLegend: (layerId, index) => getPaletteLegend(layerId, index, groupName, state),
getPaletteLegends: (layerId) => getPaletteLegends(layerId, groupName, state),
getPalette: (layerId, index) => getPalette(layerId, index, groupName, state),
- getVectorStyle: (layerId, index) => getVectorStyle(layerId, index, groupName, state),
+ getVectorStyle: (layerId, index) => getVectorStyle(layerId, index, state),
vectorStyles: config.vectorStyles,
};
}
diff --git a/web/js/components/projection/util.js b/web/js/components/projection/util.js
index 266811a8a..acc3e7fca 100644
--- a/web/js/components/projection/util.js
+++ b/web/js/components/projection/util.js
@@ -1,16 +1,25 @@
export default function parse(state, errors, config) {
+ let newState = { ...state };
+
// Permalink version 1.0 - 1.1
- if (state.switch) {
- state.p = state.switch;
- delete state.switch;
+ if (newState.switch) {
+ newState = {
+ ...newState,
+ p: newState.switch,
+ };
+ delete newState.switch;
}
- const projId = state.p;
+
+ const projId = newState.p;
if (projId) {
if (!config.projections[projId]) {
- delete state.p;
+ newState = { ...newState };
+ delete newState.p;
errors.push({
message: `Unsupported projection: ${projId}`,
});
}
}
+
+ return newState;
}
diff --git a/web/js/components/range-selection/range-selection.js b/web/js/components/range-selection/range-selection.js
index 6c8b1ac4a..fc233e17b 100644
--- a/web/js/components/range-selection/range-selection.js
+++ b/web/js/components/range-selection/range-selection.js
@@ -226,29 +226,31 @@ class TimelineRangeSelector extends React.Component {
const startDate = new Date(animationStartLocationDate);
const endDate = new Date(animationEndLocationDate);
+ let newDraggerEndLocation = draggerEndLocation;
+ let newDraggerStartLocation = draggerStartLocation;
// prevent draggers to be dragger BEFORE start date limit
if (endDate < startDateLimit) {
- draggerEndLocation = endLocation;
+ newDraggerEndLocation = endLocation;
animationEndLocationDate = startDateLimit;
}
if (startDate < startDateLimit) {
- draggerStartLocation = startLocation;
+ newDraggerStartLocation = startLocation;
animationStartLocationDate = startDateLimit;
}
// prevent draggers to be dragger AFTER end date limit
if (endDate > endDateLimit) {
- draggerEndLocation = endLocation;
+ newDraggerEndLocation = endLocation;
animationEndLocationDate = endDateLimit;
}
if (startDate > endDateLimit) {
- draggerStartLocation = startLocation;
+ newDraggerStartLocation = startLocation;
animationStartLocationDate = endDateLimit;
}
updateAnimationDateAndLocation(
animationStartLocationDate,
animationEndLocationDate,
- draggerStartLocation,
- draggerEndLocation,
+ newDraggerStartLocation,
+ newDraggerEndLocation,
isDragging,
);
};
@@ -373,3 +375,5 @@ TimelineRangeSelector.propTypes = {
};
export default TimelineRangeSelector;
+
+
diff --git a/web/js/components/timeline/timeline-axis/date-calc.js b/web/js/components/timeline/timeline-axis/date-calc.js
index 544e680c7..a2abbdbce 100644
--- a/web/js/components/timeline/timeline-axis/date-calc.js
+++ b/web/js/components/timeline/timeline-axis/date-calc.js
@@ -9,14 +9,15 @@ const limitCache = {};
/**
* get range of consecutive time units based on start/end dates and timescale
*
- * @param {Object} startDate - moment date object - start of requested time range
+ * @param {Object} beginDate - moment date object - start of requested time range
* @param {Object} endDate - moment date object - end of requested time range
* @param {String} timeScale - timescale of time units (ex: 'day', 'month', etc.)
* @param {startDateLimit} startDateLimit - min date within timeline range
* @param {endDateLimit} endDateLimit - max date within timeline range
* @returns {Array} timeRange - consecutive time units based on range
*/
-export default function getTimeRange(startDate, endDate, timeScale, startDateLimit, endDateLimit) {
+export default function getTimeRange(beginDate, endDate, timeScale, startDateLimit, endDateLimit) {
+ let startDate = beginDate;
const timeRange = [];
const { format } = timeScaleOptions[timeScale].timeAxis;
diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-container.js b/web/js/components/timeline/timeline-coverage/coverage-item-container.js
index a506de74e..556c45eb6 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-item-container.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-item-container.js
@@ -57,7 +57,8 @@ class CoverageItemContainer extends Component {
getDateRangeToDisplay = (dateRanges) => {
const { getMaxEndDate, getDatesInDateRange, layer } = this.props;
- const multiDateToDisplay = dateRanges.reduce((multiCoverageDates, range, innerIndex) => {
+ const multiDateToDisplay = dateRanges.reduce((dates, range, innerIndex) => {
+ const multiCoverageDates = { ...dates };
const { dateInterval, startDate, endDate } = range;
const isLastInRange = innerIndex === dateRanges.length - 1;
const rangeInterval = Number(dateInterval);
diff --git a/web/js/components/tour/joyride-wrapper.js b/web/js/components/tour/joyride-wrapper.js
index 7004f1b06..a22bca9bd 100644
--- a/web/js/components/tour/joyride-wrapper.js
+++ b/web/js/components/tour/joyride-wrapper.js
@@ -86,10 +86,11 @@ export default function JoyrideWrapper ({
/**
* Set a placeholder DOM element's position based on map coords
- * @param {*} element
+ * @param {*} el
* @param {*} targetCoordinates
*/
- function setPlaceholderLocation (element, targetCoordinates) {
+ function setPlaceholderLocation (el, targetCoordinates) {
+ const element = { ...el };
const { topLeft, bottomRight } = targetCoordinates;
let [x1, y1] = map.getPixelFromCoordinate(topLeft) || [0, 0];
let [x2, y2] = map.getPixelFromCoordinate(bottomRight) || [0, 0];
diff --git a/web/js/containers/tour.js b/web/js/containers/tour.js
index 8bb89a0d7..e1fab639e 100644
--- a/web/js/containers/tour.js
+++ b/web/js/containers/tour.js
@@ -508,8 +508,8 @@ class Tour extends React.Component {
}
const mapDispatchToProps = (dispatch) => ({
- processStepLink: (currentStoryId, currentStep, totalSteps, search, config, rendered) => {
- search = search.split('/?').pop();
+ processStepLink: (currentStoryId, currentStep, totalSteps, s, config, rendered) => {
+ const search = s.split('/?').pop();
const location = update(history.location, {
search: { $set: search },
});
@@ -553,8 +553,8 @@ const mapDispatchToProps = (dispatch) => ({
dispatch({ type: LOCATION_POP_ACTION, payload: location });
}
},
- preProcessStepLink: async (search, config, promiseImageryForTour) => {
- search = search.split('/?').pop();
+ preProcessStepLink: async (s, config, promiseImageryForTour) => {
+ const search = s.split('/?').pop();
const parameters = util.fromQueryString(search);
let layersA = [];
let layersB = [];
diff --git a/web/js/debug.js b/web/js/debug.js
index d12214d5b..6dc011012 100644
--- a/web/js/debug.js
+++ b/web/js/debug.js
@@ -3,7 +3,8 @@ import lodashIsNaN from 'lodash/isNaN';
import lodashParseInt from 'lodash/parseInt';
// eslint-disable-next-line import/prefer-default-export
-export function debugConfig(config) {
+export function debugConfig(c) {
+ const config = c;
if (config.parameters.debug === 'tiles') {
const tileSize = lodashParseInt(config.parameters.tileSize);
if (lodashIsNaN(tileSize)) {
diff --git a/web/js/main.js b/web/js/main.js
index 0d99f287b..775738cf1 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -42,10 +42,11 @@ const errors = [];
/**
*
- * @param {*} config
+ * @param {*} configObj
* @param {*} legacyState
*/
-function render (config, legacyState) {
+function render (configObj, legacyState) {
+ const config = configObj;
config.parameters = parameters;
debugConfig(config);
@@ -102,7 +103,8 @@ window.onload = () => {
}
return response.json();
})
- .then((config) => {
+ .then((c) => {
+ const config = c;
// Perform check to see if app was in the midst of a tour
const hasTour = lodashGet(config, `stories[${parameters.tr}]`);
if (hasTour) {
diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.js
index 771f2d208..703766434 100644
--- a/web/js/map/compare/swipe.js
+++ b/web/js/map/compare/swipe.js
@@ -59,7 +59,8 @@ const setRectClipMask = function(context, coordinates) {
context.clip();
};
-const dragLine = function(listenerObj, lineCaseEl, map) {
+const dragLine = function(listenerObj, lineCase, map) {
+ const lineCaseEl = lineCase;
function move(evt) {
if (!dragging) {
dragging = true;
diff --git a/web/js/map/granule/granule-layer-builder.js b/web/js/map/granule/granule-layer-builder.js
index adbf9d82b..7b66d142d 100644
--- a/web/js/map/granule/granule-layer-builder.js
+++ b/web/js/map/granule/granule-layer-builder.js
@@ -116,10 +116,11 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
* Create collection of granule TileLayers from range of granule times
* @param {array} granueDates - array of dates (already sorted)
* @param {object} def - Layer specs
- * @param {object} attributes - Layer specs
+ * @param {object} attributesObj - Layer specs
* @returns {array} collection of OpenLayers TileLayers
*/
- const createGranuleTileLayers = (granules, def, attributes) => {
+ const createGranuleTileLayers = (granules, def, attributesObj) => {
+ const attributes = attributesObj;
const { period, id } = def;
const { group, proj } = attributes;
diff --git a/web/js/map/granule/util.js b/web/js/map/granule/util.js
index 36f22bc33..d9ac8fd54 100644
--- a/web/js/map/granule/util.js
+++ b/web/js/map/granule/util.js
@@ -121,7 +121,8 @@ export const getGranuleFootprints = (layer) => {
const { endDate, startDate } = def;
const mostRecentGranuleDate = granuleDates[0];
const isMostRecentDateOutOfRange = new Date(mostRecentGranuleDate) > new Date(endDate);
- const reduceFunc = (dates, { date, polygon }) => {
+ const reduceFunc = (granuleDates, { date, polygon }) => {
+ const dates = granuleDates;
const granuleDate = new Date(date);
if (!isMostRecentDateOutOfRange && isWithinDateRange(granuleDate, startDate, endDate)) {
dates[date] = polygon;
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 8a7368f42..8fbf07903 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -230,10 +230,11 @@ export default function mapLayerBuilder(config, cache, store) {
* @method createLayer
* @static
* @param {object} def - Layer Specs
- * @param {object} options - Layer options
+ * @param {object} optionsObj - Layer options
* @returns {object} OpenLayers layer
*/
- const createLayer = async (def, options = {}) => {
+ const createLayer = async (def, optionsObj = {}) => {
+ const options = optionsObj;
const state = store.getState();
const { compare: { activeString } } = state;
const { ui: { isKioskModeActive, displayStaticMap } } = state;
@@ -1196,14 +1197,15 @@ export default function mapLayerBuilder(config, cache, store) {
/**
* Create a new OpenLayers Layer
- * @param {object} def
+ * @param {object} definition
* @param {object} key
* @param {object} options
* @param {object} dateOptions
* @param {object} granuleAttributes
* @returns {object} Openlayers TileLayer or LayerGroup
*/
- const createLayerWrapper = async (def, key, options, dateOptions) => {
+ const createLayerWrapper = async (definition, key, options, dateOptions) => {
+ let def = definition;
const state = store.getState();
const { sidebar: { activeTab } } = state;
const proj = state.proj.selected;
diff --git a/web/js/map/map.js b/web/js/map/map.js
index f43b69b79..68fb72347 100644
--- a/web/js/map/map.js
+++ b/web/js/map/map.js
@@ -14,12 +14,13 @@ export const CRS_WGS_84_QUERY_EXTENT = [-180, -60, 180, 60];
* @method isExtentValid
* @static
*
- * @param extent {OpenLayers.Bound} The extent to check.
+ * @param extentBound {OpenLayers.Bound} The extent to check.
*
* @return {boolean} False if any of the values is NaN, otherwise returns
* true.
*/
-export function mapIsExtentValid(extent) {
+export function mapIsExtentValid(extentBound) {
+ let extent = extentBound;
if (lodashIsUndefined(extent)) {
return false;
}
@@ -43,19 +44,20 @@ export function mapIsExtentValid(extent) {
* then it is changed from a string to an array which is then
* made a global object.
*
- * @method parse
+ * @method mapParser
* @static
*
- * @param {string} extents string
+ * @param {object} stateObj object
*
- * @param {obj} Error
+ * @param {object} errors
*
* @returns {void}
*
* @todo would benefit by returning the array instead of attaching it to a global var
*/
-export function mapParser(state, errors) {
+export function mapParser(stateObj, errors) {
// 1.1 support
+ const state = stateObj;
if (state.map) {
state.v = state.map;
delete state.map;
@@ -82,10 +84,11 @@ export function mapParser(state, errors) {
* @method setOpacity
* @static
*
- * @param layer {OpenLayers.Layer} The layer to set the opacity
+ * @param olLayer {OpenLayers.Layer} The layer to set the opacity
* @param opacity {float} A value from 0 (transparent) to 1 (opaque).
*/
-export function setOpacity(layer, opacity) {
+export function setOpacity(olLayer, opacity) {
+ const layer = olLayer;
layer.setOpacity(opacity);
if (opacity === 1) {
const effect = layer.originalTransitionEffect || 'resize';
@@ -104,7 +107,7 @@ export function setOpacity(layer, opacity) {
* @method setVisibility
* @static
*
- * @param layer {OpenLayers.Layer} The layer to set the visibility.
+ * @param olLayer {OpenLayers.Layer} The layer to set the visibility.
*
* @param visible {boolean} True if the layer should be visible, otherwise
* false.
@@ -112,7 +115,8 @@ export function setOpacity(layer, opacity) {
* @param opacity {float} The opacity that this layer should be if it
* is visible. A value from 0 (transparent) to 1 (opaque).
*/
-export function setVisibility(layer, visible, opacity) {
+export function setVisibility(olLayer, visible, opacity) {
+ const layer = olLayer;
if (layer.isControl) {
layer.setVisibility(visible);
} else {
diff --git a/web/js/map/model.js b/web/js/map/model.js
index 68f071c0c..60a4942ec 100644
--- a/web/js/map/model.js
+++ b/web/js/map/model.js
@@ -113,12 +113,13 @@ export default function mapModel(models, config) {
* @method save
* @static
*
- * @param state {object} map state object from permalink
+ * @param stateObj {object} map state object from permalink
*
*
* @returns {void}
*/
- self.save = function(state) {
+ self.save = function(stateObj) {
+ const state = stateObj;
state.v = lodashClone(self.extent);
if (
self.rotation !== 0.0
diff --git a/web/js/map/natural-events/cluster.js b/web/js/map/natural-events/cluster.js
index 93d10ba17..6e0c092f9 100644
--- a/web/js/map/natural-events/cluster.js
+++ b/web/js/map/natural-events/cluster.js
@@ -13,7 +13,8 @@ export const naturalEventsClusterCreateObject = (proj) => new Supercluster({
radius: proj.selected.id === 'geographic' ? 0 : 60, // pixel radius where points are clustered
maxZoom: 12,
map: (props) => ({ startDate: props.date, endDate: props.date }),
- reduce: (accumulated, properties) => {
+ reduce: (accumulator, properties) => {
+ const accumulated = accumulator;
const newDate = properties.startDate;
const pastStartDate = accumulated.startDate;
const pastEndDate = accumulated.endDate;
diff --git a/web/js/map/util.js b/web/js/map/util.js
index 12ef880bf..dfa89c0c4 100644
--- a/web/js/map/util.js
+++ b/web/js/map/util.js
@@ -141,11 +141,12 @@ const getBestZoom = function(distance, start, end, view) {
/**
* Moves the map with a "flying" animation
*
- * @param {Array} endPoint Ending coordinates
+ * @param {Array} endPointArray Ending coordinates
* @param {integer} endZoom Ending Zoom Level
* @return {Promise} Promise that is fulfilled when animation completes
*/
-export function fly (map, proj, endPoint, endZoom = 5, rotation = 0, isKioskModeActive) {
+export function fly (map, proj, endPointArray, endZoom = 5, rotation = 0, isKioskModeActive) {
+ let endPoint = endPointArray;
const view = map.getView();
const polarProjectionCheck = proj.selected.id !== 'geographic'; // boolean if current projection is polar
view.cancelAnimations();
diff --git a/web/js/mapUI/components/create-map/createMap.js b/web/js/mapUI/components/create-map/createMap.js
index 1e716b78f..5395a0814 100644
--- a/web/js/mapUI/components/create-map/createMap.js
+++ b/web/js/mapUI/components/create-map/createMap.js
@@ -64,15 +64,16 @@ function CreateMap(props) {
/**
* Create map object
*
- * @method createMap
+ * @method mapCreation
* @static
*
* @param {object} proj - Projection properties
- * @param {object} dateSelected
+ * @param {object} uiCopyObj
*
* @returns {object} OpenLayers Map Object
*/
- const mapCreation = (proj, uiCopy) => {
+ const mapCreation = (proj, uiCopyObj) => {
+ const uiCopy = uiCopyObj;
const mapContainerEl = document.getElementById('wv-map');
const mapEl = document.createElement('div');
const id = `wv-map-${proj.id}`;
diff --git a/web/js/modules/animation/gifstream.js b/web/js/modules/animation/gifstream.js
index a2e8e2fec..bee37b774 100644
--- a/web/js/modules/animation/gifstream.js
+++ b/web/js/modules/animation/gifstream.js
@@ -234,10 +234,11 @@ export default class GifStream {
/**
* Generate GIF-creating Stream
* @param {Array} frames Array of GIF image objects
- * @param {Object} ctx 2d Canvas Cntext
+ * @param {Object} context 2d Canvas Context
* @return {Object} Returns GifWriter Stream
*/
- getStream(frames, ctx) {
+ getStream(frames, context) {
+ let ctx = context;
const { options } = this;
const width = options.gifWidth;
const height = options.gifHeight;
diff --git a/web/js/modules/animation/util.js b/web/js/modules/animation/util.js
index 99646f0f5..6bcaef552 100644
--- a/web/js/modules/animation/util.js
+++ b/web/js/modules/animation/util.js
@@ -73,11 +73,12 @@ export function getNumberOfSteps(start, end, interval, delta = 1, maxToCheck) {
export function getStampProps(
stampWidthRatio,
breakPoint,
- stampWidth,
+ stampWidthInt,
dimensions,
width,
height,
) {
+ let stampWidth = stampWidthInt;
const dateStamp = {};
let stampHeight;
let stampHeightByImageWidth;
@@ -124,10 +125,11 @@ export function svgToPng(svgURL, stampHeight) {
export function mapLocationToAnimationState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
const startDate = lodashGet(stateFromLocation, 'animation.startDate');
const endDate = lodashGet(stateFromLocation, 'animation.endDate');
if (parameters.playanim && parameters.ab) {
diff --git a/web/js/modules/charting/util.js b/web/js/modules/charting/util.js
index 963d81b64..9fccf6116 100644
--- a/web/js/modules/charting/util.js
+++ b/web/js/modules/charting/util.js
@@ -2,7 +2,8 @@ import update from 'immutability-helper';
import { initialChartingState } from './reducers';
import { formatDisplayDate } from '../date/util';
-export function mapLocationToChartingState(parameters, stateFromLocation) {
+export function mapLocationToChartingState(parameters, stateFromLocationObj) {
+ let stateFromLocation = stateFromLocationObj;
if (parameters.cha === 'true') {
stateFromLocation = update(stateFromLocation, {
charting: {
diff --git a/web/js/modules/combine-reducers.js b/web/js/modules/combine-reducers.js
index af3c4948f..3bf3bf05f 100644
--- a/web/js/modules/combine-reducers.js
+++ b/web/js/modules/combine-reducers.js
@@ -134,7 +134,8 @@ const appReducer = combineReducers(reducers);
/**
* Top level reducer function w/ option to reset state
*/
-export default (state, action) => {
+export default (stateObj, action) => {
+ let state = stateObj;
if (action.type === 'APP_RESET') {
state = undefined;
}
diff --git a/web/js/modules/compare/util.js b/web/js/modules/compare/util.js
index f318c7942..3cb508e26 100644
--- a/web/js/modules/compare/util.js
+++ b/web/js/modules/compare/util.js
@@ -2,7 +2,8 @@ import update from 'immutability-helper';
import { initialCompareState } from './reducers';
import { formatDisplayDate } from '../date/util';
-export function mapLocationToCompareState(parameters, stateFromLocation) {
+export function mapLocationToCompareState(parameters, stateFromLocationObj) {
+ let stateFromLocation = stateFromLocationObj;
if (parameters.ca !== undefined) {
stateFromLocation = update(stateFromLocation, {
compare: {
diff --git a/web/js/modules/date/util.js b/web/js/modules/date/util.js
index 675ac2ead..5049aa0eb 100644
--- a/web/js/modules/date/util.js
+++ b/web/js/modules/date/util.js
@@ -272,10 +272,11 @@ export function getLayersActiveAtDate(layers, date) {
*/
export function mapLocationToDateState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
const appNow = get(state, 'date.appNow');
// legacy time permalink
diff --git a/web/js/modules/embed/util.js b/web/js/modules/embed/util.js
index f898ded7c..85d904f30 100644
--- a/web/js/modules/embed/util.js
+++ b/web/js/modules/embed/util.js
@@ -13,8 +13,9 @@ import { getOverlayGroups } from '../layers/util';
// eslint-disable-next-line import/prefer-default-export
export function mapLocationToEmbedState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
) {
+ let stateFromLocation = stateFromLocationObj;
if (parameters.em === 'true') {
const { layers } = stateFromLocation;
const layersClone = lodashCloneDeep(layers);
diff --git a/web/js/modules/layers/actions.js b/web/js/modules/layers/actions.js
index bca0d54ec..c4fb29d15 100644
--- a/web/js/modules/layers/actions.js
+++ b/web/js/modules/layers/actions.js
@@ -55,7 +55,10 @@ export function activateLayersForEventCategory(category) {
const overlayGroups = getOverlayGroups(newLayers);
const newEventLayers = findEventLayers(originalLayers, newLayers);
- overlayGroups.forEach((group) => { group.collapsed = true; });
+ overlayGroups.forEach((groupObj) => {
+ const group = groupObj;
+ group.collapsed = true;
+ });
dispatch({
type: ADD_LAYERS_FOR_EVENT,
@@ -225,7 +228,8 @@ export function toggleGroupVisibility(ids, visible) {
return (dispatch, getState) => {
const { compare } = getState();
const activeLayers = getActiveLayersSelector(getState());
- activeLayers.forEach((layer) => {
+ activeLayers.forEach((layerObj) => {
+ const layer = layerObj;
if (ids.includes(layer.id)) {
layer.visible = visible;
}
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index 303054499..193d71d37 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -485,7 +485,8 @@ export function getLayers(state, spec = {}, layersParam) {
* @param {*} date
* @param {*} state
*/
-export function isRenderable(id, layers, date, bLayers, state) {
+export function isRenderable(id, layers, dateString, bLayers, state) {
+ let date = dateString;
const { parameters } = state.config || {};
date = date || getSelectedDate(state);
const def = lodashFind(layers, { id });
diff --git a/web/js/modules/layers/selectors.test.js b/web/js/modules/layers/selectors.test.js
index b68a1f0ca..d3356c684 100644
--- a/web/js/modules/layers/selectors.test.js
+++ b/web/js/modules/layers/selectors.test.js
@@ -232,7 +232,8 @@ test('move overlay before', () => {
});
// Date Ranges
-function getDateRangesTestState(state) {
+function getDateRangesTestState(stateObj) {
+ let state = stateObj;
const today = new Date(Date.UTC(2010, 0, 1));
util.now = () => today;
const layers = {
diff --git a/web/js/modules/layers/util.js b/web/js/modules/layers/util.js
index 19a1942cc..79ac6096e 100644
--- a/web/js/modules/layers/util.js
+++ b/web/js/modules/layers/util.js
@@ -1108,7 +1108,8 @@ export function dateOverlap(period, dateRanges) {
});
const result = sortedRanges.reduce(
- (result, current, idx, arr) => {
+ (resultObj, current, idx, arr) => {
+ const result = resultObj;
// get the previous range
if (idx === 0) {
return result;
@@ -1171,7 +1172,8 @@ export function dateOverlap(period, dateRanges) {
export function layersParse11(str, config) {
const layers = [];
const ids = str.split(/[~,.]/);
- lodashEach(ids, (id) => {
+ lodashEach(ids, (idString) => {
+ let id = idString;
if (id === 'baselayers' || id === 'overlays') {
return;
}
@@ -1452,7 +1454,8 @@ export function adjustStartDates(layers) {
.subtract(days * 24, 'hours')
.format('YYYY-MM-DDThh:mm:ss')}Z`;
- const applyDateAdjustment = (layer) => {
+ const applyDateAdjustment = (layerObj) => {
+ const layer = layerObj;
const { availability, dateRanges, endDate } = layer;
if (!availability) {
return;
@@ -1516,7 +1519,8 @@ export const getCacheOptions = (period, date, state) => {
*/
export function adjustActiveDateRanges(layers, appNow) {
const appNowYear = appNow.getUTCFullYear();
- const applyDateRangeAdjustment = (layer) => {
+ const applyDateRangeAdjustment = (layerObj) => {
+ const layer = layerObj;
const { dateRanges } = layer;
const { ongoing, period } = layer;
const failConditions = !ongoing
@@ -1606,7 +1610,8 @@ export function adjustActiveDateRanges(layers, appNow) {
* @returns {Array} array of layers
*/
export function adjustEndDates(layers) {
- const applyDateAdjustment = (layer) => {
+ const applyDateAdjustment = (layerObj) => {
+ const layer = layerObj;
const { futureTime, dateRanges } = layer;
if (!futureTime) {
return;
@@ -1632,7 +1637,8 @@ export function adjustEndDates(layers) {
* @param {String} mockFutureLayerParameters 'targetLayerId, mockFutureTime'
* @returns {Void}
*/
-export function mockFutureTimeLayerOptions(layers, mockFutureLayerParameters) {
+export function mockFutureTimeLayerOptions(layersObj, mockFutureLayerParameters) {
+ const layers = layersObj;
const urlParameters = mockFutureLayerParameters.split(',');
const [targetLayerId, mockFutureTime] = urlParameters;
@@ -1653,7 +1659,8 @@ export function getLayersFromGroups (state, groups) {
export function adjustMeasurementsValidUnitConversion(config) {
const { measurements, layers } = config;
- const applyDisableUnitConversionCheck = (layer) => {
+ const applyDisableUnitConversionCheck = (layerObj) => {
+ const layer = layerObj;
const { layergroup } = layer;
if (!layergroup || !measurements[layergroup]) {
return;
diff --git a/web/js/modules/location-search/util.js b/web/js/modules/location-search/util.js
index e76b4a431..e8a526de3 100644
--- a/web/js/modules/location-search/util.js
+++ b/web/js/modules/location-search/util.js
@@ -121,9 +121,10 @@ export function getLocalStorageCollapseState() {
*/
export function mapLocationToLocationSearchState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
) {
+ let stateFromLocation = stateFromLocationObj;
const { s } = parameters;
const coordinatesArray = s ? s.split('+') : [];
const isValid = coordinatesArray.length >= 1;
diff --git a/web/js/modules/map/util.js b/web/js/modules/map/util.js
index 509842335..3403da3ec 100644
--- a/web/js/modules/map/util.js
+++ b/web/js/modules/map/util.js
@@ -56,15 +56,16 @@ export function getRotatedExtent(map) {
/**
* Determines if an exent object contains valid values.
*
- * @method isExtentValid
+ * @method mapIsExtentValid
* @static
*
- * @param extent {OpenLayers.Bound} The extent to check.
+ * @param extentBound {OpenLayers.Bound} The extent to check.
*
* @return {boolean} False if any of the values is NaN, otherwise returns
* true.
*/
-export function mapIsExtentValid(extent) {
+export function mapIsExtentValid(extentBound) {
+ let extent = extentBound;
if (lodashIsUndefined(extent)) {
return false;
}
@@ -111,7 +112,8 @@ export function getMapParameterSetup(
}
return extent;
},
- serialize: (currentItemState, currentState) => {
+ serialize: (currentItemStateObj, currentState) => {
+ let currentItemState = currentItemStateObj;
const rotation = lodashGet(currentState, 'map.rotation');
if (rotation) {
diff --git a/web/js/modules/palettes/selectors.js b/web/js/modules/palettes/selectors.js
index f942015d6..85deaf92c 100644
--- a/web/js/modules/palettes/selectors.js
+++ b/web/js/modules/palettes/selectors.js
@@ -29,15 +29,20 @@ export function getRenderedPalette(layerId, index, state) {
* Gets a single colormap (entries / legend combo)
*
*
- * @method get
+ * @method getPalette
* @static
- * @param str {string} The ID of the layer
- * @param number {Number} The index of the colormap for this layer, default 0
+ * @param layerIdStr {string} The ID of the layer
+ * @param indexNum {Number} The index of the colormap for this layer, default 0
* object.
+ * @param groupStr {String}
+ * @param stateObj {Object}
* @return {object} object including the entries and legend
*/
-export function getPalette(layerId, index, groupStr, state) {
- groupStr = groupStr || state.compare.activeString;
+export function getPalette(layerIdStr, indexNum, groupStr, state) {
+ const layerId = layerIdStr;
+ let index = indexNum;
+ let group = groupStr;
+ group = group || state.compare.activeString;
index = lodashIsUndefined(index) ? 0 : index;
const renderedPalette = lodashGet(
state,
@@ -45,7 +50,7 @@ export function getPalette(layerId, index, groupStr, state) {
);
const customPalette = lodashGet(
state,
- `palettes['${groupStr}']['${layerId}'].maps[${index}]`,
+ `palettes['${group}']['${layerId}'].maps[${index}]`,
);
if (customPalette) {
@@ -117,7 +122,8 @@ export function getCustomPalette(paletteId, customsPaletteConfig) {
const useLookup = function(layerId, palettesObj, state) {
let use = false;
const active = palettesObj[layerId].maps;
- lodashEach(active, (palette, index) => {
+ lodashEach(active, (paletteObj, index) => {
+ const palette = paletteObj;
if (palette.custom) {
use = true;
return false;
@@ -143,7 +149,8 @@ const useLookup = function(layerId, palettesObj, state) {
};
// Looks up options/colormaps/layer.xml colormap entry
-export function getLookup(layerId, groupstr, state) {
+export function getLookup(layerId, group, state) {
+ let groupstr = group;
groupstr = groupstr || state.compare.activeString;
return state.palettes[groupstr][layerId].lookup;
}
@@ -292,7 +299,8 @@ const toggleLookup = function(layerId, palettesObj, state) {
return update(newPalettes, { [layerId]: { lookup: { $set: lookup } } });
};
-export function findIndex(layerId, value, index, groupStr, state) {
+export function findIndex(layerId, value, indexInt, groupStr, state) {
+ let index = indexInt;
index = index || 0;
const { values } = getPalette(layerId, index, groupStr, state).entries;
let result;
@@ -325,8 +333,9 @@ function prepare(layerId, palettesObj, state) {
return newPalettes;
}
-export function setCustomSelector(layerId, paletteId, index, groupName, state) {
+export function setCustomSelector(layerId, paletteId, indexObj, groupName, state) {
const { config, palettes } = state;
+ let index = indexObj;
if (!config.layers[layerId]) {
throw new Error(`Invalid layer: ${layerId}`);
}
@@ -341,18 +350,19 @@ export function setCustomSelector(layerId, paletteId, index, groupName, state) {
return updateLookup(layerId, newPalettes, state);
}
-export function isActive(layerId, group, state) {
+export function isActive(layerId, groupStr, state) {
+ let group = groupStr;
group = group || state.compare.activeString;
return state.palettes[group][layerId];
}
export function getKey(layerId, groupStr, state) {
- groupStr = groupStr || state.compare.activeString;
- if (!isActive(layerId, groupStr, state)) {
+ const group = groupStr || state.compare.activeString;
+ if (!isActive(layerId, group, state)) {
return '';
}
- const def = getPalette(layerId, undefined, groupStr, state);
- const { values } = getPalette(layerId, 0, groupStr, state).entries;
+ const def = getPalette(layerId, undefined, group, state);
+ const { values } = getPalette(layerId, 0, group, state).entries;
const keys = [];
if (def.custom) {
keys.push(`palette=${def.custom}`);
@@ -446,7 +456,8 @@ export function setDisabledSelector(
return updateLookup(layerId, newPalettes, state);
}
-export function setRange(layerId, props, index, palettes, state) {
+export function setRange(layerId, props, indexInt, palettes, state) {
+ let index = indexInt;
let { min } = props;
let { max } = props;
const { squash } = props;
@@ -482,7 +493,8 @@ export function setRange(layerId, props, index, palettes, state) {
return updateLookup(layerId, newPalettes, state);
}
-export function clearCustomSelector(layerId, index, palettes, state) {
+export function clearCustomSelector(layerId, indexInt, palettes, state) {
+ let index = indexInt;
index = lodashIsUndefined(index) ? 0 : index;
const active = palettes[layerId];
if (!active) {
diff --git a/web/js/modules/palettes/util.js b/web/js/modules/palettes/util.js
index bc1592c5a..e2713d86e 100644
--- a/web/js/modules/palettes/util.js
+++ b/web/js/modules/palettes/util.js
@@ -233,10 +233,11 @@ export function getMaxValue(v) {
*/
export function parseLegacyPalettes(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
const parts = parameters.palettes.split('~');
parts.forEach((part) => {
const items = part.split(',');
@@ -264,7 +265,8 @@ export function parseLegacyPalettes(
return stateFromLocation;
}
-const createPaletteAttributeObject = function(def, value, attrObj, count) {
+const createPaletteAttributeObject = function(def, valueArray, attrObj, count) {
+ let value = valueArray;
const { key } = attrObj;
const attrArray = attrObj.array;
let hasAtLeastOnePair = attrObj.isActive;
@@ -375,7 +377,8 @@ export function getPaletteAttributeArray(layerId, palettes, state) {
* @param {Object} permlinkState | parameters parsed from permalink
* @param {Object} state
*/
-export function loadPalettes(permlinkState, state) {
+export function loadPalettes(permlinkState, stateObject) {
+ let state = stateObject;
let stateArray = [{ stateStr: 'l', groupStr: 'active' }];
if (permlinkState.l1) {
stateArray = [
@@ -491,10 +494,11 @@ export function loadPalettes(permlinkState, state) {
export function mapLocationToPaletteState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
if (parameters.l1 || parameters.l) {
stateFromLocation = loadPalettes(
parameters,
@@ -523,7 +527,8 @@ export function mapLocationToPaletteState(
* @param {Boolean} customLoaded
* @returns {Promise}
*/
-export function preloadPalettes(layersArray, renderedPalettes, customLoaded) {
+export function preloadPalettes(layersArray, renderedPalettes, customLoadedBool) {
+ let customLoaded = customLoadedBool;
const rendered = renderedPalettes || {};
customLoaded = customLoaded || false;
let preloadedCustom = false;
diff --git a/web/js/modules/product-picker/format-config.js b/web/js/modules/product-picker/format-config.js
index ce2cd0610..ff8ba5f4a 100644
--- a/web/js/modules/product-picker/format-config.js
+++ b/web/js/modules/product-picker/format-config.js
@@ -14,7 +14,8 @@ function capitalizeFirstLetter(string) {
return !string ? '' : string.charAt(0).toUpperCase() + string.slice(1);
}
-function setLayerProp (layer, prop, value) {
+function setLayerProp (layerObj, prop, value) {
+ const layer = layerObj;
const featuredMeasurement = prop === 'measurements' && (value && value.includes('Featured'));
if (!layer || featuredMeasurement || !value) {
return;
@@ -67,7 +68,8 @@ function setMeasurementCategoryProps(layers, { measurements, categories }) {
return layers;
}
-function setCoverageFacetProp(layer, selectedDate) {
+function setCoverageFacetProp(layerObj, selectedDate) {
+ const layer = layerObj;
const {
id, startDate, endDate, dateRanges,
} = layer;
@@ -79,7 +81,8 @@ function setCoverageFacetProp(layer, selectedDate) {
}
}
-function setTypeProp(layer) {
+function setTypeProp(layerObj) {
+ const layer = layerObj;
const { type } = layer;
const rasterTypes = ['wms', 'wmts', 'xyz', 'composite:wmts'];
const vectorTypes = ['vector', 'indexedVector'];
@@ -99,7 +102,8 @@ function setTypeProp(layer) {
return layer;
}
-function setChartableProp(layer) {
+function setChartableProp(layerObj) {
+ const layer = layerObj;
if (!(Object.prototype.hasOwnProperty.call(layer, 'palette') && Object.prototype.hasOwnProperty.call(layer, 'colormapType') && layer.colormapType === 'continuous' && layer.layerPeriod === 'Daily') || layer.disableCharting) {
return;
}
@@ -114,7 +118,8 @@ export default function buildLayerFacetProps(config, selectedDate) {
let layers = lodashCloneDeep(config.layers);
layers = setMeasurementCategoryProps(layers, config);
- return lodashMap(layers, (layer) => {
+ return lodashMap(layers, (layerObj) => {
+ const layer = layerObj;
setCoverageFacetProp(layer, selectedDate);
setLayerProp(layer, 'sources', layer.subtitle);
setTypeProp(layer);
diff --git a/web/js/modules/product-picker/search-config.js b/web/js/modules/product-picker/search-config.js
index c4bc0c4fe..81147aa76 100644
--- a/web/js/modules/product-picker/search-config.js
+++ b/web/js/modules/product-picker/search-config.js
@@ -138,7 +138,8 @@ function updateCoverageFilter (filters, selectedDate) {
const formattedDate = formatDisplayDate(selectedDate);
const oldValueMatch = (value) => !value.includes(formattedDate) && !value.includes('Always');
- filters.forEach((f) => {
+ filters.forEach((filter) => {
+ const f = filter;
if (f.field !== 'coverage') return;
f.values = f.values.map(
(value) => (oldValueMatch(value) ? `Available ${formattedDate}` : value),
diff --git a/web/js/modules/product-picker/selectors.js b/web/js/modules/product-picker/selectors.js
index 2c36fe153..25204e7b6 100644
--- a/web/js/modules/product-picker/selectors.js
+++ b/web/js/modules/product-picker/selectors.js
@@ -19,7 +19,8 @@ export const getLayersForProjection = createSelector(
const layersWithFacetProps = buildLayerFacetProps(config, selectedDate)
// Only use the layers for the active projection
.filter((layer) => layer.projections && layer.projections[projection])
- .map((layer) => {
+ .map((layerObj) => {
+ const layer = layerObj;
// If there is metadata for the current projection, use that
const projectionMeta = layer.projections[projection];
if (projectionMeta.title) layer.title = projectionMeta.title;
diff --git a/web/js/modules/projection/util.js b/web/js/modules/projection/util.js
index 7e6a79266..cd330ea5f 100644
--- a/web/js/modules/projection/util.js
+++ b/web/js/modules/projection/util.js
@@ -23,7 +23,8 @@ export function parseProjection(str, config) {
* @param {Object} stateFromLocation | State derived from permalink parsers
* @param {Object} state | initial state before location POP action
*/
-export function mapLocationToProjState(parameters, stateFromLocation, state) {
+export function mapLocationToProjState(parameters, stateFromLocationObj, state) {
+ let stateFromLocation = stateFromLocationObj;
const projId = lodashGet(stateFromLocation, 'proj.id');
if (parameters.p) {
const selected = lodashGet(state, `config.projections.${projId}`);
diff --git a/web/js/modules/sidebar/util.js b/web/js/modules/sidebar/util.js
index 7245b4a5c..4e1d03994 100644
--- a/web/js/modules/sidebar/util.js
+++ b/web/js/modules/sidebar/util.js
@@ -10,10 +10,11 @@ import update from 'immutability-helper';
*/
export default function mapLocationToSidebarState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
let activeTab;
if (parameters.e) {
activeTab = 'events';
diff --git a/web/js/modules/tour/util.js b/web/js/modules/tour/util.js
index 16f9995ce..a06ce32c4 100644
--- a/web/js/modules/tour/util.js
+++ b/web/js/modules/tour/util.js
@@ -14,10 +14,11 @@ const { HIDE_TOUR } = safeLocalStorage.keys;
*/
export function mapLocationToTourState(
parameters,
- stateFromLocation,
+ stateFromLocationObj,
state,
config,
) {
+ let stateFromLocation = stateFromLocationObj;
const isEmbedModeActive = parameters.em && parameters.em === 'true';
if (parameters.tr && isEmbedModeActive) {
stateFromLocation = update(stateFromLocation, {
diff --git a/web/js/modules/vector-styles/selectors.js b/web/js/modules/vector-styles/selectors.js
index 1fafba2e4..20ee8cb73 100644
--- a/web/js/modules/vector-styles/selectors.js
+++ b/web/js/modules/vector-styles/selectors.js
@@ -56,14 +56,13 @@ export function getAllVectorStyles(layerId, index, state) {
/**
* Gets a single colormap (entries / legend combo)
*
- * @param str {string} The ID of the layer
- * @param number {Number} The index of the colormap for this layer, default 0
+ * @param layerId {string} The ID of the layer
+ * @param index {Number} The index of the colormap for this layer, default 0
* object.
* @return {object} object including the entries and legend
*/
-export function getVectorStyle(layerId, index, groupStr, state) {
- groupStr = groupStr || state.compare.activeString;
- index = lodashIsUndefined(index) ? 0 : index;
+export function getVectorStyle(layerId, indexInt, state) {
+ const index = lodashIsUndefined(indexInt) ? 0 : indexInt;
const renderedVectorStyle = lodashGet(
state,
`vectorStyles.${layerId}.layers.${index}`,
@@ -74,9 +73,10 @@ export function getVectorStyle(layerId, index, groupStr, state) {
return getAllVectorStyles(layerId, index, state);
}
-export function findIndex(layerId, type, value, index, groupStr, state) {
+export function findIndex(layerId, type, value, indexInt, state) {
+ let index = indexInt;
index = index || 0;
- const { values } = getVectorStyle(layerId, index, groupStr, state).entries;
+ const { values } = getVectorStyle(layerId, index, state).entries;
let result;
lodashEach(values, (check, index) => {
const min = getMinValue(check);
@@ -249,7 +249,8 @@ export function setStyleFunction(opts) {
return vectorStyleId;
}
-export function isActive(layerId, group, state) {
+export function isActive(layerId, groupObj, state) {
+ let group = groupObj;
group = group || state.compare.activeString;
if (state.vectorStyles.custom[layerId]) {
return state.vectorStyles[group][layerId];
@@ -257,12 +258,13 @@ export function isActive(layerId, group, state) {
return undefined;
}
-export function getKey(layerId, groupStr, state) {
+export function getKey(layerId, group, state) {
+ let groupStr = group;
groupStr = groupStr || state.compare.activeString;
if (!isActive(layerId, groupStr, state)) {
return '';
}
- const def = getVectorStyle(layerId, undefined, groupStr, state);
+ const def = getVectorStyle(layerId, undefined, state);
const keys = [];
if (def.custom) {
keys.push(`style=${def.custom}`);
@@ -276,7 +278,8 @@ export function getKey(layerId, groupStr, state) {
return keys.join(',');
}
-export function clearStyleFunction(def, vectorStyleId, vectorStyles, layer, state) {
+export function clearStyleFunction(def, vectorStyleId, vectorStyles, layerObj, state) {
+ let layer = layerObj;
const layerId = def.id;
const glStyle = vectorStyles[layerId];
const olMap = lodashGet(state, 'legacy.map.ui.selected');
diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.js
index 1112cc6dc..e58f56a35 100644
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@ -328,7 +328,8 @@ export function onMapClickGetVectorFeatures(pixels, map, state, swipeOffset, mod
};
}
-export function updateVectorSelection(selectionObj, lastSelection, layers, type, state) {
+export function updateVectorSelection(selectionObj, lastSelectionObj, layers, type, state) {
+ const lastSelection = lastSelectionObj;
const { config: { vectorStyles } } = state;
const vectorLayers = getVectorLayers(state);
diff --git a/web/js/redux-location-state-customs.js b/web/js/redux-location-state-customs.js
index 6134ea725..c98b01136 100644
--- a/web/js/redux-location-state-customs.js
+++ b/web/js/redux-location-state-customs.js
@@ -41,7 +41,8 @@ export function stateToParams(initialState, currentState, location) {
}
const shouldPush = false;
// check the original config for values
- const newQueryParams = Object.keys(pathConfig).reduce((prev, curr) => {
+ const newQueryParams = Object.keys(pathConfig).reduce((previous, curr) => {
+ const prev = previous;
const {
stateKey,
options = {},
diff --git a/web/js/util/load.js b/web/js/util/load.js
index 6215fd4f1..fda54562b 100644
--- a/web/js/util/load.js
+++ b/web/js/util/load.js
@@ -5,7 +5,8 @@ export default (function() {
const self = {};
const configPromises = {};
- self.config = function(root, attr, url) {
+ self.config = function(rootObj, attr, url) {
+ const root = rootObj;
let promise = Promise;
// If a request is already outstanding, chain to that one
diff --git a/web/js/util/util.js b/web/js/util/util.js
index e1589ee42..0b20a9295 100644
--- a/web/js/util/util.js
+++ b/web/js/util/util.js
@@ -9,7 +9,8 @@ import safeLocalStorage from './local-storage';
const { COORDINATE_FORMAT } = safeLocalStorage.keys;
-export default (function(self) {
+export default (function(selfObj) {
+ const self = selfObj;
let canvas = null;
// Export other util methods
@@ -25,7 +26,8 @@ export default (function(self) {
return result;
};
- self.pad = function(value, width, padding) {
+ self.pad = function(valueStr, width, padding) {
+ let value = valueStr;
value = `${value}`;
if (value.length < width) {
const add = width - value.length;
@@ -54,7 +56,8 @@ export default (function(self) {
* object.
* @return {object} object representation of the query string.
*/
- self.fromQueryString = function(queryString) {
+ self.fromQueryString = function(queryStringValue) {
+ let queryString = queryStringValue;
if (!queryString) {
return {};
}
@@ -237,7 +240,8 @@ export default (function(self) {
* @param {Boolean} shouldRemoveTime if the time should be removed from the date
* @return {string} ISO string in the form of `YYYY-MM-DDThh:mm:ssZ`.
*/
- self.toISOStringSeconds = function(date, shouldRemoveTime = false) {
+ self.toISOStringSeconds = function(dateToConvert, shouldRemoveTime = false) {
+ let date = dateToConvert;
const isString = typeof date === 'string' || date instanceof String;
if (shouldRemoveTime) date = self.clearTimeUTC(date);
const dateString = isString ? date : date.toISOString();
@@ -586,7 +590,8 @@ export default (function(self) {
DOWN: 40,
};
- function formatDegrees(value, type, withSeconds) {
+ function formatDegrees(degreeValue, type, withSeconds) {
+ let value = degreeValue;
let width; let
signs;
if (type === 'longitude') {
@@ -672,7 +677,8 @@ export default (function(self) {
return formatted;
};
- self.toArray = function(value) {
+ self.toArray = function(nonArrayValue) {
+ let value = nonArrayValue;
if (!value) {
return [];
}