Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

lint fixes, merge

Ed Platoeb80e0949d0e
diff --git a/e2e/features/ui/distraction-free-mode-test.js b/e2e/features/ui/distraction-free-mode-test.js
index 93e300446..599661093 100644
--- a/e2e/features/ui/distraction-free-mode-test.js
+++ b/e2e/features/ui/distraction-free-mode-test.js
@@ -1,14 +1,15 @@
const reuseables = require('../../reuseables/skip-tour.js');
const localSelectors = require('../../reuseables/selectors.js');
+
const TIME_LIMIT = 5000;
module.exports = {
- before: client => {
+ before: (client) => {
reuseables.loadAndSkipTour(client, TIME_LIMIT);
},
// verify distraction free mode shortcut hides ui elements
- 'Enabling distraction free mode with shortcut key hides UI elements': client => {
+ 'Enabling distraction free mode with shortcut key hides UI elements': (client) => {
client.pause(300);
client.sendKeys('body', [client.Keys.SHIFT, 'd', client.Keys.NULL]);
client.pause(300);
@@ -26,7 +27,7 @@ module.exports = {
},
// verify turning off distraction free mode shortcut returns hidden ui elements
- 'Disabling distraction free mode with shortcut key returns UI elements': client => {
+ 'Disabling distraction free mode with shortcut key returns UI elements': (client) => {
client.pause(300);
client.sendKeys('body', [client.Keys.SHIFT, 'd', client.Keys.NULL]);
client.pause(300);
@@ -43,7 +44,7 @@ module.exports = {
client.waitForElementPresent('.wv-map-scale-imperial', TIME_LIMIT);
},
- after: client => {
+ after: (client) => {
client.end();
- }
+ },
};
diff --git a/web/js/components/map/coordinates.test.js b/web/js/components/map/coordinates.test.js
index b71c7b176..82414728a 100644
--- a/web/js/components/map/coordinates.test.js
+++ b/web/js/components/map/coordinates.test.js
@@ -1,7 +1,7 @@
/* eslint-disable no-restricted-syntax */
import React from 'react';
import renderer from 'react-test-renderer';
-import Coordinates from './coordinates';
+import { Coordinates } from './coordinates';
describe('formats', () => {
const formats = ['latlon-dd', 'latlon-dm', 'latlon-dms'];
diff --git a/web/js/components/map/ol-coordinates.js b/web/js/components/map/ol-coordinates.js
index 40d5d39fb..68cd20b21 100644
--- a/web/js/components/map/ol-coordinates.js
+++ b/web/js/components/map/ol-coordinates.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { transform } from 'ol/proj';
-import Coordinates from './coordinates';
+import { Coordinates } from './coordinates';
import util from '../../util/util';
export class OlCoordinates extends React.Component {
diff --git a/web/js/components/map/ol-coordinates.test.js b/web/js/components/map/ol-coordinates.test.js
index f4aaf4ac9..55f05b2cc 100644
--- a/web/js/components/map/ol-coordinates.test.js
+++ b/web/js/components/map/ol-coordinates.test.js
@@ -1,8 +1,8 @@
import React from 'react';
+import renderer from 'react-test-renderer';
import util from '../../util/util';
import { OlCoordinates } from './ol-coordinates';
import { registerProjections } from '../../fixtures';
-import renderer from 'react-test-renderer';
let events;
let component;
@@ -14,7 +14,7 @@ beforeEach(() => {
component = renderer.create(
<OlCoordinates
mouseEvents={events}
- />
+ />,
);
map = {
getEventPixel: jest.fn(),
diff --git a/web/js/components/timeline/distraction-free-time.js b/web/js/components/timeline/distraction-free-time.js
index 44ab5d5f0..587023839 100644
--- a/web/js/components/timeline/distraction-free-time.js
+++ b/web/js/components/timeline/distraction-free-time.js
@@ -25,7 +25,7 @@ class DistractionFreeTimeUI extends PureComponent {
// display date as '2000-10-28' for default or '2000-10-28 20:28Z' for subdaily
let displayDate;
if (hasSubdailyLayers) {
- displayDate = dateFirstHalfYMD.join(' ') + ' ' + dateSecondHalfHM;
+ displayDate = `${dateFirstHalfYMD.join(' ')} ${dateSecondHalfHM}`;
} else {
displayDate = dateFirstHalfYMD.join(' ');
}
@@ -34,7 +34,7 @@ class DistractionFreeTimeUI extends PureComponent {
<div
className="distraction-free-date"
style={{
- opacity: isHoverOverDistractionFreeTimeUI ? '0' : '1'
+ opacity: isHoverOverDistractionFreeTimeUI ? '0' : '1',
}}
onMouseOver={this.handleMouseOver}
>
@@ -48,7 +48,7 @@ DistractionFreeTimeUI.propTypes = {
date: PropTypes.string,
hasSubdailyLayers: PropTypes.bool,
hoverOverDistractionFreeTimeUI: PropTypes.func,
- isHoverOverDistractionFreeTimeUI: PropTypes.bool
+ isHoverOverDistractionFreeTimeUI: PropTypes.bool,
};
export default DistractionFreeTimeUI;
diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.js
index 7d6d20c06..d34c4b40d 100644
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@ -39,7 +39,7 @@ const resetWorldview = function(e, isDistractionFreeModeActive) {
e.preventDefault();
if (!isDistractionFreeModeActive && window.location.search === '') return; // Nothing to reset
const msg = 'Do you want to reset Worldview to its defaults? You will lose your current state.';
- if (confirm(msg)) {
+ if (window.confirm(msg)) {
googleTagManager.pushEvent({
event: 'logo_page_reset',
});
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 6f9a65a42..9400345da 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -570,8 +570,9 @@ class Timeline extends React.Component {
* @returns {void}
*/
toggleHideTimeline = () => {
+ const { timelineHidden } = this.state;
this.setState({
- timelineHidden: !this.state.timelineHidden,
+ timelineHidden: !timelineHidden,
});
};
@@ -585,9 +586,10 @@ class Timeline extends React.Component {
* @returns {void}
*/
updateAnimationDateAndLocation = (startDate, endDate, startLocation, endLocation, isDragging) => {
+ const { animationStartLocation, animationEndLocation } = this.state;
this.setState({
- animationStartLocation: startLocation || this.state.animationStartLocation,
- animationEndLocation: endLocation || this.state.animationEndLocation,
+ animationStartLocation: startLocation || animationStartLocation,
+ animationEndLocation: endLocation || animationEndLocation,
animationStartLocationDate: startDate,
animationEndLocationDate: endDate,
isAnimationDraggerDragging: isDragging,
@@ -671,31 +673,34 @@ class Timeline extends React.Component {
* @desc update state dragger position and if new date, change store date
* @param {String} newDate - new dragger date
* @param {String} draggerSelected
- * @param {Number} draggerPosition
- * @param {Boolean} draggerVisible
- * @param {Boolean} otherDraggerVisible
- * @param {Boolean} hasMoved
+ * @param {Number} draggerPositionArg
+ * @param {Boolean} draggerVisibleArg
+ * @param {Boolean} otherDraggerVisibleArg
+ * @param {Boolean} hasMovedArg
* @returns {void}
*/
- updateDraggerDatePosition = (newDate, draggerSelected, draggerPosition, draggerVisible, otherDraggerVisible, hasMoved) => {
+ updateDraggerDatePosition = (newDate, draggerSelected, draggerPositionArg, draggerVisibleArg, otherDraggerVisibleArg, hasMovedArg) => {
+ const {
+ draggerPosition, draggerPositionB, draggerVisible, draggerVisibleB, draggerTimeState, draggerTimeStateB, hasMoved,
+ } = this.state;
if (draggerSelected === 'selected') {
this.setState({
- draggerPosition: draggerPosition || this.state.draggerPosition,
- draggerVisible: draggerVisible || this.state.draggerVisible,
- draggerVisibleB: otherDraggerVisible || this.state.draggerVisibleB,
- draggerTimeState: newDate || this.state.draggerTimeState,
- hasMoved: hasMoved || this.state.hasMoved,
+ draggerPosition: draggerPositionArg || draggerPosition,
+ draggerVisible: draggerVisibleArg || draggerVisible,
+ draggerVisibleB: otherDraggerVisibleArg || draggerVisibleB,
+ draggerTimeState: newDate || draggerTimeState,
+ hasMoved: hasMovedArg || hasMoved,
});
if (newDate) {
this.onDateChange(newDate, 'selected');
}
} else {
this.setState({
- draggerPositionB: draggerPosition || this.state.draggerPositionB,
- draggerVisible: otherDraggerVisible || this.state.draggerVisible,
- draggerVisibleB: draggerVisible || this.state.draggerVisibleB,
- draggerTimeStateB: newDate || this.state.draggerTimeStateB,
- hasMoved: hasMoved || this.state.hasMoved,
+ draggerPositionB: draggerPositionArg || draggerPositionB,
+ draggerVisible: otherDraggerVisibleArg || draggerVisible,
+ draggerVisibleB: draggerVisibleArg || draggerVisibleB,
+ draggerTimeStateB: newDate || draggerTimeStateB,
+ hasMoved: hasMovedArg || hasMoved,
});
if (newDate) {
this.onDateChange(newDate, 'selectedB');