Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

eslint and stylelint updates

ZachTRice3969e79f2864
diff --git a/.eslintrc b/.eslintrc
index fac57a149..b0664159a 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -16,7 +16,8 @@
"rules": {
"no-undef": "off",
"n/no-unpublished-require": "off",
- "no-unused-expressions": "off"
+ "no-unused-expressions": "off",
+ "prefer-regex-literals": "warn"
}
}
]
diff --git a/.stylelintrc b/.stylelintrc
index f0b36a37e..3fb9c283a 100644
--- a/.stylelintrc
+++ b/.stylelintrc
@@ -6,6 +6,7 @@
"ignore": "paint-properties"
}],
"no-descending-specificity": null,
- "selector-class-pattern": null
+ "selector-class-pattern": null,
+ "selector-not-notation": null
}
}
diff --git a/tasks/build-options/processColormap.js b/tasks/build-options/processColormap.js
index f2be035d8..2a76eb5b7 100755
--- a/tasks/build-options/processColormap.js
+++ b/tasks/build-options/processColormap.js
@@ -134,8 +134,6 @@ async function processEntries (colormap) {
await Promise.all(
entries.map(async (entry) => {
const legend = await matchLegend(entry, legends)
- if (colormap._attributes.title === 'Columnar Water Vapor') {
- }
if (legend === 'false') {
refSkipList.push(entry._attributes.ref)
}
diff --git a/tasks/link-check/url-check.js b/tasks/link-check/url-check.js
index b4c4d63fc..f446fe4d1 100644
--- a/tasks/link-check/url-check.js
+++ b/tasks/link-check/url-check.js
@@ -26,7 +26,7 @@ const requestCheck = async (urls) => {
parsedUrls.STATUSCODE[statusCode].push({ [linkName]: url })
})
.then(sleeper(500))
- .catch((err) => { // eslint-disable-line handle-callback-err
+ .catch((err) => { // eslint-disable-line n/handle-callback-err
parsedUrls.ERROR.push({ [linkName]: url })
})
}
diff --git a/web/.eslintrc b/web/.eslintrc
index 8f090109e..5bd230080 100644
--- a/web/.eslintrc
+++ b/web/.eslintrc
@@ -156,7 +156,17 @@
}
],
"react/forbid-prop-types": "off", // 216 errors
- "react/require-default-props": "off" // 965 errors
+ "react/require-default-props": "off", // 965 errors,
+ "class-methods-use-this": "warn",
+ "react/no-unused-class-component-methods": "warn",
+ "react/no-unknown-property": "warn",
+ "react/jsx-no-useless-fragment": "warn",
+ "react/no-unstable-nested-components": "warn",
+ "react/prop-types": "warn",
+ "react/no-unused-prop-types": "warn",
+ "default-param-last": "warn",
+ "prefer-regex-literals": "warn",
+ "no-promise-executor-return": "warn"
}
}
]
diff --git a/web/js/app.js b/web/js/app.js
index 2b8631d0a..10df1194b 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -74,7 +74,7 @@ class App extends React.Component {
setVhCSSProperty = () => {
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
- }
+ };
handleKeyPress(event) {
const { keyPressAction } = this.props;
@@ -86,7 +86,7 @@ class App extends React.Component {
getScreenInfo = () => {
const { setScreenInfoAction } = this.props;
setScreenInfoAction();
- }
+ };
onload() {
const self = this;
diff --git a/web/js/components/animation-widget/gif-button.js b/web/js/components/animation-widget/gif-button.js
index b55df48d9..bdf3655b7 100644
--- a/web/js/components/animation-widget/gif-button.js
+++ b/web/js/components/animation-widget/gif-button.js
@@ -34,7 +34,7 @@ import { hasCustomPaletteInActiveProjection } from '../../modules/palettes/util'
const maxGifFrames = 40;
let onCloseGif;
-const GifButton = (props) => {
+function GifButton(props) {
const {
toggleGif,
onUpdateStartAndEndDate,
@@ -115,7 +115,7 @@ const GifButton = (props) => {
{isGifActive && <GifContainer onClose={onCloseGif} />}
</>
);
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/components/animation-widget/loop-button.js b/web/js/components/animation-widget/loop-button.js
index 8c313bbe1..35b3593b7 100644
--- a/web/js/components/animation-widget/loop-button.js
+++ b/web/js/components/animation-widget/loop-button.js
@@ -8,7 +8,7 @@ import { UncontrolledTooltip } from 'reactstrap';
* @class LoopButton
* @extends React.Component
*/
-const LoopButton = ({ looping, onLoop, isMobile }) => {
+function LoopButton({ looping, onLoop, isMobile }) {
const labelText = looping ? 'Disable animation loop' : 'Enable animation loop';
const buttonId = 'loop-button';
return (
@@ -35,7 +35,7 @@ const LoopButton = ({ looping, onLoop, isMobile }) => {
<FontAwesomeIcon icon="retweet" className="wv-animation-widget-icon" />
</a>
);
-};
+}
LoopButton.propTypes = {
looping: PropTypes.bool,
diff --git a/web/js/components/animation-widget/play-button.js b/web/js/components/animation-widget/play-button.js
index 5ebea5fa1..c7b218c5b 100644
--- a/web/js/components/animation-widget/play-button.js
+++ b/web/js/components/animation-widget/play-button.js
@@ -7,9 +7,9 @@ import { UncontrolledTooltip } from 'reactstrap';
* @class PlayButton
* @extends React.Component
*/
-const PlayButton = ({
+function PlayButton({
playing, pause, play, isDisabled, isMobile,
-}) => {
+}) {
const buttonId = 'play-button';
const labelText = isDisabled
? 'Too many animation frames. Reduce time range or increase increment size.'
@@ -38,7 +38,7 @@ const PlayButton = ({
: <FontAwesomeIcon icon="play" className="wv-animation-widget-icon" />}
</a>
);
-};
+}
PlayButton.propTypes = {
pause: PropTypes.func,
diff --git a/web/js/components/animation-widget/play-queue.js b/web/js/components/animation-widget/play-queue.js
index 9cf8c472e..1dc367575 100644
--- a/web/js/components/animation-widget/play-queue.js
+++ b/web/js/components/animation-widget/play-queue.js
@@ -159,7 +159,7 @@ class PlayQueue extends React.Component {
}
}
- getAverageFetchTime = () => this.fetchTimes.reduce((a, b) => a + b) / this.fetchTimes.length
+ getAverageFetchTime = () => this.fetchTimes.reduce((a, b) => a + b) / this.fetchTimes.length;
calcBufferSize() {
const { numberOfFrames, speed } = this.props;
@@ -269,7 +269,7 @@ class PlayQueue extends React.Component {
this.bufferObject = {};
this.bufferArray = [];
this.inQueueObject = {};
- }
+ };
nextDate(date) {
const { interval, delta } = this.props;
diff --git a/web/js/components/compare/alert.js b/web/js/components/compare/alert.js
index 78641ac52..4c046f071 100644
--- a/web/js/components/compare/alert.js
+++ b/web/js/components/compare/alert.js
@@ -1,33 +1,35 @@
import React from 'react';
-const CompareAlertModalBody = () => (
- <div className="basic-modal compare-dialog">
- <h1>How to get started?</h1>
- <ul>
- <li className="compare-dialog-list-item">
- <p>
- Select the respective tab (A or B) in order to update the layers
- and date of that state.
- </p>
- <img src="images/ab-tabs.png" />
- </li>
- <li className="compare-dialog-list-item">
- <p>
- There are now two time sliders on the timeline. You can click on
- the deactivated time slider to activate that state and change the
- date.
- </p>
- <img src="images/ab-picks.png" />
- </li>
- <li className="compare-dialog-list-item">
- <p>
- There are three compare modes. You can choose different modes
- using the selection at the bottom of the layer list.
- </p>
- <img src="images/ab-modes.png" />
- </li>
- </ul>
- </div>
-);
+function CompareAlertModalBody() {
+ return (
+ <div className="basic-modal compare-dialog">
+ <h1>How to get started?</h1>
+ <ul>
+ <li className="compare-dialog-list-item">
+ <p>
+ Select the respective tab (A or B) in order to update the layers
+ and date of that state.
+ </p>
+ <img src="images/ab-tabs.png" />
+ </li>
+ <li className="compare-dialog-list-item">
+ <p>
+ There are now two time sliders on the timeline. You can click on
+ the deactivated time slider to activate that state and change the
+ date.
+ </p>
+ <img src="images/ab-picks.png" />
+ </li>
+ <li className="compare-dialog-list-item">
+ <p>
+ There are three compare modes. You can choose different modes
+ using the selection at the bottom of the layer list.
+ </p>
+ <img src="images/ab-modes.png" />
+ </li>
+ </ul>
+ </div>
+ );
+}
export default CompareAlertModalBody;
diff --git a/web/js/components/compare/mobile-toggle.js b/web/js/components/compare/mobile-toggle.js
index 52ce85ca2..2fbf7aa02 100644
--- a/web/js/components/compare/mobile-toggle.js
+++ b/web/js/components/compare/mobile-toggle.js
@@ -29,22 +29,20 @@ function MobileComparisonToggle (props) {
const classB = !isCompareASelected ? 'compare-btn-selected' : '';
return (
- <>
- <div className="comparison-mobile-select-toggle">
- <div
- className={`compare-toggle-selected-btn ${classA}`}
- onClick={() => toggleCompareASelected(true)}
- >
- A
- </div>
- <div
- className={`compare-toggle-selected-btn ${classB}`}
- onClick={() => toggleCompareASelected(false)}
- >
- B
- </div>
+ <div className="comparison-mobile-select-toggle">
+ <div
+ className={`compare-toggle-selected-btn ${classA}`}
+ onClick={() => toggleCompareASelected(true)}
+ >
+ A
</div>
- </>
+ <div
+ className={`compare-toggle-selected-btn ${classB}`}
+ onClick={() => toggleCompareASelected(false)}
+ >
+ B
+ </div>
+ </div>
);
}
diff --git a/web/js/components/date-selector/date-input-column.js b/web/js/components/date-selector/date-input-column.js
index 73ec1405d..7d2698573 100644
--- a/web/js/components/date-selector/date-input-column.js
+++ b/web/js/components/date-selector/date-input-column.js
@@ -59,7 +59,7 @@ class DateInputColumn extends Component {
this.setState({
size,
});
- }
+ };
nextInput = () => {
const { isLastPosition, unitCycle } = this.state;
@@ -88,7 +88,7 @@ class DateInputColumn extends Component {
setTimeout(() => {
document.querySelector(nextTarget).focus();
}, 10);
- }
+ };
prevInput = () => {
const { isFirstPosition, unitCycle } = this.state;
@@ -121,12 +121,12 @@ class DateInputColumn extends Component {
setTimeout(() => {
document.querySelector(prevTarget).focus();
}, 10);
- }
+ };
updateValue = () => {
const { value } = this.props;
this.setState({ value });
- }
+ };
onKeyPress = (e) => {
const { keyCode } = e;
@@ -138,7 +138,7 @@ class DateInputColumn extends Component {
e.preventDefault();
e.stopPropagation();
}
- }
+ };
onKeyUp = (e) => {
const { type } = this.props;
@@ -174,7 +174,7 @@ class DateInputColumn extends Component {
this.nextInput();
}
}
- }
+ };
sanitizeInput = (value) => {
const {
@@ -215,7 +215,7 @@ class DateInputColumn extends Component {
updateTimeUnitInput(type, value);
}
return newDate;
- }
+ };
changeDate = (amt) => {
const {
@@ -230,7 +230,7 @@ class DateInputColumn extends Component {
maxDate,
);
updateDate(newDate, true);
- }
+ };
/**
* Select all text on focus
@@ -242,7 +242,7 @@ class DateInputColumn extends Component {
e.target.select();
this.setState({ selected: true });
onFocus(type);
- }
+ };
blur = (e) => {
const { type, value } = this.props;
@@ -264,13 +264,13 @@ class DateInputColumn extends Component {
value: newValue,
selected: false,
});
- }
+ };
onChange = (e) => {
this.setState({
value: e.target.value.toUpperCase(),
});
- }
+ };
render() {
const {
diff --git a/web/js/components/date-selector/date-selector.js b/web/js/components/date-selector/date-selector.js
index 4befe3563..00b272d48 100644
--- a/web/js/components/date-selector/date-selector.js
+++ b/web/js/components/date-selector/date-selector.js
@@ -68,11 +68,11 @@ class DateSelector extends Component {
this.setState({
[timeUnit]: input,
}, this.updateDate);
- }
+ };
setFocus = (type) => {
this.setState({ focusedUnit: type });
- }
+ };
/**
* @desc check valid date with potential temporarily invalid dates
@@ -254,7 +254,7 @@ class DateSelector extends Component {
}
}
return false;
- }
+ };
/**
* @desc update date with newDate if valid from check and then reset temp time values
@@ -273,7 +273,7 @@ class DateSelector extends Component {
// clear the pending timeunit inputs and reset validation
this.clearTimeValuesAndValidation();
}
- }
+ };
/**
* @desc clear temp time values and reset time validation booleans
@@ -293,7 +293,7 @@ class DateSelector extends Component {
hourValid: true,
minuteValid: true,
});
- }
+ };
render() {
const {
diff --git a/web/js/components/events/alert-body.js b/web/js/components/events/alert-body.js
index 545656b6e..02820f671 100644
--- a/web/js/components/events/alert-body.js
+++ b/web/js/components/events/alert-body.js
@@ -1,56 +1,58 @@
import React from 'react';
-const EventsAlertModalBody = () => (
- <div className="basic-modal event-alert-modal-body">
- <h1>
- Why can’t I see an event?
- </h1>
- <p>
- There are a variety of factors as to why you may not be seeing an
- event in @NAME@ at the moment.
- </p>
- <ul>
- <li>
- Satellite overpass may have occurred before the event. Check out
- subsequent days or try a different satellite/sensor which has a
- different overpass time.
- </li>
- <li>Cloud cover may obscure the event.</li>
- <li>
- Some events don’t appear on the day that they are reported, you may
- have to wait a day or two for an event to become visible. Try and
- step through the days to see an event’s progression and/or change
- the satellite/sensor. NOTE: Wildfire events are currently set to
- automatically display the next day, as fire events often do not
- appear in the satellite imagery on the day they are reported.
- </li>
- <li>
- The resolution of the imagery may be too coarse to see an event.
- </li>
- <li>
- There are normal swath data gaps in some of the imagery layers due
- to way the satellite orbits the Earth, and an event may have
- occurred in the data gap. Learn more with the
+function EventsAlertModalBody() {
+ return (
+ <div className="basic-modal event-alert-modal-body">
+ <h1>
+ Why can’t I see an event?
+ </h1>
+ <p>
+ There are a variety of factors as to why you may not be seeing an
+ event in @NAME@ at the moment.
+ </p>
+ <ul>
+ <li>
+ Satellite overpass may have occurred before the event. Check out
+ subsequent days or try a different satellite/sensor which has a
+ different overpass time.
+ </li>
+ <li>Cloud cover may obscure the event.</li>
+ <li>
+ Some events don’t appear on the day that they are reported, you may
+ have to wait a day or two for an event to become visible. Try and
+ step through the days to see an event’s progression and/or change
+ the satellite/sensor. NOTE: Wildfire events are currently set to
+ automatically display the next day, as fire events often do not
+ appear in the satellite imagery on the day they are reported.
+ </li>
+ <li>
+ The resolution of the imagery may be too coarse to see an event.
+ </li>
+ <li>
+ There are normal swath data gaps in some of the imagery layers due
+ to way the satellite orbits the Earth, and an event may have
+ occurred in the data gap. Learn more with the
+ {' '}
+ <a href="https://worldview.earthdata.nasa.gov/?v=-255.13947597940853,-142.5249083549454,242.67302402059147,109.63964770652301&l=Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&tr=swath_gaps&t=2019-02-10-T00%3A00%3A00Z">
+ Swath Gap tour story.
+ </a>
+ </li>
+ <li>
+ Events listings currently only go back to 1 January 2000.
+ </li>
+ <li>
+ Not all categories have events that are populated back to 1 January 2000.
+ </li>
+ </ul>
+ <p>
+ Events are curated and provided by the
{' '}
- <a href="https://worldview.earthdata.nasa.gov/?v=-255.13947597940853,-142.5249083549454,242.67302402059147,109.63964770652301&l=Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&tr=swath_gaps&t=2019-02-10-T00%3A00%3A00Z">
- Swath Gap tour story.
+ <a href="https://eonet.gsfc.nasa.gov/" target="_blank" rel="noopener noreferrer">
+ Earth Observatory Natural Event Tracker
</a>
- </li>
- <li>
- Events listings currently only go back to 1 January 2000.
- </li>
- <li>
- Not all categories have events that are populated back to 1 January 2000.
- </li>
- </ul>
- <p>
- Events are curated and provided by the
- {' '}
- <a href="https://eonet.gsfc.nasa.gov/" target="_blank" rel="noopener noreferrer">
- Earth Observatory Natural Event Tracker
- </a>
- </p>
- </div>
-);
+ </p>
+ </div>
+ );
+}
export default EventsAlertModalBody;
diff --git a/web/js/components/feature-alert/vector-alert-modal.js b/web/js/components/feature-alert/vector-alert-modal.js
index adfabfa52..ed005146a 100644
--- a/web/js/components/feature-alert/vector-alert-modal.js
+++ b/web/js/components/feature-alert/vector-alert-modal.js
@@ -1,59 +1,60 @@
import React from 'react';
import { Container, Row, Col } from 'reactstrap';
-const VectorAlertModalBody = () => (
+function VectorAlertModalBody() {
+ return (
+ <Container className="event-alert-modal-body">
+ <Row className="p-2">
+ <Col>
- <Container className="event-alert-modal-body">
- <Row className="p-2">
- <Col>
+ <h2>
+ What are vector layers and how do they differ from raster (image) layers?
+ </h2>
+ </Col>
+ </Row>
- <h2>
- What are vector layers and how do they differ from raster (image) layers?
- </h2>
- </Col>
- </Row>
+ <Row className="p-3">
+ <Col>
- <Row className="p-3">
- <Col>
+ <p>
+ Vector layers identify locations on earth using points, line segments or polygons while raster layers represent locations on earth through a grid of cells or pixels that have associated color values. The vector layers have attribute information that can be examined when a vector feature is clicked. For example, when a point is clicked on in the Dams layer, a table of attributes will appear including the dam name, river, main use, representative capacity, etc.
+ </p>
+ </Col>
+ </Row>
+ <Row className="p-2">
+ <Col>
+ <h2>
+ Why can’t I click on a feature in a vector layer?
+ </h2>
+ </Col>
+ </Row>
+ <Row className="p-3">
+ <Col>
- <p>
- Vector layers identify locations on earth using points, line segments or polygons while raster layers represent locations on earth through a grid of cells or pixels that have associated color values. The vector layers have attribute information that can be examined when a vector feature is clicked. For example, when a point is clicked on in the Dams layer, a table of attributes will appear including the dam name, river, main use, representative capacity, etc.
- </p>
- </Col>
- </Row>
- <Row className="p-2">
- <Col>
- <h2>
- Why can’t I click on a feature in a vector layer?
- </h2>
- </Col>
- </Row>
- <Row className="p-3">
- <Col>
-
- <p>
- To speed up map interactions, vector layers that have a vast number of features are rendered as raster images in outer zoom levels. Zoom in to be able to query the vector layer.
- </p>
- </Col>
- </Row>
- <Row className="p-2">
- <Col>
- <h2>
- How can I determine which layers have clickable features?
- </h2>
- </Col>
- </Row>
- <Row className="p-3">
- <Col>
- <p>
- If you see the blue pointer icon next to the layer in the sidebar Layer List, you should be able to click on that layer’s features in order to access attribute information associated with that vector feature. If you see the blue pointer with a red X over it, you are zoomed out too far and the layer is being rendered as a raster, zoom in to be able to examine the attribute information of the vector layer.
- </p>
- </Col>
- <Col>
- <img src="images/vector-alert.png" />
- </Col>
- </Row>
- </Container>
-);
+ <p>
+ To speed up map interactions, vector layers that have a vast number of features are rendered as raster images in outer zoom levels. Zoom in to be able to query the vector layer.
+ </p>
+ </Col>
+ </Row>
+ <Row className="p-2">
+ <Col>
+ <h2>
+ How can I determine which layers have clickable features?
+ </h2>
+ </Col>
+ </Row>
+ <Row className="p-3">
+ <Col>
+ <p>
+ If you see the blue pointer icon next to the layer in the sidebar Layer List, you should be able to click on that layer’s features in order to access attribute information associated with that vector feature. If you see the blue pointer with a red X over it, you are zoomed out too far and the layer is being rendered as a raster, zoom in to be able to examine the attribute information of the vector layer.
+ </p>
+ </Col>
+ <Col>
+ <img src="images/vector-alert.png" />
+ </Col>
+ </Row>
+ </Container>
+ );
+}
export default VectorAlertModalBody;
diff --git a/web/js/components/global-settings/global-settings.js b/web/js/components/global-settings/global-settings.js
index 558c4f449..4efc95352 100644
--- a/web/js/components/global-settings/global-settings.js
+++ b/web/js/components/global-settings/global-settings.js
@@ -23,52 +23,50 @@ function GlobalSettings(props) {
} = props;
return (
- <>
- <div className="global-setting-container">
+ <div className="global-setting-container">
- <TemperatureUnitButtons
- changeTemperatureUnit={changeTemperatureUnitAction}
- globalTemperatureUnit={globalTemperatureUnit}
- />
+ <TemperatureUnitButtons
+ changeTemperatureUnit={changeTemperatureUnitAction}
+ globalTemperatureUnit={globalTemperatureUnit}
+ />
- <CoordinateFormatButtons
- changeCoordinateFormat={changeCoordinateFormatAction}
- coordinateFormat={coordinateFormat}
- />
+ <CoordinateFormatButtons
+ changeCoordinateFormat={changeCoordinateFormatAction}
+ coordinateFormat={coordinateFormat}
+ />
- <div className="settings-component">
- <h3 className="wv-header">
- Show Antimeridian / Approximate Date Line
- {' '}
- <span><FontAwesomeIcon id="datelines-toggle" icon="info-circle" /></span>
- <HoverTooltip
- isMobile={false}
- labelText="For many layers, this line represents the transition of daytime imagery from one day to the next."
- target="datelines-toggle"
- placement="right"
- />
- </h3>
- <ButtonGroup>
- <Button
- outline
- className="setting-button"
- active={alwaysShowDatelines}
- onClick={() => toggleAlwaysShowDatelines(true)}
- >
- Always
- </Button>
- <Button
- outline
- className="setting-button"
- active={!alwaysShowDatelines}
- onClick={() => toggleAlwaysShowDatelines(false)}
- >
- On Hover
- </Button>
- </ButtonGroup>
- </div>
+ <div className="settings-component">
+ <h3 className="wv-header">
+ Show Antimeridian / Approximate Date Line
+ {' '}
+ <span><FontAwesomeIcon id="datelines-toggle" icon="info-circle" /></span>
+ <HoverTooltip
+ isMobile={false}
+ labelText="For many layers, this line represents the transition of daytime imagery from one day to the next."
+ target="datelines-toggle"
+ placement="right"
+ />
+ </h3>
+ <ButtonGroup>
+ <Button
+ outline
+ className="setting-button"
+ active={alwaysShowDatelines}
+ onClick={() => toggleAlwaysShowDatelines(true)}
+ >
+ Always
+ </Button>
+ <Button
+ outline
+ className="setting-button"
+ active={!alwaysShowDatelines}
+ onClick={() => toggleAlwaysShowDatelines(false)}
+ >
+ On Hover
+ </Button>
+ </ButtonGroup>
</div>
- </>
+ </div>
);
}
diff --git a/web/js/components/global-settings/temperature-unit-buttons.js b/web/js/components/global-settings/temperature-unit-buttons.js
index 2edbc4f77..fcad9baf2 100644
--- a/web/js/components/global-settings/temperature-unit-buttons.js
+++ b/web/js/components/global-settings/temperature-unit-buttons.js
@@ -4,45 +4,47 @@ import { Button, ButtonGroup, UncontrolledTooltip } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { TEMPERATURE_UNITS } from '../../modules/settings/constants';
-const TemperatureUnitButtons = ({ changeTemperatureUnit, globalTemperatureUnit }) => (
- <div className="settings-component">
- <h3 className="wv-header">
- Temperature Unit
- {' '}
- <span><FontAwesomeIcon id="temperature-unit-buttons-info-icon" icon="info-circle" /></span>
- <UncontrolledTooltip
- id="temperature-setting-tooltip"
- target="temperature-unit-buttons-info-icon"
- placement="right"
- >
- Applied to relevant temperature layers
- </UncontrolledTooltip>
- </h3>
- <ButtonGroup>
- {TEMPERATURE_UNITS.map((unit) => (
+function TemperatureUnitButtons({ changeTemperatureUnit, globalTemperatureUnit }) {
+ return (
+ <div className="settings-component">
+ <h3 className="wv-header">
+ Temperature Unit
+ {' '}
+ <span><FontAwesomeIcon id="temperature-unit-buttons-info-icon" icon="info-circle" /></span>
+ <UncontrolledTooltip
+ id="temperature-setting-tooltip"
+ target="temperature-unit-buttons-info-icon"
+ placement="right"
+ >
+ Applied to relevant temperature layers
+ </UncontrolledTooltip>
+ </h3>
+ <ButtonGroup>
+ {TEMPERATURE_UNITS.map((unit) => (
+ <Button
+ key={`${unit}-button`}
+ aria-label={`Set ${unit} Unit`}
+ outline
+ className="setting-button"
+ active={globalTemperatureUnit === unit}
+ onClick={() => changeTemperatureUnit(unit)}
+ >
+ {unit}
+ </Button>
+ ))}
<Button
- key={`${unit}-button`}
- aria-label={`Set ${unit} Unit`}
+ aria-label="Reset to Default Unit"
outline
className="setting-button"
- active={globalTemperatureUnit === unit}
- onClick={() => changeTemperatureUnit(unit)}
+ active={!globalTemperatureUnit}
+ onClick={() => changeTemperatureUnit('')}
>
- {unit}
+ Defaults
</Button>
- ))}
- <Button
- aria-label="Reset to Default Unit"
- outline
- className="setting-button"
- active={!globalTemperatureUnit}
- onClick={() => changeTemperatureUnit('')}
- >
- Defaults
- </Button>
- </ButtonGroup>
- </div>
-);
+ </ButtonGroup>
+ </div>
+ );
+}
TemperatureUnitButtons.propTypes = {
changeTemperatureUnit: PropTypes.func,
diff --git a/web/js/components/image-download/global-select.js b/web/js/components/image-download/global-select.js
index 6ad8f17a3..e36972ae7 100644
--- a/web/js/components/image-download/global-select.js
+++ b/web/js/components/image-download/global-select.js
@@ -5,7 +5,7 @@ import Checkbox from '../util/checkbox';
const GLOBAL_LAT_LONG_EXTENT = [-180, -90, 180, 90];
-const GlobalSelectCheckbox = (props) => {
+function GlobalSelectCheckbox(props) {
const {
onLatLongChange, geoLatLong, proj, map,
} = props;
@@ -38,7 +38,7 @@ const GlobalSelectCheckbox = (props) => {
/>
</div>
);
-};
+}
GlobalSelectCheckbox.propTypes = {
onLatLongChange: PropTypes.func,
geoLatLong: PropTypes.array,
diff --git a/web/js/components/image-download/lat-long-inputs.js b/web/js/components/image-download/lat-long-inputs.js
index daf786162..77d639d19 100644
--- a/web/js/components/image-download/lat-long-inputs.js
+++ b/web/js/components/image-download/lat-long-inputs.js
@@ -14,9 +14,9 @@ const isValidExtent = (extent) => {
return true;
};
-const Input = ({
+function Input({
index, title, boundingBoxArray, onLatLongChange, inputNumber, viewExtent, crs,
-}) => {
+}) {
const [inputValue, setInputValue] = useState(inputNumber);
const [isInvalid, setInputInvalid] = useState(false);
@@ -81,9 +81,9 @@ const Input = ({
{isInvalid && (<span className="red-font invalid">Not Visible</span>)}
</div>
);
-};
+}
-const LatLongSelect = (props) => {
+function LatLongSelect(props) {
const {
onLatLongChange, geoLatLong, viewExtent, crs,
} = props;
@@ -163,7 +163,7 @@ const LatLongSelect = (props) => {
)}
</div>
);
-};
+}
export default LatLongSelect;
const {
diff --git a/web/js/components/image-download/notify.js b/web/js/components/image-download/notify.js
index 251c70c73..902eb6268 100644
--- a/web/js/components/image-download/notify.js
+++ b/web/js/components/image-download/notify.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { ModalFooter } from 'reactstrap';
import Button from '../util/button';
-const Notify = (props) => {
+function Notify(props) {
const { bodyText, cancel, accept } = props;
return (
<>
@@ -16,7 +16,7 @@ const Notify = (props) => {
</ModalFooter>
</>
);
-};
+}
Notify.propTypes = {
accept: PropTypes.func,
diff --git a/web/js/components/layer/info/date-ranges.js b/web/js/components/layer/info/date-ranges.js
index e5bd55ebd..fe57c928c 100644
--- a/web/js/components/layer/info/date-ranges.js
+++ b/web/js/components/layer/info/date-ranges.js
@@ -26,7 +26,7 @@ export default class DateRanges extends React.Component {
<ListItemEndDate />
</ListGroupItem>
);
- })
+ });
render() {
const { layer } = this.props;
diff --git a/web/js/components/layer/product-picker/browse/category-cell.js b/web/js/components/layer/product-picker/browse/category-cell.js
index 6504815cb..d87a1863b 100644
--- a/web/js/components/layer/product-picker/browse/category-cell.js
+++ b/web/js/components/layer/product-picker/browse/category-cell.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
-const CategoryCell = (props) => {
+function CategoryCell(props) {
const {
category,
measurementConfig,
@@ -101,7 +101,7 @@ const CategoryCell = (props) => {
</div>
</div>
);
-};
+}
CategoryCell.propTypes = {
category: PropTypes.object,
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 eb405a244..eb91b0a1d 100644
--- a/web/js/components/layer/product-picker/browse/category-grid.js
+++ b/web/js/components/layer/product-picker/browse/category-grid.js
@@ -17,7 +17,7 @@ import {
* @class LayerList
* @extends React.Component
*/
-const CategoryGrid = (props) => {
+function CategoryGrid(props) {
const {
categories,
measurementConfig,
@@ -53,7 +53,7 @@ const CategoryGrid = (props) => {
))}
</Masonry>
);
-};
+}
const mapDispatchToProps = (dispatch) => ({
showMeasurements: (category, selectedMeasurement) => {
dispatch(showMeasurementsAction({ category, selectedMeasurement }));
diff --git a/web/js/components/layer/product-picker/header.js b/web/js/components/layer/product-picker/header.js
index ec1d90bf2..043ee7818 100644
--- a/web/js/components/layer/product-picker/header.js
+++ b/web/js/components/layer/product-picker/header.js
@@ -75,7 +75,7 @@ class ProductPickerHeader extends React.Component {
if (showMobileFacets) {
toggleMobileFacets();
}
- }
+ };
renderBreadCrumb() {
const { category } = this.props;
diff --git a/web/js/components/layer/settings/associated-layers-toggle.js b/web/js/components/layer/settings/associated-layers-toggle.js
index f12895da0..68b1763ce 100644
--- a/web/js/components/layer/settings/associated-layers-toggle.js
+++ b/web/js/components/layer/settings/associated-layers-toggle.js
@@ -9,7 +9,7 @@ import {
import { getOrbitTrackTitle } from '../../../modules/layers/util';
import { getActiveLayersMap } from '../../../modules/layers/selectors';
-const AssociatedLayersToggle = (props) => {
+function AssociatedLayersToggle(props) {
const {
associatedLayers,
addLayer,
@@ -47,7 +47,7 @@ const AssociatedLayersToggle = (props) => {
}) }
</div>
);
-};
+}
const mapStateToProps = (state, ownProps) => {
const { config: { layers } } = state;
diff --git a/web/js/components/layer/settings/granule-count-slider.js b/web/js/components/layer/settings/granule-count-slider.js
index 6b633d88c..2f6d919f6 100644
--- a/web/js/components/layer/settings/granule-count-slider.js
+++ b/web/js/components/layer/settings/granule-count-slider.js
@@ -7,7 +7,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { UncontrolledTooltip } from 'reactstrap';
import { DEFAULT_NUM_GRANULES, MIN_GRANULES, MAX_GRANULES } from '../../../modules/layers/constants';
-const GranuleCountSlider = (props) => {
+function GranuleCountSlider(props) {
const {
count,
def,
@@ -53,7 +53,7 @@ const GranuleCountSlider = (props) => {
</div>
</div>
);
-};
+}
GranuleCountSlider.defaultProps = {
count: DEFAULT_NUM_GRANULES,
diff --git a/web/js/components/layer/settings/granule-date-list.js b/web/js/components/layer/settings/granule-date-list.js
index ba93e9241..97f3bdd7e 100644
--- a/web/js/components/layer/settings/granule-date-list.js
+++ b/web/js/components/layer/settings/granule-date-list.js
@@ -86,7 +86,7 @@ class GranuleDateList extends PureComponent {
this.setState({
lastMovedItem: result.draggableId, // granule date
});
- }
+ };
// move granule item to top of list
moveUp = (e, sourceIndex, granuleDate) => {
@@ -101,7 +101,7 @@ class GranuleDateList extends PureComponent {
this.setState({
lastMovedItem: granuleDate,
});
- }
+ };
// move granule item to top of list
moveDown = (e, sourceIndex, granuleDate) => {
@@ -115,7 +115,7 @@ class GranuleDateList extends PureComponent {
this.setState({
lastMovedItem: granuleDate,
});
- }
+ };
// reorder granule items based on source and target index
reorderItems = (sourceIndex, destinationIndex) => {
@@ -126,7 +126,7 @@ class GranuleDateList extends PureComponent {
destinationIndex,
);
return reorderedItems;
- }
+ };
// reset granule order
onClickReset = (e) => {
@@ -136,14 +136,14 @@ class GranuleDateList extends PureComponent {
this.setState({
lastMovedItem: null,
});
- }
+ };
// set local granule item state
setItems = (items) => {
this.setState({
items,
});
- }
+ };
// handle mouse over item
handleMouseOverItem = (granuleDate) => {
@@ -152,7 +152,7 @@ class GranuleDateList extends PureComponent {
this.setState({
hoveredItem: granuleDate,
});
- }
+ };
// handle mouse leave item
handleMouseLeaveItem = () => {
@@ -161,7 +161,7 @@ class GranuleDateList extends PureComponent {
this.setState({
hoveredItem: null,
});
- }
+ };
// determine if grnaule dates are in order - used for RESET button toggle
checkGranuleDateSorting = (granuleDates) => {
@@ -178,7 +178,7 @@ class GranuleDateList extends PureComponent {
sorted: isSorted,
});
}
- }
+ };
renderDraggableGranule = (date, index) => {
const {
@@ -238,7 +238,7 @@ class GranuleDateList extends PureComponent {
)}
</Draggable>
);
- }
+ };
render() {
const { items, sorted } = this.state;
@@ -289,12 +289,10 @@ class GranuleDateList extends PureComponent {
)
: (
- <>
- <div style={{ marginBottom: '14px', color: '#a0a0a0' }}>
- <p className="granule-date-item-no-granules-available">No granules available.</p>
- <br />
- </div>
- </>
+ <div style={{ marginBottom: '14px', color: '#a0a0a0' }}>
+ <p className="granule-date-item-no-granules-available">No granules available.</p>
+ <br />
+ </div>
)}
</div>
);
diff --git a/web/js/components/layer/settings/layer-settings.js b/web/js/components/layer/settings/layer-settings.js
index 317edc51e..f1bb12df7 100644
--- a/web/js/components/layer/settings/layer-settings.js
+++ b/web/js/components/layer/settings/layer-settings.js
@@ -281,17 +281,15 @@ class LayerSettings extends React.Component {
[customStyle] = layer.custom;
}
return (
- <>
- <VectorStyle
- setStyle={setStyle}
- clearStyle={clearStyle}
- activeVectorStyle={customStyle || layer.id}
- layer={layer}
- index={0}
- groupName={groupName}
- vectorStyles={vectorStyles}
- />
- </>
+ <VectorStyle
+ setStyle={setStyle}
+ clearStyle={clearStyle}
+ activeVectorStyle={customStyle || layer.id}
+ layer={layer}
+ index={0}
+ groupName={groupName}
+ vectorStyles={vectorStyles}
+ />
);
}
@@ -330,7 +328,7 @@ class LayerSettings extends React.Component {
)}
</>
) : null;
- }
+ };
render() {
let renderCustomizations;
diff --git a/web/js/components/layer/settings/vector-style.js b/web/js/components/layer/settings/vector-style.js
index ed03b4e0e..2cf757cef 100644
--- a/web/js/components/layer/settings/vector-style.js
+++ b/web/js/components/layer/settings/vector-style.js
@@ -38,9 +38,11 @@ class VectorStyleSelect extends React.Component {
const description = styleLayerObject['source-description'] || styleLayerObject.id;
const isConditionalStyling = styleLayerObject.paint ? isConditional(styleLayerObject.paint['line-color'] || styleLayerObject.paint['circle-color'] || styleLayerObject.paint['fill-color']) : false;
- return isConditionalStyling ? this.renderLegendMultiItem(styleLayerObject,
+ return isConditionalStyling ? this.renderLegendMultiItem(
+ styleLayerObject,
styleLayerObject.id,
- description)
+ description,
+ )
: this.renderSelectorItemSingle(
styleLayerObject,
styleLayerObject.id,
diff --git a/web/js/components/location-search/coordinates-dialog.js b/web/js/components/location-search/coordinates-dialog.js
index ec4735216..7706b5714 100644
--- a/web/js/components/location-search/coordinates-dialog.js
+++ b/web/js/components/location-search/coordinates-dialog.js
@@ -66,7 +66,7 @@ class CoordinatesDialog extends Component {
showTooltips: false,
});
removeMarker();
- }
+ };
// minimize dialog (destroy component)
minimizeDialog = () => {
@@ -75,13 +75,13 @@ class CoordinatesDialog extends Component {
showTooltips: false,
});
removeCoordinatesDialog();
- }
+ };
clearCopyToClipboardTooltip = () => {
this.setState({
isCopyToClipboardTooltipVisible: false,
});
- }
+ };
// render minimize and remove dialog button controls
renderDialogButtonControls = () => {
@@ -140,7 +140,7 @@ class CoordinatesDialog extends Component {
</span>
</>
);
- }
+ };
// render copy to clipboard button
renderCopyToClipboardButton = () => {
@@ -171,7 +171,7 @@ class CoordinatesDialog extends Component {
<FontAwesomeIcon icon="copy" fixedWidth />
</div>
);
- }
+ };
render() {
const {
diff --git a/web/js/components/location-search/copy-tooltip.js b/web/js/components/location-search/copy-tooltip.js
index 4daf20a21..f75497cce 100644
--- a/web/js/components/location-search/copy-tooltip.js
+++ b/web/js/components/location-search/copy-tooltip.js
@@ -37,7 +37,7 @@ class CopyClipboardTooltip extends PureComponent {
this.setState({
showCopiedToolTip: true,
});
- }
+ };
render() {
const { showCopiedToolTip } = this.state;
diff --git a/web/js/components/location-search/location-search-input.js b/web/js/components/location-search/location-search-input.js
index 7048c4780..edb615bff 100644
--- a/web/js/components/location-search/location-search-input.js
+++ b/web/js/components/location-search/location-search-input.js
@@ -53,7 +53,7 @@ class SearchBox extends Component {
onSelect(firstSuggestion.text, firstSuggestion);
}
}
- }
+ };
// handle key press to use ENTER key to select
handleKeyPress = (e) => {
@@ -68,14 +68,14 @@ class SearchBox extends Component {
onCoordinateInputSelect();
}
}
- }
+ };
// render search result menu item container
renderMenu = (children) => (
<div className="location-search-results-menu">
{children}
</div>
- )
+ );
// render individual menu items with conditional styling
renderItem = (item, isHighlighted) => {
@@ -94,7 +94,7 @@ class SearchBox extends Component {
{item.text}
</div>
);
- }
+ };
// render submit button
renderSubmitButton = () => {
@@ -135,7 +135,7 @@ class SearchBox extends Component {
</Button>
</InputGroupAddon>
);
- }
+ };
// render alert icon
renderAlertIcon = () => {
@@ -154,7 +154,7 @@ class SearchBox extends Component {
</InputGroupAddon>
)
);
- }
+ };
// render clear input X
renderClearInput = () => {
@@ -192,7 +192,7 @@ class SearchBox extends Component {
</InputGroupAddon>
)
);
- }
+ };
// conditional autocomplete wrapper styling
getWrapperStyle = () => {
@@ -213,7 +213,7 @@ class SearchBox extends Component {
width: isMobile ? '90%' : '298px',
paddingRight: paddingRightStyle,
};
- }
+ };
render() {
const {
diff --git a/web/js/components/location-search/location-search-modal.js b/web/js/components/location-search/location-search-modal.js
index bb67350d5..cda6a439a 100644
--- a/web/js/components/location-search/location-search-modal.js
+++ b/web/js/components/location-search/location-search-modal.js
@@ -83,7 +83,7 @@ class LocationSearchModal extends Component {
getSuggestions = (val) => {
const { getSuggestions } = this.props;
getSuggestions(val);
- }
+ };
// dismiss message instruction alert
dismissReverseGeocodeAlert = () => this.setState({ showReverseGeocodeAlert: false });
@@ -105,7 +105,7 @@ class LocationSearchModal extends Component {
showNoSuggestionsAlert: false,
showReverseGeocodeAlert: false,
});
- }
+ };
// handle submitting search after inputting coordinates
onCoordinateInputSelect = () => {
@@ -133,7 +133,7 @@ class LocationSearchModal extends Component {
clearSuggestions();
updatePendingCoordinates([]);
}
- }
+ };
// handle selecting menu item in search results
onSelect = (value, item) => {
@@ -169,7 +169,7 @@ class LocationSearchModal extends Component {
}
}
}).catch((error) => console.error(error));
- }
+ };
// handle input value change including text/coordinates typing, pasting, cutting
onChange = (e, value) => {
@@ -197,7 +197,7 @@ class LocationSearchModal extends Component {
// provide suggestions to populate search result menu item(s)
this.debounceGetSuggestions(value);
}
- }
+ };
// clear text input and search results
clearInput = () => {
@@ -208,7 +208,7 @@ class LocationSearchModal extends Component {
updateValue('');
clearSuggestions();
this.clearAlerts();
- }
+ };
// initiate instruction alert and activate store level toggleReverseGeocodeActive
initReverseGeocode = (e) => {
@@ -227,7 +227,7 @@ class LocationSearchModal extends Component {
googleTagManager.pushEvent({
event: 'location_search_reverse_geocode',
});
- }
+ };
renderTooltip = (buttonId, labelText) => {
const { isMobile } = this.props;
@@ -238,7 +238,7 @@ class LocationSearchModal extends Component {
target={buttonId}
/>
);
- }
+ };
// render alert message to instruct user map interaction
renderReverseGeocodeAlert = () => {
@@ -259,7 +259,7 @@ class LocationSearchModal extends Component {
onDismiss={this.dismissReverseGeocodeAlert}
/>
);
- }
+ };
// render alert message to indicate entered location is outside of map extent
renderExtentAlert = () => {
@@ -278,7 +278,7 @@ class LocationSearchModal extends Component {
onDismiss={() => this.setExtentAlert(false)}
/>
);
- }
+ };
// render alert message to indicate no suggestions for input value
renderNoSuggestionsAlert = () => {
@@ -297,7 +297,7 @@ class LocationSearchModal extends Component {
onDismiss={() => this.setNoSuggestionsAlert(false)}
/>
);
- }
+ };
// render Location Search component minimize button (not visible in mobile)
renderMinimizeButton = () => {
@@ -316,7 +316,7 @@ class LocationSearchModal extends Component {
</Button>
</InputGroupAddon>
);
- }
+ };
// render add coordinate marker button for reverse geocode
renderAddCoordinateButton = () => {
@@ -336,7 +336,7 @@ class LocationSearchModal extends Component {
</Button>
</InputGroupAddon>
);
- }
+ };
render() {
const {
diff --git a/web/js/components/location-search/location-search.js b/web/js/components/location-search/location-search.js
index 6e35cf885..12d975ff8 100644
--- a/web/js/components/location-search/location-search.js
+++ b/web/js/components/location-search/location-search.js
@@ -43,7 +43,7 @@ class LocationSearch extends Component {
updateValue={this.updateValue}
/>
);
- }
+ };
render() {
const {
diff --git a/web/js/components/location-search/ol-coordinates-marker.js b/web/js/components/location-search/ol-coordinates-marker.js
index 964b119bc..660165ae8 100644
--- a/web/js/components/location-search/ol-coordinates-marker.js
+++ b/web/js/components/location-search/ol-coordinates-marker.js
@@ -90,7 +90,7 @@ export class CoordinatesMarker extends Component {
onDismiss={() => this.setState({ showExtentAlert: false })}
/>
);
- }
+ };
render() {
const { showExtentAlert } = this.state;
diff --git a/web/js/components/map/ol-coordinates.js b/web/js/components/map/ol-coordinates.js
index 228e582fa..ae7825355 100644
--- a/web/js/components/map/ol-coordinates.js
+++ b/web/js/components/map/ol-coordinates.js
@@ -123,7 +123,7 @@ class OlCoordinates extends React.Component {
format,
width,
});
- }
+ };
render() {
const {
diff --git a/web/js/components/map/ol-measure-tool.js b/web/js/components/map/ol-measure-tool.js
index d5daa696e..469db9498 100644
--- a/web/js/components/map/ol-measure-tool.js
+++ b/web/js/components/map/ol-measure-tool.js
@@ -199,17 +199,19 @@ function OlMeasureTool (props) {
updateMeasurements(allMeasurements);
};
- ReactDOM.render((
- <MeasureTooltip
- active={!!tooltipElement}
- geometry={feature.getGeometry()}
- crs={crs}
- unitOfMeasure={unitOfMeasure}
- onRemove={removeFeature}
- olMap={olMap}
- proj={proj}
- />
- ), overlay.getElement());
+ ReactDOM.render(
+ (
+ <MeasureTooltip
+ active={!!tooltipElement}
+ geometry={feature.getGeometry()}
+ crs={crs}
+ unitOfMeasure={unitOfMeasure}
+ onRemove={removeFeature}
+ olMap={olMap}
+ proj={proj}
+ />
+ ), overlay.getElement(),
+ );
};
/**
diff --git a/web/js/components/notifications/notification-block.js b/web/js/components/notifications/notification-block.js
index ee9a25842..a6de37a2e 100644
--- a/web/js/components/notifications/notification-block.js
+++ b/web/js/components/notifications/notification-block.js
@@ -10,7 +10,7 @@ const listIcons = {
outage: 'exclamation-circle',
};
-const NotificationBlock = (props) => {
+function NotificationBlock(props) {
const { arr, type, numberNotSeen } = props;
return (
<ul>
@@ -35,7 +35,7 @@ const NotificationBlock = (props) => {
})}
</ul>
);
-};
+}
export default NotificationBlock;
diff --git a/web/js/components/range-selection/range-selection.js b/web/js/components/range-selection/range-selection.js
index a69c33daf..fa8556963 100644
--- a/web/js/components/range-selection/range-selection.js
+++ b/web/js/components/range-selection/range-selection.js
@@ -87,7 +87,7 @@ class TimelineRangeSelector extends React.Component {
endLocation: endX,
});
this.animationDraggerPositionUpdate(startX, endX, true);
- }
+ };
/*
* Send callback with new locations on
@@ -100,7 +100,7 @@ class TimelineRangeSelector extends React.Component {
onDragStop = () => {
const { endLocation, startLocation } = this.state;
this.animationDraggerPositionUpdate(startLocation, endLocation, false);
- }
+ };
/*
* Update state based on distance range was dragged
@@ -123,7 +123,7 @@ class TimelineRangeSelector extends React.Component {
deltaStart,
};
});
- }
+ };
// update animation dragger helper function
getAnimationLocateDateUpdate = (animLocationDate, animDraggerLocation, deltaX, { diffZeroValues, diffFactor }) => {
@@ -157,7 +157,7 @@ class TimelineRangeSelector extends React.Component {
const draggerTimeStartValue = new Date(animLocationDate).getTime();
const newLocationDate = draggerTimeStartValue + (diffFactor * deltaX);
return new Date(newLocationDate);
- }
+ };
// handle animation dragger drag change
animationDraggerPositionUpdate = (draggerStartLocation, draggerEndLocation, isDragging) => {
@@ -244,7 +244,7 @@ class TimelineRangeSelector extends React.Component {
draggerEndLocation,
isDragging,
);
- }
+ };
updateLocation = () => {
const { startLocation, endLocation } = this.props;
@@ -252,7 +252,7 @@ class TimelineRangeSelector extends React.Component {
startLocation,
endLocation,
});
- }
+ };
/*
* @method render
diff --git a/web/js/components/selected-date.js b/web/js/components/selected-date.js
index 782063474..7f4bf1eff 100644
--- a/web/js/components/selected-date.js
+++ b/web/js/components/selected-date.js
@@ -5,7 +5,9 @@ import { getSelectedDate } from '../modules/date/selectors';
import { formatDisplayDate } from '../modules/date/util';
// A simple component to re-use anywhere we want to display the selected date
-const SelectedDate = ({ selectedDate }) => (<>{selectedDate}</>);
+function SelectedDate({ selectedDate }) {
+ return <>{selectedDate}</>;
+}
SelectedDate.propTypes = {
selectedDate: PropTypes.string,
diff --git a/web/js/components/sidebar/nav/nav-item.js b/web/js/components/sidebar/nav/nav-item.js
index 648b02adc..4cf1402e5 100644
--- a/web/js/components/sidebar/nav/nav-item.js
+++ b/web/js/components/sidebar/nav/nav-item.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { NavItem, NavLink } from 'reactstrap';
import HoverTooltip from '../../util/hover-tooltip';
-const CustomNavItem = (props) => {
+function CustomNavItem(props) {
const {
isMobile,
shouldHideInMobile,
@@ -42,7 +42,7 @@ const CustomNavItem = (props) => {
</NavLink>
</NavItem>
);
-};
+}
CustomNavItem.propTypes = {
className: PropTypes.string,
diff --git a/web/js/components/smart-handoffs/granule-count.js b/web/js/components/smart-handoffs/granule-count.js
index d20a33fad..8cf75b8c4 100644
--- a/web/js/components/smart-handoffs/granule-count.js
+++ b/web/js/components/smart-handoffs/granule-count.js
@@ -138,12 +138,10 @@ export default function GranuleCount (props) {
<div className="granule-count-info">
{!isLoading && (
- <>
- <span className="fade-in">
+ <span className="fade-in">
{currentExtent && granulesExist && selectedGranules >= 0 && `${selectedGranules} of `}
{granulesExist ? totalGranules : 'NONE'}
- </span>
- </>
+ </span>
)}
{!isLoading ? renderDownloadSize() : renderLoading()}
diff --git a/web/js/components/smart-handoffs/smart-handoff-granule-alert.js b/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
index 8cf280e20..29c231c90 100644
--- a/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
+++ b/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
@@ -1,39 +1,41 @@
import React from 'react';
-const GranuleAlertModalBody = () => (
- <div className="basic-modal">
+function GranuleAlertModalBody() {
+ return (
+ <div className="basic-modal">
- <h1>
- Why am I seeing NONE or “0 out of n” granules when there is imagery displayed on the map?
- </h1>
+ <h1>
+ Why am I seeing NONE or “0 out of n” granules when there is imagery displayed on the map?
+ </h1>
- <p>
- Many layers in @NAME@ are made available in
- {' '}
- <a href="https://earthdata.nasa.gov/earth-observation-data/near-real-time/near-real-time-versus-standard-products" target="_blank" rel="noopener noreferrer">Near Real-Time (NRT)</a>
- {' '}
- and then &quot;backfilled&quot; by the corresponding Standard (STD) product when it is available. @NAME@ displays them on a
- <a href="https://nasa-gibs.github.io/gibs-api-docs/access-advanced-topics/#best-available-layers" target="_blank" rel="noopener noreferrer"> &quot;Best Available&quot; </a>
- basis, showing Standard-quality imagery if it is available, NRT otherwise.
- </p>
- <p>
- Often layers will have both NRT and STD collections available for download in Earthdata Search. If you are looking
- for data within the last ~7 days you will likely want to use the NRT collection. If you have the NRT collection
- selected and the granule count shows &quot;NONE&quot;, this may be an indication that your selected date is too far in the past and you
- may have better luck with the STD collection.
- </p>
- <p>You may also see NONE or “0 out of n” granules when:</p>
- <ol>
- <li>
- The area of interest does not encompass any of the imagery displayed on the map.
- </li>
- <li>
- The area of interest is encompassing imagery but the collection&apos;s metadata record does not contain the appropriate spatial
- information for this feature to work. Unchecking the &quot;Set Area of Interest&quot; box should address this.
- </li>
- </ol>
+ <p>
+ Many layers in @NAME@ are made available in
+ {' '}
+ <a href="https://earthdata.nasa.gov/earth-observation-data/near-real-time/near-real-time-versus-standard-products" target="_blank" rel="noopener noreferrer">Near Real-Time (NRT)</a>
+ {' '}
+ and then &quot;backfilled&quot; by the corresponding Standard (STD) product when it is available. @NAME@ displays them on a
+ <a href="https://nasa-gibs.github.io/gibs-api-docs/access-advanced-topics/#best-available-layers" target="_blank" rel="noopener noreferrer"> &quot;Best Available&quot; </a>
+ basis, showing Standard-quality imagery if it is available, NRT otherwise.
+ </p>
+ <p>
+ Often layers will have both NRT and STD collections available for download in Earthdata Search. If you are looking
+ for data within the last ~7 days you will likely want to use the NRT collection. If you have the NRT collection
+ selected and the granule count shows &quot;NONE&quot;, this may be an indication that your selected date is too far in the past and you
+ may have better luck with the STD collection.
+ </p>
+ <p>You may also see NONE or “0 out of n” granules when:</p>
+ <ol>
+ <li>
+ The area of interest does not encompass any of the imagery displayed on the map.
+ </li>
+ <li>
+ The area of interest is encompassing imagery but the collection&apos;s metadata record does not contain the appropriate spatial
+ information for this feature to work. Unchecking the &quot;Set Area of Interest&quot; box should address this.
+ </li>
+ </ol>
- </div>
-);
+ </div>
+ );
+}
export default GranuleAlertModalBody;
diff --git a/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js b/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
index 5fc4d5fb5..258eb83ad 100644
--- a/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
+++ b/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
@@ -37,19 +37,19 @@ class CustomIntervalSelector extends PureComponent {
if (value >= 0 && value <= 1000) {
changeCustomInterval(value, customInterval);
}
- }
+ };
changeZoomLevel = (zoomLevel) => {
const { changeCustomInterval, customDelta } = this.props;
changeCustomInterval(customDelta, TIME_SCALE_TO_NUMBER[zoomLevel]);
- }
+ };
- handleKeyPress= (e) => {
+ handleKeyPress = (e) => {
const { closeModal } = this.props;
if (e.key === 'Escape') {
closeModal();
}
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/custom-interval-selector/delta-input.js b/web/js/components/timeline/custom-interval-selector/delta-input.js
index f5d34654a..5d6940fe0 100644
--- a/web/js/components/timeline/custom-interval-selector/delta-input.js
+++ b/web/js/components/timeline/custom-interval-selector/delta-input.js
@@ -31,7 +31,7 @@ class DeltaInput extends PureComponent {
this.setValue(value);
}
}
- }
+ };
handleKeyPress = (e) => {
let { value } = this.state;
@@ -49,11 +49,11 @@ class DeltaInput extends PureComponent {
this.handleBlur();
}
}
- }
+ };
handleFocus = (e) => {
e.target.select();
- }
+ };
handleBlur = () => {
const { changeDelta } = this.props;
@@ -67,13 +67,13 @@ class DeltaInput extends PureComponent {
valid: false,
});
}
- }
+ };
setValue = (value) => {
this.setState({
value,
});
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/custom-interval-selector/interval-select.js b/web/js/components/timeline/custom-interval-selector/interval-select.js
index 83b51375d..965b1a5d7 100644
--- a/web/js/components/timeline/custom-interval-selector/interval-select.js
+++ b/web/js/components/timeline/custom-interval-selector/interval-select.js
@@ -13,7 +13,7 @@ import {
*
* @class TimeScaleSelect
*/
-const IntervalSelect = (props) => {
+function IntervalSelect(props) {
const {
zoomLevel,
hasSubdailyLayers,
@@ -106,7 +106,7 @@ const IntervalSelect = (props) => {
)}
</>
);
-};
+}
IntervalSelect.propTypes = {
changeZoomLevel: PropTypes.func,
diff --git a/web/js/components/timeline/custom-interval-selector/mobile-custom-interval-selector.js b/web/js/components/timeline/custom-interval-selector/mobile-custom-interval-selector.js
index 042f4d3a9..e21b19bd4 100644
--- a/web/js/components/timeline/custom-interval-selector/mobile-custom-interval-selector.js
+++ b/web/js/components/timeline/custom-interval-selector/mobile-custom-interval-selector.js
@@ -12,7 +12,7 @@ import {
changeCustomInterval as changeCustomIntervalAction,
} from '../../../modules/date/actions';
-const MobileCustomIntervalSelector = (props) => {
+function MobileCustomIntervalSelector(props) {
const {
changeCustomInterval,
customInterval,
@@ -50,7 +50,7 @@ const MobileCustomIntervalSelector = (props) => {
</div>
</div>
);
-};
+}
const mapDispatchToProps = (dispatch) => ({
changeCustomInterval: (delta, timeScale) => {
diff --git a/web/js/components/timeline/mobile-date-picker.js b/web/js/components/timeline/mobile-date-picker.js
index 119a2a363..e7f49b235 100644
--- a/web/js/components/timeline/mobile-date-picker.js
+++ b/web/js/components/timeline/mobile-date-picker.js
@@ -79,7 +79,7 @@ class MobileDatePicker extends Component {
this.setState({
isOpen: true,
});
- }
+ };
handleCancel = () => {
const {
@@ -89,13 +89,13 @@ class MobileDatePicker extends Component {
isOpen: false,
time: this.convertToUTCDateObject(date),
});
- }
+ };
handleChange = (date) => {
this.setState({
time: date,
});
- }
+ };
handleSelect = (time) => {
const { onDateChange } = this.props;
@@ -106,7 +106,7 @@ class MobileDatePicker extends Component {
// convert date back to local time
const date = this.convertToLocalDateObject(time);
onDateChange(getISODateFormatted(date));
- }
+ };
// used for init mount
setInitDates = () => {
@@ -120,26 +120,26 @@ class MobileDatePicker extends Component {
minDate: this.convertToUTCDateObject(startDateLimit),
maxDate: this.convertToUTCDateObject(endDateLimit),
});
- }
+ };
// change to UTC offset time for date picker controls
convertToUTCDateObject = (dateString) => {
const date = new Date(dateString);
const dateUTC = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
return dateUTC;
- }
+ };
// change to offset time used in parent component date setting functions
convertToLocalDateObject = (date) => {
const dateLocal = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
return dateLocal;
- }
+ };
getHeaderTime = (time, isSubdaily) => (
<div className="datepicker-header">
{getDisplayDate(new Date(this.convertToLocalDateObject(time)), isSubdaily)}
</div>
- )
+ );
render() {
const {
diff --git a/web/js/components/timeline/timeline-axis/date-tooltip/date-tooltip.js b/web/js/components/timeline/timeline-axis/date-tooltip/date-tooltip.js
index fdeec9cc9..bc27ccd70 100644
--- a/web/js/components/timeline/timeline-axis/date-tooltip/date-tooltip.js
+++ b/web/js/components/timeline/timeline-axis/date-tooltip/date-tooltip.js
@@ -49,7 +49,7 @@ class DateTooltip extends Component {
this.setState({
showTooltip: shouldDisplay,
});
- }
+ };
displayAndTimeoutTooltip = () => {
clearTimeout(this.showTooltipTimeout);
@@ -57,7 +57,7 @@ class DateTooltip extends Component {
this.showTooltipTimeout = setTimeout(() => {
this.updateTooltipDisplayState(false);
}, 1800);
- }
+ };
/**
* @param {String} time
@@ -122,7 +122,7 @@ class DateTooltip extends Component {
display,
width: `${width}px`,
};
- }
+ };
render() {
const { showTooltip } = this.state;
diff --git a/web/js/components/timeline/timeline-axis/grid-range/grid-range.js b/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
index 1cb1edb6f..e9e260d98 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
@@ -52,33 +52,31 @@ class GridRange extends PureComponent {
className="axis-grid-container"
transform={`translate(${transformX})`}
>
- <>
- {timeRange.map((item, index) => (
- item.withinRange
- ? (
- /* eslint react/no-array-index-key: 1 */
- <React.Fragment key={index}>
- <TileRect
- item={item}
- index={index}
- gridWidth={gridWidth}
- showHover={showHover}
- timeScale={timeScale}
- />
- {tileTextCondition(item.dateObject)
- ? (
- <TileText
- item={item}
- index={index}
- gridWidth={gridWidth}
- />
- )
- : null }
- </React.Fragment>
- )
- : null
- ))}
- </>
+ {timeRange.map((item, index) => (
+ item.withinRange
+ ? (
+ /* eslint react/no-array-index-key: 1 */
+ <React.Fragment key={index}>
+ <TileRect
+ item={item}
+ index={index}
+ gridWidth={gridWidth}
+ showHover={showHover}
+ timeScale={timeScale}
+ />
+ {tileTextCondition(item.dateObject)
+ ? (
+ <TileText
+ item={item}
+ index={index}
+ gridWidth={gridWidth}
+ />
+ )
+ : null }
+ </React.Fragment>
+ )
+ : null
+ ))}
</g>
);
}
diff --git a/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js b/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
index 848bb2085..7c498d6b1 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
@@ -75,7 +75,7 @@ class TileRect extends PureComponent {
showHover = (e) => {
const { item, index, showHover } = this.props;
showHover(e, item.rawDate, item.rawNextDate, index);
- }
+ };
render() {
const {
@@ -89,46 +89,44 @@ class TileRect extends PureComponent {
const whiteLineStrokeWidth = lineLengthY !== 10 ? 2 : 1;
const indexGridWithCoeff = index * gridWidth;
return (
- <>
- <g onMouseMove={this.showHover}>
- <rect
- className="axis-grid-rect"
- width={gridWidth}
- height={65}
- x={indexGridWithCoeff}
- fill="transparent"
- />
- <line
- className="axis-grid-line"
- stroke="black"
- strokeLinecap="round"
- strokeWidth="0.2"
- x1={indexGridWithCoeff + 2.2}
- x2={indexGridWithCoeff + 2.2}
- y1="0"
- y2={lineLengthY}
- />
- <line
- className="axis-grid-line"
- stroke="#555"
- strokeWidth={1}
- x1={indexGridWithCoeff + 1}
- x2={indexGridWithCoeff + 1 + gridWidth}
- y1="46"
- y2="46"
- />
- <line
- className="axis-grid-line"
- stroke="white"
- strokeLinecap="round"
- strokeWidth={whiteLineStrokeWidth}
- x1={indexGridWithCoeff + 1}
- x2={indexGridWithCoeff + 1}
- y1="0"
- y2={lineLengthY}
- />
- </g>
- </>
+ <g onMouseMove={this.showHover}>
+ <rect
+ className="axis-grid-rect"
+ width={gridWidth}
+ height={65}
+ x={indexGridWithCoeff}
+ fill="transparent"
+ />
+ <line
+ className="axis-grid-line"
+ stroke="black"
+ strokeLinecap="round"
+ strokeWidth="0.2"
+ x1={indexGridWithCoeff + 2.2}
+ x2={indexGridWithCoeff + 2.2}
+ y1="0"
+ y2={lineLengthY}
+ />
+ <line
+ className="axis-grid-line"
+ stroke="#555"
+ strokeWidth={1}
+ x1={indexGridWithCoeff + 1}
+ x2={indexGridWithCoeff + 1 + gridWidth}
+ y1="46"
+ y2="46"
+ />
+ <line
+ className="axis-grid-line"
+ stroke="white"
+ strokeLinecap="round"
+ strokeWidth={whiteLineStrokeWidth}
+ x1={indexGridWithCoeff + 1}
+ x2={indexGridWithCoeff + 1}
+ y1="0"
+ y2={lineLengthY}
+ />
+ </g>
);
}
}
diff --git a/web/js/components/timeline/timeline-axis/grid-range/tile-text.js b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
index 01ab3651c..97302fd97 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
@@ -30,34 +30,32 @@ const axisScaleTextElementWrapper = (item, index, gridWidth) => {
xOffsetAdded = 5;
}
return (
- <>
- <g
- transform={`translate(${indexGridWithCoeff + xOffsetAdded})`}
+ <g
+ transform={`translate(${indexGridWithCoeff + xOffsetAdded})`}
+ >
+ <text
+ className={`axis-grid-text axis-grid-text-${item.timeScale}`}
+ x="0"
+ y="62"
+ fill="white"
+ clipPath="url(#textDisplay)"
>
- <text
- className={`axis-grid-text axis-grid-text-${item.timeScale}`}
- x="0"
- y="62"
- fill="white"
- clipPath="url(#textDisplay)"
- >
- {dateText}
- </text>
- {item.timeScale === 'day'
- ? (
- <text
- className="axis-grid-text axis-grid-text-year"
- x="40"
- y="62"
- fill="#cccccc"
- clipPath="url(#textDisplay)"
- >
- {dateTextYear}
- </text>
- )
- : null}
- </g>
- </>
+ {dateText}
+ </text>
+ {item.timeScale === 'day'
+ ? (
+ <text
+ className="axis-grid-text axis-grid-text-year"
+ x="40"
+ y="62"
+ fill="#cccccc"
+ clipPath="url(#textDisplay)"
+ >
+ {dateTextYear}
+ </text>
+ )
+ : null}
+ </g>
);
};
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index 429d00224..2d08c4687 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -468,7 +468,7 @@ class TimelineAxis extends Component {
hitRightBound: false,
updatedTimeScale: true,
}, updatePositioning(updatePositioningArguments, isYearOrMonth ? hoverTime : hoverTimeString));
- }
+ };
/**
* @desc update dates in range based on dragging axis
@@ -519,7 +519,7 @@ class TimelineAxis extends Component {
timelineEndDateLimit,
);
return timeRangeArray;
- }
+ };
/**
* @desc update dates in range based on dragging axis
@@ -622,7 +622,7 @@ class TimelineAxis extends Component {
newDraggerPosition,
newDraggerPositionB,
};
- }
+ };
/**
* @desc helper function used in updateTimeRangeFromDrag
@@ -660,7 +660,7 @@ class TimelineAxis extends Component {
newDraggerPosition: updatedDraggerPosition,
isVisible: false,
};
- }
+ };
/**
@@ -696,7 +696,7 @@ class TimelineAxis extends Component {
}
}
}
- }
+ };
/**
* @desc check if selectedDate will be within acceptable visible axis width
@@ -751,7 +751,7 @@ class TimelineAxis extends Component {
withinRange: newDraggerWithinRangeCheck,
newDateInThePast,
};
- }
+ };
/**
* @desc helper used in componentDidUpdate
@@ -766,7 +766,7 @@ class TimelineAxis extends Component {
? 0.25
: 0.75;
this.updateScale(date, timeScale, leftOffsetFixedCoefficient);
- }
+ };
// #### Drag/mouse handlers ####
/**
@@ -786,7 +786,7 @@ class TimelineAxis extends Component {
showHoverOn();
}
}
- }
+ };
/**
* @desc determine wheel type function of scroll or pan
@@ -813,7 +813,7 @@ class TimelineAxis extends Component {
} else if (xTypeChangePan) {
this.handleWheelPan(e);
}
- }
+ };
/**
* @desc changes timeScale with wheel pan
@@ -911,7 +911,7 @@ class TimelineAxis extends Component {
this.setState({
clientXOnDrag: clientX,
});
- }
+ };
/**
* @desc move dragger on axis click - calculated based on hover
@@ -952,7 +952,7 @@ class TimelineAxis extends Component {
}
updateDraggerDatePosition(hoverTime, draggerSelected, null, true, otherDraggerVisible, false);
}
- }
+ };
/**
* @desc move dragger on axis click - calculated based on pageX vs. hover used for mouse
@@ -1029,7 +1029,7 @@ class TimelineAxis extends Component {
}
updateDraggerDatePosition(newDraggerTime, draggerSelected, null, true, otherDraggerVisible, false);
}
- }
+ };
/**
* @desc handle start drag of axis sets dragging state
@@ -1043,7 +1043,7 @@ class TimelineAxis extends Component {
if (!isTimelineDragging) {
updateTimelineMoveAndDrag(true);
}
- }
+ };
/**
* @desc drag axis - will update date range if dragged into past/future past dragSentinelChangeNumber
@@ -1381,7 +1381,7 @@ class TimelineAxis extends Component {
leftOffset,
width,
};
- }
+ };
/**
* @desc get DOM coverage line
@@ -1442,19 +1442,18 @@ class TimelineAxis extends Component {
const axisWidthStr = `${axisWidth}px`;
return (
- <>
- <div
- className="timeline-axis-container"
- style={{ width: axisWidthStr }}
- onMouseDown={this.handleMouseDown}
- onMouseUp={this.setLineTime}
- onWheel={this.handleWheelType}
- onMouseOver={this.showHoverOn}
- onMouseLeave={showHoverOff}
- onTouchStart={this.handleMouseDown}
- onTouchEnd={this.setLineTimeTouch}
- >
- {currentTimeRange
+ <div
+ className="timeline-axis-container"
+ style={{ width: axisWidthStr }}
+ onMouseDown={this.handleMouseDown}
+ onMouseUp={this.setLineTime}
+ onWheel={this.handleWheelType}
+ onMouseOver={this.showHoverOn}
+ onMouseLeave={showHoverOff}
+ onTouchStart={this.handleMouseDown}
+ onTouchEnd={this.setLineTimeTouch}
+ >
+ {currentTimeRange
&& (
<svg
className="timeline-axis-svg"
@@ -1531,8 +1530,7 @@ class TimelineAxis extends Component {
</Draggable>
</svg>
)}
- </div>
- </>
+ </div>
);
}
}
diff --git a/web/js/components/timeline/timeline-controls/animation-button.js b/web/js/components/timeline/timeline-controls/animation-button.js
index bc72b392f..996c19e65 100644
--- a/web/js/components/timeline/timeline-controls/animation-button.js
+++ b/web/js/components/timeline/timeline-controls/animation-button.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { UncontrolledTooltip } from 'reactstrap';
-const AnimationButton = (props) => {
+function AnimationButton(props) {
const {
disabled,
label,
@@ -57,7 +57,7 @@ const AnimationButton = (props) => {
</div>
</div>
);
-};
+}
AnimationButton.propTypes = {
breakpoints: PropTypes.object,
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js b/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
index 373af95cd..210c0248d 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
@@ -13,12 +13,12 @@ class AxisTimeScaleChangeControls extends PureComponent {
onClickUp = () => {
const { decrementTimeScale } = this.props;
decrementTimeScale();
- }
+ };
onClickDown = () => {
const { incrementTimeScale } = this.props;
incrementTimeScale();
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
index 9a38084ca..3d990941a 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
@@ -38,73 +38,71 @@ class AxisTimeScaleChangeTooltip extends PureComponent {
render() {
const { timeScale, toolTipHovered, hasSubdailyLayers } = this.props;
return (
- <>
- <div id="zoom-btn-container-axis">
- <span
- id="current-zoom"
- className={
+ <div id="zoom-btn-container-axis">
+ <span
+ id="current-zoom"
+ className={
`zoom-btn zoom-level-display-text zoom-${timeScale.toLowerCase()}`
}
- >
- {timeScale}
- </span>
- <div
- className="wv-zoom-tooltip"
- style={{ display: toolTipHovered ? 'block' : 'none' }}
- >
- <div id="timeline-zoom" className="timeline-zoom">
- <label
- style={{
- textDecoration: 'underline',
- paddingBottom: '4px',
- color: '#fff',
- }}
- >
- TIMESCALE
- </label>
- <span
- id="zoom-years"
- className="zoom-btn zoom-years"
- onClick={this.changeTimeScaleYear}
- >
- YEAR
- </span>
- <span
- id="zoom-months"
- className="zoom-btn zoom-months"
- onClick={this.changeTimeScaleMonth}
- >
- MONTH
- </span>
- <span
- id="zoom-days"
- className="zoom-btn zoom-days"
- onClick={this.changeTimeScaleDay}
- >
- DAY
- </span>
- {hasSubdailyLayers ? (
- <>
- <span
- id="zoom-hours"
- className="zoom-btn zoom-hours"
- onClick={this.changeTimeScaleHour}
- >
- HOUR
- </span>
- <span
- id="zoom-minutes"
- className="zoom-btn zoom-minutes"
- onClick={this.changeTimeScaleMinute}
- >
- MINUTE
- </span>
- </>
- ) : null}
- </div>
+ >
+ {timeScale}
+ </span>
+ <div
+ className="wv-zoom-tooltip"
+ style={{ display: toolTipHovered ? 'block' : 'none' }}
+ >
+ <div id="timeline-zoom" className="timeline-zoom">
+ <label
+ style={{
+ textDecoration: 'underline',
+ paddingBottom: '4px',
+ color: '#fff',
+ }}
+ >
+ TIMESCALE
+ </label>
+ <span
+ id="zoom-years"
+ className="zoom-btn zoom-years"
+ onClick={this.changeTimeScaleYear}
+ >
+ YEAR
+ </span>
+ <span
+ id="zoom-months"
+ className="zoom-btn zoom-months"
+ onClick={this.changeTimeScaleMonth}
+ >
+ MONTH
+ </span>
+ <span
+ id="zoom-days"
+ className="zoom-btn zoom-days"
+ onClick={this.changeTimeScaleDay}
+ >
+ DAY
+ </span>
+ {hasSubdailyLayers ? (
+ <>
+ <span
+ id="zoom-hours"
+ className="zoom-btn zoom-hours"
+ onClick={this.changeTimeScaleHour}
+ >
+ HOUR
+ </span>
+ <span
+ id="zoom-minutes"
+ className="zoom-btn zoom-minutes"
+ onClick={this.changeTimeScaleMinute}
+ >
+ MINUTE
+ </span>
+ </>
+ ) : null}
</div>
</div>
- </>
+ </div>
);
}
}
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change.js b/web/js/components/timeline/timeline-controls/axis-timescale-change.js
index 23696deae..59ae27443 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change.js
@@ -31,7 +31,7 @@ class AxisTimeScaleChange extends PureComponent {
toolTipHovered: true,
});
}
- }
+ };
// TimeScale select tooltip off
toolTipHoverOff = () => {
@@ -39,7 +39,7 @@ class AxisTimeScaleChange extends PureComponent {
this.setState({
toolTipHovered: false,
});
- }
+ };
// Toggle visibility of map scales
disableMapScales = (disable) => {
@@ -49,7 +49,7 @@ class AxisTimeScaleChange extends PureComponent {
for (const el of [...imperialMapScale, ...metricMapScale]) {
el.style.opacity = opacity;
}
- }
+ };
// ex: month(2) to day(3)
incrementTimeScale = () => {
@@ -63,7 +63,7 @@ class AxisTimeScaleChange extends PureComponent {
if (timeScaleNumber < maxTimeScaleNumber) {
changeTimeScale(timeScaleNumber + 1);
}
- }
+ };
// ex: day(3) to month(2)
decrementTimeScale = () => {
@@ -75,7 +75,7 @@ class AxisTimeScaleChange extends PureComponent {
if (timeScaleNumber > 1) {
changeTimeScale(timeScaleNumber - 1);
}
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/timeline-controls/date-change-arrows.js b/web/js/components/timeline/timeline-controls/date-change-arrows.js
index 3f643590f..3f6ce67af 100644
--- a/web/js/components/timeline/timeline-controls/date-change-arrows.js
+++ b/web/js/components/timeline/timeline-controls/date-change-arrows.js
@@ -53,7 +53,7 @@ class DateChangeArrows extends PureComponent {
const { setArrowDown } = this.props;
setArrowDown(direction);
arrowDownCheckTimer = null;
- }
+ };
handleKeyDown = (e) => {
const { arrowDown } = this.props;
@@ -65,7 +65,7 @@ class DateChangeArrows extends PureComponent {
e.preventDefault();
if (!arrowDown) this.onArrowDown(direction);
}
- }
+ };
handleKeyUp = (e) => {
const direction = e.keyCode === 37 ? 'left' : e.keyCode === 39 ? 'right' : null;
@@ -80,7 +80,7 @@ class DateChangeArrows extends PureComponent {
arrowDownCheckTimer = setTimeout(() => {
this.clickAndHold(direction);
}, CLICK_HOLD_DELAY);
- }
+ };
onArrowUp = (direction) => {
const { setArrowUp, arrowDown } = this.props;
@@ -90,7 +90,7 @@ class DateChangeArrows extends PureComponent {
clearInterval(intervals[direction]);
intervals[direction] = 0;
if (arrowDown) setArrowUp();
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/timeline-controls/timescale-interval-change.js b/web/js/components/timeline/timeline-controls/timescale-interval-change.js
index e46febaae..f2f2505d6 100644
--- a/web/js/components/timeline/timeline-controls/timescale-interval-change.js
+++ b/web/js/components/timeline/timeline-controls/timescale-interval-change.js
@@ -63,49 +63,49 @@ class TimeScaleIntervalChange extends PureComponent {
this.setState({
toolTipHovered: hovered,
});
- }
+ };
onClick = () => {
const { toolTipHovered } = this.state;
this.setState({
toolTipHovered: !toolTipHovered,
});
- }
+ };
handleClickInterval = (timescale, openModal = false) => {
// send props function to change timescale interval throughout app
this.setState({
toolTipHovered: false,
}, this.setTimeScaleIntervalChangeUnit(timescale, openModal));
- }
+ };
/**
* @desc handle SELECT of LEFT/RIGHT interval selection
* @param {String} timeScale
* @param {Boolean} modalOpen - is custom interval modal open
*/
- setTimeScaleIntervalChangeUnit = (timeScale, openModal) => {
- const {
- customInterval, customDelta, selectInterval, toggleCustomModal, modalType,
- } = this.props;
- const customSelected = timeScale === 'custom';
- let delta;
- let newTimeScale = timeScale;
+ setTimeScaleIntervalChangeUnit = (timeScale, openModal) => {
+ const {
+ customInterval, customDelta, selectInterval, toggleCustomModal, modalType,
+ } = this.props;
+ const customSelected = timeScale === 'custom';
+ let delta;
+ let newTimeScale = timeScale;
- if (openModal) {
- toggleCustomModal(openModal, modalType);
- return;
- }
+ if (openModal) {
+ toggleCustomModal(openModal, modalType);
+ return;
+ }
- if (customSelected && customInterval && customDelta) {
- newTimeScale = customInterval;
- delta = customDelta;
- } else {
- newTimeScale = Number(TIME_SCALE_TO_NUMBER[newTimeScale]);
- delta = 1;
- }
- selectInterval(delta, newTimeScale, customSelected);
- };
+ if (customSelected && customInterval && customDelta) {
+ newTimeScale = customInterval;
+ delta = customDelta;
+ } else {
+ newTimeScale = Number(TIME_SCALE_TO_NUMBER[newTimeScale]);
+ delta = 1;
+ }
+ selectInterval(delta, newTimeScale, customSelected);
+ };
// set custom text for custom interval
setCustomIntervalText = () => {
@@ -113,14 +113,14 @@ class TimeScaleIntervalChange extends PureComponent {
this.setState({
customIntervalText: `${customDelta} ${TIME_SCALE_FROM_NUMBER[customInterval]}`,
});
- }
+ };
// reset custom text for custom interval
resetCustomIntervalText = () => {
this.setState({
customIntervalText: 'Custom',
});
- }
+ };
renderTooltip = () => {
const { toolTipHovered, customIntervalText } = this.state;
@@ -188,7 +188,7 @@ class TimeScaleIntervalChange extends PureComponent {
</div>
</div>
);
- }
+ };
render() {
const {
@@ -202,26 +202,24 @@ class TimeScaleIntervalChange extends PureComponent {
const className = `no-drag interval-btn interval-btn-active${customSelected ? ' custom-interval-text' : ''} ${isDisabled ? ' disabled' : ''}`;
return (
- <>
- <div
- id="timeline-interval-btn-container"
- className="interval-btn-container noselect no-drag"
- onMouseEnter={() => this.setTooltipState(true)}
- onMouseLeave={() => this.setTooltipState(false)}
- onClick={this.onClick}
- >
+ <div
+ id="timeline-interval-btn-container"
+ className="interval-btn-container noselect no-drag"
+ onMouseEnter={() => this.setTooltipState(true)}
+ onMouseLeave={() => this.setTooltipState(false)}
+ onClick={this.onClick}
+ >
- <span
- id="current-interval"
- className={className}
- >
- {customSelected ? customIntervalText : `${1} ${TIME_SCALE_FROM_NUMBER[interval]}`}
- </span>
+ <span
+ id="current-interval"
+ className={className}
+ >
+ {customSelected ? customIntervalText : `${1} ${TIME_SCALE_FROM_NUMBER[interval]}`}
+ </span>
- {!isDisabled ? this.renderTooltip() : null}
+ {!isDisabled ? this.renderTooltip() : null}
- </div>
- </>
+ </div>
);
}
}
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 fa8c6cf3d..e04f4da90 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-item-container.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-item-container.js
@@ -84,7 +84,7 @@ class CoverageItemContainer extends Component {
}, {});
return Object.values(multiDateToDisplay);
- }
+ };
/**
* @desc updateDateRangeState
@@ -95,7 +95,7 @@ class CoverageItemContainer extends Component {
this.setState({
layerDateRanges: dateRange,
});
- }
+ };
render() {
const {
@@ -128,28 +128,27 @@ class CoverageItemContainer extends Component {
// get line container dimensions
const containerLineDimensions = getMatchingCoverageLineDimensions(layer);
return (
- <>
- <div
- className="layer-coverage-line"
- style={{
- width: `${axisWidth}px`,
- }}
+ <div
+ className="layer-coverage-line"
+ style={{
+ width: `${axisWidth}px`,
+ }}
+ >
+ <svg
+ className="layer-coverage-line-svg"
+ width={`${axisWidth}px`}
>
- <svg
- className="layer-coverage-line-svg"
- width={`${axisWidth}px`}
- >
- {needDateRangeBuilt
- ? layerDateRanges.map((itemRange, multiIndex, array) => {
- const { date, interval } = itemRange;
- const dateObj = new Date(date);
- const nextDate = array[multiIndex + 1];
- const rangeDateEnd = getRangeDateEndWithAddedInterval(layer, dateObj, layerPeriod, interval, nextDate);
- // get range line dimensions
- const multiLineRangeOptions = getMatchingCoverageLineDimensions(layer, dateObj, rangeDateEnd);
- // create DOM line element
- const key = `${id}-${multiIndex}`;
- return multiLineRangeOptions.visible
+ {needDateRangeBuilt
+ ? layerDateRanges.map((itemRange, multiIndex, array) => {
+ const { date, interval } = itemRange;
+ const dateObj = new Date(date);
+ const nextDate = array[multiIndex + 1];
+ const rangeDateEnd = getRangeDateEndWithAddedInterval(layer, dateObj, layerPeriod, interval, nextDate);
+ // get range line dimensions
+ const multiLineRangeOptions = getMatchingCoverageLineDimensions(layer, dateObj, rangeDateEnd);
+ // create DOM line element
+ const key = `${id}-${multiIndex}`;
+ return multiLineRangeOptions.visible
&& (
<React.Fragment key={key}>
<CoverageLine
@@ -166,24 +165,23 @@ class CoverageItemContainer extends Component {
/>
</React.Fragment>
);
- })
- : containerLineDimensions.visible && (
- <CoverageLine
- axisWidth={axisWidth}
- positionTransformX={positionTransformX}
- id={id}
- options={containerLineDimensions}
- lineType="SINGLE"
- startDate={startDate}
- endDate={endDate}
- color={lineBackgroundColor}
- layerPeriod={layerPeriod}
- index={`${id}-0`}
- />
- )}
- </svg>
- </div>
- </>
+ })
+ : containerLineDimensions.visible && (
+ <CoverageLine
+ axisWidth={axisWidth}
+ positionTransformX={positionTransformX}
+ id={id}
+ options={containerLineDimensions}
+ lineType="SINGLE"
+ startDate={startDate}
+ endDate={endDate}
+ color={lineBackgroundColor}
+ layerPeriod={layerPeriod}
+ index={`${id}-0`}
+ />
+ )}
+ </svg>
+ </div>
);
}
}
diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-list.js b/web/js/components/timeline/timeline-coverage/coverage-item-list.js
index 22776c91b..0c797f1f5 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-item-list.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-item-list.js
@@ -46,7 +46,7 @@ class CoverageItemList extends Component {
layerHoverCallback = (id, active) => {
this.setState({ hoveredLayer: active ? id : undefined });
- }
+ };
/**
* @desc get layer header with title, subtitle, and full date range
@@ -72,42 +72,40 @@ class CoverageItemList extends Component {
);
return (
- <>
- <div className="layer-coverage-item-header">
- <div
- className="layer-coverage-item-title"
- style={{
- color: titleColor,
- }}
- >
- {title}
- {' '}
- <span
- className="layer-coverage-item-subtitle"
- style={{
- color: textColor,
- }}
- >
- {subtitle}
- </span>
- </div>
- <div
- className="layer-coverage-item-date-range"
+ <div className="layer-coverage-item-header">
+ <div
+ className="layer-coverage-item-title"
+ style={{
+ color: titleColor,
+ }}
+ >
+ {title}
+ {' '}
+ <span
+ className="layer-coverage-item-subtitle"
style={{
- background: layerItemBackground,
color: textColor,
- float: 'left',
- width: inactiveLayers || formattedEndDate ? '205px' : '175px',
}}
>
- <MonospaceDate style={getStyle(formattedStartDate)} date={formattedStartDate || ' Start '} />
- {' - '}
- <MonospaceDate style={getStyle(formattedEndDate)} date={formattedEndDate || ' Present '} />
- </div>
+ {subtitle}
+ </span>
</div>
- </>
+ <div
+ className="layer-coverage-item-date-range"
+ style={{
+ background: layerItemBackground,
+ color: textColor,
+ float: 'left',
+ width: inactiveLayers || formattedEndDate ? '205px' : '175px',
+ }}
+ >
+ <MonospaceDate style={getStyle(formattedStartDate)} date={formattedStartDate || ' Start '} />
+ {' - '}
+ <MonospaceDate style={getStyle(formattedEndDate)} date={formattedEndDate || ' Present '} />
+ </div>
+ </div>
);
- }
+ };
/**
* @desc get formatted time period name
@@ -120,7 +118,7 @@ class CoverageItemList extends Component {
? 'month'
: period === 'yearly'
? 'year'
- : 'minute')
+ : 'minute');
/**
* @desc get range date end with added interval based on period
@@ -176,7 +174,7 @@ class CoverageItemList extends Component {
}
}
return new Date(rangeDateEnd).toISOString();
- }
+ };
/**
* @desc get endDateLimit based on axis and appNow
@@ -210,7 +208,7 @@ class CoverageItemList extends Component {
}
return endDateLimit;
- }
+ };
/**
* @desc get array of dates for layer
@@ -277,7 +275,7 @@ class CoverageItemList extends Component {
}
}
return dateIntervalStartDates;
- }
+ };
/**
* @desc get conditional styling for layer container and coverage line
@@ -316,7 +314,7 @@ class CoverageItemList extends Component {
layerItemBackground,
layerItemOutline,
};
- }
+ };
/**
* @desc get empty layers message DOM element
@@ -329,7 +327,7 @@ class CoverageItemList extends Component {
<p>No visible layers with defined coverage. Add layers or toggle &quot;Include Hidden Layers&quot; if current layers are hidden.</p>
</div>
</div>
- )
+ );
render() {
const {
diff --git a/web/js/components/timeline/timeline-coverage/coverage-line.js b/web/js/components/timeline/timeline-coverage/coverage-line.js
index 327af697e..c04535e46 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-line.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-line.js
@@ -55,7 +55,7 @@ class CoverageLine extends PureComponent {
dateRangeEnd,
toolTipText,
};
- }
+ };
/**
* @desc get line DOM element from full/partial (interval) date range with tooltip
@@ -135,7 +135,7 @@ class CoverageLine extends PureComponent {
</rect>
</g>
);
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/timeline-coverage/info-modal.js b/web/js/components/timeline/timeline-coverage/info-modal.js
index cb0d05b9f..3ca2349aa 100644
--- a/web/js/components/timeline/timeline-coverage/info-modal.js
+++ b/web/js/components/timeline/timeline-coverage/info-modal.js
@@ -1,36 +1,38 @@
import React from 'react';
-const LayerCoverageInfoModal = () => (
- <div className="layer-coverage-info">
- <header>
- <p>
- Temporal availability of active time-varying layers is shown as a set of striped horizontal blue lines in the panel. The total temporal coverage of the layers is shown on the far right.
- </p>
- <p>
- Time-varying layers that have matching temporal coverage are shown in the timeline (bottom of screen) as a solid blue line, making it easier to determine when multiple layers have temporally coincident imagery.
- </p>
- </header>
- <div className="layer-coverage-info-item-container">
- <section className="layer-coverage-info-item-left">
- <img src="images/lc-axis.png" />
- </section>
- <section className="layer-coverage-info-item-right">
- <div>
- <p>
- Including layers that are hidden may affect the display of the timeline’s solid blue overlapping coverage line as it will take into account the dates of those layers, too.
- </p>
- <img src="images/lc-toggle.png" />
- </div>
- <div>
- <p>
- <strong>Note:</strong>
- {' '}
- Note: Active layers showing available temporal coverage may not have imagery available yet (e.g., monthly layers that are processed later in the month).
- </p>
- </div>
- </section>
+function LayerCoverageInfoModal() {
+ return (
+ <div className="layer-coverage-info">
+ <header>
+ <p>
+ Temporal availability of active time-varying layers is shown as a set of striped horizontal blue lines in the panel. The total temporal coverage of the layers is shown on the far right.
+ </p>
+ <p>
+ Time-varying layers that have matching temporal coverage are shown in the timeline (bottom of screen) as a solid blue line, making it easier to determine when multiple layers have temporally coincident imagery.
+ </p>
+ </header>
+ <div className="layer-coverage-info-item-container">
+ <section className="layer-coverage-info-item-left">
+ <img src="images/lc-axis.png" />
+ </section>
+ <section className="layer-coverage-info-item-right">
+ <div>
+ <p>
+ Including layers that are hidden may affect the display of the timeline’s solid blue overlapping coverage line as it will take into account the dates of those layers, too.
+ </p>
+ <img src="images/lc-toggle.png" />
+ </div>
+ <div>
+ <p>
+ <strong>Note:</strong>
+ {' '}
+ Note: Active layers showing available temporal coverage may not have imagery available yet (e.g., monthly layers that are processed later in the month).
+ </p>
+ </div>
+ </section>
+ </div>
</div>
- </div>
-);
+ );
+}
export default LayerCoverageInfoModal;
diff --git a/web/js/components/timeline/timeline-coverage/timeline-coverage.js b/web/js/components/timeline/timeline-coverage/timeline-coverage.js
index 770d1eb55..c8808f854 100644
--- a/web/js/components/timeline/timeline-coverage/timeline-coverage.js
+++ b/web/js/components/timeline/timeline-coverage/timeline-coverage.js
@@ -102,7 +102,7 @@ class TimelineLayerCoveragePanel extends Component {
this.setState({
activeLayers: layers,
});
- }
+ };
/**
* @desc get active layers
@@ -112,7 +112,7 @@ class TimelineLayerCoveragePanel extends Component {
getActiveLayers = (layers) => {
const { shouldIncludeHiddenLayers } = this.state;
return layers.filter((layer) => (shouldIncludeHiddenLayers ? true : layer.visible));
- }
+ };
/**
* @desc get line dimensions for given date range
@@ -190,7 +190,7 @@ class TimelineLayerCoveragePanel extends Component {
layerStartBeforeAxisFront,
layerEndBeforeAxisBack,
};
- }
+ };
/**
* @desc handle open/close modal from clicking handle
@@ -202,7 +202,7 @@ class TimelineLayerCoveragePanel extends Component {
toggleLayerCoveragePanel,
} = this.props;
toggleLayerCoveragePanel(!isTimelineLayerCoveragePanelOpen);
- }
+ };
/**
* @desc add matching coverage to timeline
@@ -219,7 +219,7 @@ class TimelineLayerCoveragePanel extends Component {
activeLayers: layers,
shouldIncludeHiddenLayers: isChecked,
});
- }
+ };
/**
* @desc get startDate and endDate based on layers currently selected for matching coverage
@@ -263,13 +263,13 @@ class TimelineLayerCoveragePanel extends Component {
endDate: endDate.toISOString(),
};
}
- }
+ };
stopPropagation = (e) => {
e.nativeEvent.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
- }
+ };
/**
* @desc render info button for layer coverage panel coverage info modal
@@ -291,7 +291,7 @@ class TimelineLayerCoveragePanel extends Component {
<FontAwesomeIcon icon="question-circle" className="layer-coverage-info-button-icon" />
</a>
);
- }
+ };
/**
* @desc handle dynamic conditional container styling, className, and text label generation
@@ -344,7 +344,7 @@ class TimelineLayerCoveragePanel extends Component {
panelChevronClassName,
isPanelOpenClassName,
};
- }
+ };
render() {
const {
diff --git a/web/js/components/timeline/timeline-draggers/dragger-container.js b/web/js/components/timeline/timeline-draggers/dragger-container.js
index c894b7ade..c64de05c6 100644
--- a/web/js/components/timeline/timeline-draggers/dragger-container.js
+++ b/web/js/components/timeline/timeline-draggers/dragger-container.js
@@ -75,7 +75,7 @@ class DraggerContainer extends PureComponent {
if (draggerName !== draggerSelected) {
onChangeSelectedDragger(draggerName);
}
- }
+ };
/**
* @desc move draggerTimeState to inputTime
@@ -133,7 +133,7 @@ class DraggerContainer extends PureComponent {
// update parent dragger positioning
updateDraggerDatePosition(null, draggerSelected, newDraggerPosition, draggerVisible);
- }
+ };
/**
* @desc handle dragger dragging
@@ -230,7 +230,7 @@ class DraggerContainer extends PureComponent {
// update parent dragger positioning
updateDraggerDatePosition(newDraggerTime, draggerSelected, newDraggerPosition, null, null, true);
});
- }
+ };
render() {
const {
diff --git a/web/js/components/toolbar/share/tooltips.js b/web/js/components/toolbar/share/tooltips.js
index 47d6e9046..2ebf647af 100644
--- a/web/js/components/toolbar/share/tooltips.js
+++ b/web/js/components/toolbar/share/tooltips.js
@@ -38,14 +38,14 @@ class ShareToolTips extends PureComponent {
clearPendingTimeouts = () => {
clearTimeout(this.showCopiedToolTipTimeout);
clearTimeout(this.showErrorTimeout);
- }
+ };
updateToolTipState = (toolTipChange, tooltipErrorChange) => {
this.setState({
showErrorTooltip: tooltipErrorChange,
showCopiedToolTip: toolTipChange,
});
- }
+ };
render() {
const { showErrorTooltip, showCopiedToolTip } = this.state;
diff --git a/web/js/components/tour/content-intro.js b/web/js/components/tour/content-intro.js
index 0e557c25a..aa585a6f6 100644
--- a/web/js/components/tour/content-intro.js
+++ b/web/js/components/tour/content-intro.js
@@ -3,19 +3,21 @@ import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-const TourIntro = (props) => (
- <div className="tour-intro">
- <p className="intro">
- Visually explore the past and the present of this dynamic planet from a satellite&apos;s perspective.
- Select from an array of stories below to learn more about @NAME@, the satellite imagery we provide and events occurring around the world.
- {' '}
- <a href="#" title="Start using @NAME@" onClick={props.toggleModalStart}>
- Start using @NAME@
- <FontAwesomeIcon icon="arrow-right" />
- </a>
- </p>
- </div>
-);
+function TourIntro(props) {
+ return (
+ <div className="tour-intro">
+ <p className="intro">
+ Visually explore the past and the present of this dynamic planet from a satellite&apos;s perspective.
+ Select from an array of stories below to learn more about @NAME@, the satellite imagery we provide and events occurring around the world.
+ {' '}
+ <a href="#" title="Start using @NAME@" onClick={props.toggleModalStart}>
+ Start using @NAME@
+ <FontAwesomeIcon icon="arrow-right" />
+ </a>
+ </p>
+ </div>
+ );
+}
TourIntro.propTypes = {
toggleModalStart: PropTypes.func.isRequired,
diff --git a/web/js/components/tour/modal-tour-complete.js b/web/js/components/tour/modal-tour-complete.js
index df0976942..12dc6175f 100644
--- a/web/js/components/tour/modal-tour-complete.js
+++ b/web/js/components/tour/modal-tour-complete.js
@@ -4,7 +4,7 @@ import {
Modal, ModalHeader, ModalBody, ModalFooter,
} from 'reactstrap';
-const ModalComplete = (props) => {
+function ModalComplete(props) {
const {
currentStory, modalComplete, resetTour, endTour,
} = props;
@@ -71,7 +71,7 @@ const ModalComplete = (props) => {
</Modal>
</div>
);
-};
+}
ModalComplete.propTypes = {
currentStory: PropTypes.object.isRequired,
diff --git a/web/js/components/tour/tour-boxes.js b/web/js/components/tour/tour-boxes.js
index 0af3528bb..dcb69aee9 100644
--- a/web/js/components/tour/tour-boxes.js
+++ b/web/js/components/tour/tour-boxes.js
@@ -3,7 +3,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import TourBox from './tour-box';
-const TourBoxes = (props) => {
+function TourBoxes(props) {
const { stories, storyOrder, selectTour } = props;
return (
<div className="tour-box-container">
@@ -30,7 +30,7 @@ const TourBoxes = (props) => {
</div>
</div>
);
-};
+}
TourBoxes.propTypes = {
selectTour: PropTypes.func.isRequired,
diff --git a/web/js/components/tour/widget-steps.js b/web/js/components/tour/widget-steps.js
index 4487e2796..148f5e94e 100644
--- a/web/js/components/tour/widget-steps.js
+++ b/web/js/components/tour/widget-steps.js
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-const Steps = (props) => {
+function Steps(props) {
const {
currentStep, decreaseStep, incrementStep, totalSteps,
} = props;
@@ -35,7 +35,7 @@ const Steps = (props) => {
</a>
</div>
);
-};
+}
Steps.propTypes = {
currentStep: PropTypes.number.isRequired,
diff --git a/web/js/components/util/arrow.js b/web/js/components/util/arrow.js
index 694b2cb1a..013d6ae46 100644
--- a/web/js/components/util/arrow.js
+++ b/web/js/components/util/arrow.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
/*
* @function Arrow Up/Down
*/
-const Arrow = ({ onClick, type, direction }) => {
+function Arrow({ onClick, type, direction }) {
const containerClassName = `date-arrows date-arrow-${direction}`;
const arrowClassName = `${direction}arrow`;
@@ -19,7 +19,7 @@ const Arrow = ({ onClick, type, direction }) => {
</svg>
</div>
);
-};
+}
Arrow.propTypes = {
direction: PropTypes.string,
diff --git a/web/js/components/util/checkbox.js b/web/js/components/util/checkbox.js
index 8f4efe42e..6c50a2dfa 100644
--- a/web/js/components/util/checkbox.js
+++ b/web/js/components/util/checkbox.js
@@ -20,9 +20,7 @@ export default function Checkbox (props) {
return (
<>
{showDisabledToolTip && (
- <>
- <HoverTooltip target={`#${id}-case`} labelText={title} placement={tooltipPlacement} />
- </>
+ <HoverTooltip target={`#${id}-case`} labelText={title} placement={tooltipPlacement} />
)}
<div id={`${id}-case`} className={caseClassName}>
<input
diff --git a/web/js/components/util/hover-tooltip.js b/web/js/components/util/hover-tooltip.js
index b507c2f5f..615f5eb8d 100644
--- a/web/js/components/util/hover-tooltip.js
+++ b/web/js/components/util/hover-tooltip.js
@@ -9,7 +9,7 @@ import {
* @class HoverTooltip
* @extends React.Component
*/
-const HoverTooltip = (props) => {
+function HoverTooltip(props) {
const {
delay, fade, innerClassName, isMobile, labelText, placement, target,
} = props;
@@ -28,7 +28,7 @@ const HoverTooltip = (props) => {
{labelText}
</UncontrolledTooltip>
);
-};
+}
HoverTooltip.defaultProps = {
placement: 'bottom',
diff --git a/web/js/components/util/image-crop.js b/web/js/components/util/image-crop.js
index 681ffb665..fa1a6529f 100644
--- a/web/js/components/util/image-crop.js
+++ b/web/js/components/util/image-crop.js
@@ -7,7 +7,7 @@ import { pick, some } from 'lodash';
// https://stackoverflow.com/a/13139830
const TRANSPARENT_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
-const RenderCoordinates = (props) => {
+function RenderCoordinates(props) {
const { coordinates, topRightStyle, bottomLeftStyle } = props;
if (bottomLeftStyle.width < 50) {
return '';
@@ -30,9 +30,9 @@ const RenderCoordinates = (props) => {
</div>
</>
);
-};
+}
-const Crop = (props) => {
+function Crop(props) {
const {
onClose,
onChange,
@@ -74,8 +74,10 @@ const Crop = (props) => {
// https://github.com/DominicTobias/react-image-crop/issues/397
const changed = cWidth && cWidth > 0 && cHeight && cHeight > 0
- && some(pick(cropBoundaries, 'x', 'y', 'width', 'height'),
- (value, key) => value !== prevCrop.current[key]);
+ && some(
+ pick(cropBoundaries, 'x', 'y', 'width', 'height'),
+ (value, key) => value !== prevCrop.current[key],
+ );
if (changed) {
onDragStop(cropBoundaries);
} else {
@@ -119,7 +121,7 @@ const Crop = (props) => {
/>
</Portal>
);
-};
+}
export default Crop;
Crop.defaultProps = {
diff --git a/web/js/components/util/switch.js b/web/js/components/util/switch.js
index 7d8569994..316d3968e 100644
--- a/web/js/components/util/switch.js
+++ b/web/js/components/util/switch.js
@@ -4,7 +4,7 @@ import { Tooltip } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
// https://upmostly.com/tutorials/build-a-react-switch-toggle-component
-const Switch = (props) => {
+function Switch(props) {
const {
border,
id,
@@ -86,7 +86,7 @@ const Switch = (props) => {
</div>
</div>
);
-};
+}
Switch.defaultProps = {
containerClassAddition: '',
border: false,
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index 9a6b8b553..11d739268 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -53,7 +53,7 @@ import {
} from '../modules/animation/actions';
import GifButton from '../components/animation-widget/gif-button';
-const RangeHandle = (props) => {
+function RangeHandle(props) {
const {
value, offset, dragging, ...restProps
} = props;
@@ -76,7 +76,7 @@ const RangeHandle = (props) => {
/>
</>
);
-};
+}
const widgetWidth = 334;
const subdailyWidgetWidth = 460;
@@ -206,39 +206,39 @@ class AnimationWidget extends React.Component {
}
}
- onMobileDateChangeStart = (date) => {
- const { onUpdateStartDate } = this.props;
- const dateObj = new Date(date);
- this.debounceDateUpdate(dateObj);
- onUpdateStartDate(dateObj);
- }
+ onMobileDateChangeStart = (date) => {
+ const { onUpdateStartDate } = this.props;
+ const dateObj = new Date(date);
+ this.debounceDateUpdate(dateObj);
+ onUpdateStartDate(dateObj);
+ };
- onMobileDateChangeEnd = (date) => {
- const { onUpdateEndDate } = this.props;
- const dateObj = new Date(date);
- this.debounceDateUpdate(dateObj);
- onUpdateEndDate(dateObj);
- }
+ onMobileDateChangeEnd = (date) => {
+ const { onUpdateEndDate } = this.props;
+ const dateObj = new Date(date);
+ this.debounceDateUpdate(dateObj);
+ onUpdateEndDate(dateObj);
+ };
- onIntervalSelect(timeScale, openModal) {
- let delta;
- const { onIntervalSelect, customInterval, customDelta } = this.props;
- const customSelected = timeScale === 'custom';
+ onIntervalSelect(timeScale, openModal) {
+ let delta;
+ const { onIntervalSelect, customInterval, customDelta } = this.props;
+ const customSelected = timeScale === 'custom';
- if (openModal) {
- this.toggleCustomIntervalModal(openModal);
- return;
- }
+ if (openModal) {
+ this.toggleCustomIntervalModal(openModal);
+ return;
+ }
- if (customSelected && customInterval && customDelta) {
- timeScale = customInterval;
- delta = customDelta;
- } else {
- timeScale = Number(TIME_SCALE_TO_NUMBER[timeScale]);
- delta = 1;
- }
- onIntervalSelect(delta, timeScale, customSelected);
+ if (customSelected && customInterval && customDelta) {
+ timeScale = customInterval;
+ delta = customDelta;
+ } else {
+ timeScale = Number(TIME_SCALE_TO_NUMBER[timeScale]);
+ delta = 1;
}
+ onIntervalSelect(delta, timeScale, customSelected);
+ }
onPushPlay = () => {
const {
@@ -251,7 +251,7 @@ class AnimationWidget extends React.Component {
} = this.zeroDates();
onUpdateStartAndEndDate(startDate, endDate);
onPushPlay();
- }
+ };
/**
* Zeroes start and end animation dates to UTC 00:00:00 for predictable animation range
@@ -288,7 +288,7 @@ class AnimationWidget extends React.Component {
startDate,
endDate,
};
- }
+ };
toggleCustomIntervalModal = (isOpen) => {
const { toggleCustomModal } = this.props;
diff --git a/web/js/containers/error-boundary.js b/web/js/containers/error-boundary.js
index 736651119..f239cd44a 100644
--- a/web/js/containers/error-boundary.js
+++ b/web/js/containers/error-boundary.js
@@ -5,19 +5,21 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { openCustomContent } from '../modules/modal/actions';
const HEADER_TEXT = 'Error!';
-const BODY_COMPONENT = () => (
- <>
- <div className="error-header">
- <FontAwesomeIcon icon="exclamation-triangle" className="error-icon" size="3x" />
- An unexpected error has occurred!
- </div>
- <div className="error-body">
- Please reload the page and try again. If you continue to have problems,
- contact us at
- <a href="mailto:@MAIL@"> @MAIL@ </a>
- </div>
- </>
-);
+function BODY_COMPONENT() {
+ return (
+ <>
+ <div className="error-header">
+ <FontAwesomeIcon icon="exclamation-triangle" className="error-icon" size="3x" />
+ An unexpected error has occurred!
+ </div>
+ <div className="error-body">
+ Please reload the page and try again. If you continue to have problems,
+ contact us at
+ <a href="mailto:@MAIL@"> @MAIL@ </a>
+ </div>
+ </>
+ );
+}
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
diff --git a/web/js/containers/map-interactions/ol-vector-interactions.js b/web/js/containers/map-interactions/ol-vector-interactions.js
index c1e242fa9..b59590497 100644
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@ -108,7 +108,7 @@ export class VectorInteractions extends React.Component {
if (!toggledGranuleFootprint) {
this.clearGranuleFootprint();
}
- }
+ };
handleCursorChange(pixel, map, lon, lat) {
const {
@@ -149,7 +149,7 @@ export class VectorInteractions extends React.Component {
mouseOut = () => {
this.mouseMove.cancel();
events.trigger(GRANULE_HOVERED, null);
- }
+ };
mouseMove({ pixel }, map, crs) {
const {
@@ -311,7 +311,8 @@ const mapDispatchToProps = (dispatch) => ({
const modalWidth = isMobile ? screenWidth : 445;
const modalHeight = isMobile ? screenHeight - mobileTopOffset : 300;
- dispatch(openCustomContent(dialogId,
+ dispatch(openCustomContent(
+ dialogId,
{
backdrop: false,
clickableBehindModal: true,
@@ -336,7 +337,8 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(selectVectorFeaturesActionCreator({}));
}, 1);
},
- }));
+ },
+ ));
},
});
diff --git a/web/js/containers/notifications.js b/web/js/containers/notifications.js
index 7ef1421c7..52b18eea1 100644
--- a/web/js/containers/notifications.js
+++ b/web/js/containers/notifications.js
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import NotificationBlock from '../components/notifications/notification-block';
import { getNumberOfTypeNotSeen } from '../modules/notifications/util';
-const Notifications = (props) => {
+function Notifications(props) {
const { object } = props;
const {
messages, outages, alerts,
@@ -28,7 +28,7 @@ const Notifications = (props) => {
/>
</div>
);
-};
+}
function mapStateToProps(state) {
const { object } = state.notifications;
diff --git a/web/js/containers/share.js b/web/js/containers/share.js
index c71fb8e92..e8c373337 100644
--- a/web/js/containers/share.js
+++ b/web/js/containers/share.js
@@ -87,7 +87,7 @@ class ShareLinkContainer extends Component {
const link = this.getPermalink();
const location = getShortenRequestString(mock, link);
return requestShortLinkAction(location);
- }
+ };
onToggleShorten = () => {
const { shortLinkKey, isShort, queryString } = this.state;
@@ -106,7 +106,7 @@ class ShareLinkContainer extends Component {
isShort: !isShort,
});
}
- }
+ };
copyToClipboard = (url) => {
const { activeTab } = this.state;
@@ -121,13 +121,13 @@ class ShareLinkContainer extends Component {
});
};
copy(url, options);
- }
+ };
getPermalink = (isEmbed) => {
const { queryString } = this.state;
const { selectedDate } = this.props;
return getPermalink(queryString, selectedDate, isEmbed);
- }
+ };
onLinkClick = (type) => {
const permalink = this.getPermalink();
@@ -155,11 +155,11 @@ class ShareLinkContainer extends Component {
} else {
window.open(shareLink, '_blank');
}
- }
+ };
setActiveTab = (activeTab) => {
this.setState({ activeTab });
- }
+ };
renderNavTabs = () => {
const { embedDisableNavLink, isMobile } = this.props;
@@ -195,7 +195,7 @@ class ShareLinkContainer extends Component {
})}
</Nav>
);
- }
+ };
renderInputGroup = (value, type) => (
<InputGroup>
@@ -218,7 +218,7 @@ class ShareLinkContainer extends Component {
</Button>
</InputGroupAddon>
</InputGroup>
- )
+ );
renderLinkTab = () => {
const { shortLink, urlShortening } = this.props;
@@ -262,7 +262,7 @@ class ShareLinkContainer extends Component {
)}
</TabPane>
);
- }
+ };
renderEmbedTab = () => {
const {
@@ -287,7 +287,7 @@ class ShareLinkContainer extends Component {
)}
</TabPane>
);
- }
+ };
renderSocialTab = () => {
const { isMobile } = this.props;
@@ -310,7 +310,7 @@ class ShareLinkContainer extends Component {
)}
</TabPane>
);
- }
+ };
render() {
const {
@@ -320,23 +320,21 @@ class ShareLinkContainer extends Component {
} = this.state;
return (
- <>
- <div className="share-body">
- <ShareToolTips
- activeTab={activeTab}
- tooltipErrorTime={tooltipErrorTime}
- tooltipToggleTime={tooltipToggleTime}
- />
- <div className="share-nav-container">
- {this.renderNavTabs()}
- <TabContent activeTab={activeTab}>
- {this.renderLinkTab()}
- {/* {this.renderEmbedTab()} */}
- {this.renderSocialTab()}
- </TabContent>
- </div>
+ <div className="share-body">
+ <ShareToolTips
+ activeTab={activeTab}
+ tooltipErrorTime={tooltipErrorTime}
+ tooltipToggleTime={tooltipToggleTime}
+ />
+ <div className="share-nav-container">
+ {this.renderNavTabs()}
+ <TabContent activeTab={activeTab}>
+ {this.renderLinkTab()}
+ {/* {this.renderEmbedTab()} */}
+ {this.renderSocialTab()}
+ </TabContent>
</div>
- </>
+ </div>
);
}
}
diff --git a/web/js/containers/sidebar/compare.js b/web/js/containers/sidebar/compare.js
index f8cfcebc7..bfd1bc8d7 100644
--- a/web/js/containers/sidebar/compare.js
+++ b/web/js/containers/sidebar/compare.js
@@ -9,7 +9,7 @@ import { toggleActiveCompareState as toggleActiveCompareStateAction } from '../.
import { getCompareDates } from '../../modules/compare/selectors';
import MonospaceDate from '../../components/util/monospace-date';
-const CompareCase = (props) => {
+function CompareCase(props) {
const {
isActive,
dateA,
@@ -76,7 +76,7 @@ const CompareCase = (props) => {
</div>
</div>
);
-};
+}
const mapDispatchToProps = (dispatch) => ({
toggleActiveCompareState: () => {
diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.js
index 20cc5f7ba..2e484cd4b 100644
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@ -306,67 +306,65 @@ class Sidebar extends React.Component {
<ErrorBoundary>
<section id="wv-sidebar" style={mobileWVSidebarStyle}>
{this.renderSidebarLogo()}
- <>
- {!isDistractionFreeModeActive && isCollapsed && (
- <CollapsedButton
+ {!isDistractionFreeModeActive && isCollapsed && (
+ <CollapsedButton
+ isMobile={isMobile}
+ isEmbed={isEmbedModeActive}
+ onclick={this.toggleSidebar}
+ numberOfLayers={numberOfLayers}
+ />
+ )}
+ <div
+ id="products-holder"
+ className="products-holder-case"
+ style={productsHolderStyle}
+ >
+ {!isCollapsed && (
+ <>
+ <NavCase
+ activeTab={activeTab}
+ onTabClick={onTabClick}
+ tabTypes={tabTypes}
isMobile={isMobile}
- isEmbed={isEmbedModeActive}
- onclick={this.toggleSidebar}
- numberOfLayers={numberOfLayers}
+ toggleSidebar={this.toggleSidebar}
+ isCompareMode={isCompareMode}
+ isDataDisabled={isDataDisabled}
+ isEventsTabDisabledEmbed={isEventsTabDisabledEmbed}
/>
- )}
- <div
- id="products-holder"
- className="products-holder-case"
- style={productsHolderStyle}
- >
- {!isCollapsed && (
- <>
- <NavCase
- activeTab={activeTab}
- onTabClick={onTabClick}
+ <TabContent activeTab={activeTab}>
+ <TabPane tabId="layers">
+ {this.getProductsToRender(activeTab, isCompareMode)}
+ </TabPane>
+ {naturalEvents && activeTab === 'events' && (
+ <TabPane tabId="events">
+ <Events
+ height={subComponentHeight}
+ isLoading={isLoadingEvents}
+ hasRequestError={hasEventRequestError}
+ eventsData={eventsData}
+ sources={eventsSources}
+ />
+ </TabPane>
+ )}
+ {smartHandoffs && activeTab === 'download' && (
+ <TabPane tabId="download">
+ <SmartHandoff
+ isActive={activeTab === 'download'}
tabTypes={tabTypes}
- isMobile={isMobile}
- toggleSidebar={this.toggleSidebar}
- isCompareMode={isCompareMode}
- isDataDisabled={isDataDisabled}
- isEventsTabDisabledEmbed={isEventsTabDisabledEmbed}
/>
- <TabContent activeTab={activeTab}>
- <TabPane tabId="layers">
- {this.getProductsToRender(activeTab, isCompareMode)}
- </TabPane>
- {naturalEvents && activeTab === 'events' && (
- <TabPane tabId="events">
- <Events
- height={subComponentHeight}
- isLoading={isLoadingEvents}
- hasRequestError={hasEventRequestError}
- eventsData={eventsData}
- sources={eventsSources}
- />
- </TabPane>
- )}
- {smartHandoffs && activeTab === 'download' && (
- <TabPane tabId="download">
- <SmartHandoff
- isActive={activeTab === 'download'}
- tabTypes={tabTypes}
- />
- </TabPane>
- )}
+ </TabPane>
+ )}
- <FooterContent
- ref={(el) => { this.footerElement = el; }}
- tabTypes={tabTypes}
- activeTab={activeTab}
- />
+ <FooterContent
+ ref={(el) => { this.footerElement = el; }}
+ tabTypes={tabTypes}
+ activeTab={activeTab}
+ />
- </TabContent>
- </>
- )}
- </div>
- </>
+ </TabContent>
+ </>
+ )}
+ </div>
</section>
</ErrorBoundary>
);
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index 91a8e5970..84e714ee3 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -135,7 +135,7 @@ class SmartHandoff extends Component {
const inRightWing = extent[0] > maxExtent[2] && extent[2] > maxExtent[2];
const isWithinWings = inLeftWing || inRightWing;
this.setState({ showZoomedIntoDatelineAlert: isWithinWings });
- }
+ };
/**
* Fires when the bounding box / crop toggle is activated and changed
@@ -305,40 +305,40 @@ class SmartHandoff extends Component {
* @param {Boolean} selectionOutside
* @param {Boolean} entireSelectionOutside
*/
- updateSelectionAlerts = (entireSelectionOutside) => {
- const { selectionOutsideExtents } = this.state;
- if (entireSelectionOutside !== selectionOutsideExtents) {
- this.setState({ selectionOutsideExtents: entireSelectionOutside });
- }
- }
-
- /**
+ updateSelectionAlerts = (entireSelectionOutside) => {
+ const { selectionOutsideExtents } = this.state;
+ if (entireSelectionOutside !== selectionOutsideExtents) {
+ this.setState({ selectionOutsideExtents: entireSelectionOutside });
+ }
+ };
+
+ /**
* Render alerts to indicate map view/area of interest outside visible extents
* 1) The map view is zoomed entirely into the map wings
* 2) The entire area of interest crossed the dateline
*/
- renderSelectionWarning = () => {
- const {
- showBoundingBox,
- selectionOutsideExtents,
- showZoomedIntoDatelineAlert,
- } = this.state;
-
- const message = showBoundingBox && selectionOutsideExtents && !showZoomedIntoDatelineAlert
- ? 'The selection is outside the available map area.'
- : showZoomedIntoDatelineAlert
- ? 'The map is zoomed into an area with no available data.'
- : '';
-
- return (selectionOutsideExtents || showZoomedIntoDatelineAlert) && message && (
- <AlertUtil
- id="data-download-unavailable-dateline-alert"
- isOpen
- title="Data Download Unavailable"
- message={message}
- />
- );
- }
+ renderSelectionWarning = () => {
+ const {
+ showBoundingBox,
+ selectionOutsideExtents,
+ showZoomedIntoDatelineAlert,
+ } = this.state;
+
+ const message = showBoundingBox && selectionOutsideExtents && !showZoomedIntoDatelineAlert
+ ? 'The selection is outside the available map area.'
+ : showZoomedIntoDatelineAlert
+ ? 'The map is zoomed into an area with no available data.'
+ : '';
+
+ return (selectionOutsideExtents || showZoomedIntoDatelineAlert) && message && (
+ <AlertUtil
+ id="data-download-unavailable-dateline-alert"
+ isOpen
+ title="Data Download Unavailable"
+ message={message}
+ />
+ );
+ };
renderCollectionTooltip = ({ value, title }, tooltipTarget) => {
const { getConceptUrl } = this.props;
@@ -360,7 +360,7 @@ class SmartHandoff extends Component {
</div>
</UncontrolledTooltip>
);
- }
+ };
/**
* Render radio buttons for layer selection
@@ -504,9 +504,7 @@ class SmartHandoff extends Component {
<div className="smart-handoff-side-panel error">
{requestFailed
? (
- <>
- <h1>Data records from the Common Metadata Repository (CMR) could not be reached. Data downloads are not possible at this time.</h1>
- </>
+ <h1>Data records from the Common Metadata Repository (CMR) could not be reached. Data downloads are not possible at this time.</h1>
)
: (
<>
@@ -523,7 +521,7 @@ class SmartHandoff extends Component {
)}
</div>
);
- }
+ };
renderLoadingSpinner = () => {
const containerStyle = {
@@ -541,7 +539,7 @@ class SmartHandoff extends Component {
<Spinner style={spinnerStyle} color="light" size="lg" />
</div>
);
- }
+ };
/**
* Default render which displays the download panel
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 6ebb17e02..b61f4d495 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -258,7 +258,7 @@ class Timeline extends React.Component {
// chain throttled timescale wheel change call after debounce for smoother UX
throttleChangeTimeScaleWheel = (e) => {
this.throttleChangeTimeScaleWheelFire(e);
- }
+ };
// HOVER TIME
/**
@@ -275,7 +275,7 @@ class Timeline extends React.Component {
leftOffset: leftOffset - parentOffset, // relative location from parent bounding box of mouse hover position (i.e. BLUE LINE)
});
});
- }
+ };
/**
* @desc show hover line
@@ -289,7 +289,7 @@ class Timeline extends React.Component {
showHoverLine: true,
});
}
- }
+ };
/**
* @desc hide hover line
@@ -302,7 +302,7 @@ class Timeline extends React.Component {
showHoverLine: false,
});
}
- }
+ };
/**
* @desc toggle dragger time on/off
@@ -315,7 +315,7 @@ class Timeline extends React.Component {
showHoverLine: false,
isDraggerDragging: toggleBoolean,
});
- }
+ };
/**
* @desc handle svg blue line axis hover
@@ -363,7 +363,7 @@ class Timeline extends React.Component {
});
}
});
- }
+ };
/**
* @desc handles dynamic position changes from axis that affect dragger and range select
@@ -411,7 +411,7 @@ class Timeline extends React.Component {
animationEndLocation,
hoverTime,
});
- }
+ };
/**
* @desc handles dynamic positioning update based on simple drag
@@ -439,7 +439,7 @@ class Timeline extends React.Component {
animationStartLocation,
animationEndLocation,
});
- }
+ };
/**
* @desc handles dynamic positioning update based on axis drag stop event
@@ -463,7 +463,7 @@ class Timeline extends React.Component {
transformX,
hoverTime,
});
- }
+ };
/**
* @desc update is timeline moved (drag timeline vs. click) and if timeline is dragging
@@ -474,7 +474,7 @@ class Timeline extends React.Component {
this.setState({
isTimelineDragging,
});
- }
+ };
/**
* @desc handle left/right arrow decrement/increment date
@@ -581,7 +581,7 @@ class Timeline extends React.Component {
} else if (timeScaleNumber < maxTimeScaleNumber) {
this.changeTimeScale(timeScaleNumber + 1);
}
- }
+ };
/**
* @desc open animation widget
@@ -642,7 +642,7 @@ class Timeline extends React.Component {
isAnimationDraggerDragging: isDragging,
});
this.determineAnimationDraggerUpdate(startDate, endDate);
- }
+ };
/**
* @desc handle animation date dragger updates of startDate, endDate, or both
@@ -666,7 +666,7 @@ class Timeline extends React.Component {
} else if (endChanged) {
this.debounceOnUpdateEndDate(endDate);
}
- }
+ };
/**
* @desc handle animation dragger location and date state update
@@ -695,7 +695,7 @@ class Timeline extends React.Component {
animationStartLocationDate: startDate,
animationEndLocationDate: endDate,
});
- }
+ };
/**
* @desc handle animation dragger location and date state update and global date update
@@ -717,7 +717,7 @@ class Timeline extends React.Component {
if (didStartDateChange || didEndDateChange) {
this.debounceOnUpdateStartAndEndDate(startDate, endDate);
}
- }
+ };
// DRAGGER
/**
@@ -759,7 +759,7 @@ class Timeline extends React.Component {
this.onDateChange(newDate, 'selectedB');
}
}
- }
+ };
/**
* @desc set dragger visibility
@@ -772,7 +772,7 @@ class Timeline extends React.Component {
draggerVisible,
draggerVisibleB,
});
- }
+ };
/**
* @desc set matching layer coverage range for selected layers timeline
@@ -784,7 +784,7 @@ class Timeline extends React.Component {
matchingTimelineCoverage: dateRange,
shouldIncludeHiddenLayers,
});
- }
+ };
/**
* @desc toggle layer coverage panel open/closed
@@ -800,7 +800,7 @@ class Timeline extends React.Component {
this.setState({
isTimelineLayerCoveragePanelOpen: isOpen,
});
- }
+ };
/**
* @desc update dragger time state
@@ -818,7 +818,7 @@ class Timeline extends React.Component {
draggerTimeState: date,
});
}
- }
+ };
/**
* Make sure user is not currently interacting with the timeline/dragger/scale/etc,
@@ -863,7 +863,7 @@ class Timeline extends React.Component {
hoverTime: dateA,
initialLoadComplete: true,
});
- }
+ };
/**
* @desc change store date
@@ -885,12 +885,12 @@ class Timeline extends React.Component {
});
}
this.debounceDateUpdate(dateObj, draggerSelected);
- }
+ };
handleSelectNowButton = () => {
const { triggerTodayButton } = this.props;
triggerTodayButton();
- }
+ };
/**
* @desc getMobileDateButtonStyle date change button style for smaller displays
@@ -933,7 +933,7 @@ class Timeline extends React.Component {
left: `${mobileLeft}px`,
bottom: `${mobileBottom}px`,
};
- }
+ };
renderDateChangeArrows = () => {
const {
@@ -950,7 +950,7 @@ class Timeline extends React.Component {
handleSelectNowButton={this.handleSelectNowButton}
/>
);
- }
+ };
renderMobile() {
const {
@@ -1098,12 +1098,11 @@ class Timeline extends React.Component {
};
return (
- <>
- <div
- className="timeline-container"
- style={containerDisplayStyle}
- >
- {initialLoadComplete && !isDistractionFreeModeActive
+ <div
+ className="timeline-container"
+ style={containerDisplayStyle}
+ >
+ {initialLoadComplete && !isDistractionFreeModeActive
&& (
<ErrorBoundary>
{isMobile || isEmbedModeActive
@@ -1334,8 +1333,7 @@ class Timeline extends React.Component {
)}
</ErrorBoundary>
)}
- </div>
- </>
+ </div>
);
}
}
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index d9e95a12f..bd2fe917e 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -133,9 +133,7 @@ class toolbarContainer extends Component {
{
...CUSTOM_MODAL_PROPS.TOOLBAR_SNAPSHOT,
onClose: () => {
- refreshStateAfterImageDownload(
- hasCustomPalette ? paletteStore : undefined, rotation, nonDownloadableLayers,
- );
+ refreshStateAfterImageDownload(hasCustomPalette ? paletteStore : undefined, rotation, nonDownloadableLayers);
},
},
);
@@ -174,7 +172,7 @@ class toolbarContainer extends Component {
target={buttonId}
/>
);
- }
+ };
renderShareButton() {
const {
@@ -291,7 +289,7 @@ class toolbarContainer extends Component {
</Button>
</div>
);
- }
+ };
renderSnapshotsButton () {
const {
diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.js
index dd0907527..2685b51ce 100644
--- a/web/js/map/compare/swipe.js
+++ b/web/js/map/compare/swipe.js
@@ -75,7 +75,7 @@ export default class Swipe {
});
layersSideA = [];
layersSideB = [];
- }
+ };
getSwipeOffset = () => swipeOffset;
@@ -128,7 +128,7 @@ export default class Swipe {
topRight: getRenderPixel(event, [widthSideA, 0]),
};
setRectClipMask(ctx, coordinates);
- }
+ };
/**
* Set Clipping mask for the "B" side of a comparison.
@@ -146,7 +146,7 @@ export default class Swipe {
topRight: getRenderPixel(event, [mapSize[0], 0]),
};
setRectClipMask(ctx, coordinates);
- }
+ };
}
/**
diff --git a/web/js/map/map.js b/web/js/map/map.js
index 8f0188bad..74ebebe4d 100644
--- a/web/js/map/map.js
+++ b/web/js/map/map.js
@@ -225,7 +225,7 @@ export function mapAdjustAntiMeridian(polygon, adjustSign) {
*/
export function mapDistance2D(p1, p2) {
// eslint-disable-next-line no-restricted-properties
- return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2));
+ return Math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2);
}
/**
diff --git a/web/js/map/natural-events/event-track.js b/web/js/map/natural-events/event-track.js
index bc78f20fd..ecc50f1e3 100644
--- a/web/js/map/natural-events/event-track.js
+++ b/web/js/map/natural-events/event-track.js
@@ -132,7 +132,7 @@ class EventTrack extends React.Component {
const newTrackDetails = trackDetails.id ? this.removeTrack(map) : {};
this.setState({ trackDetails: newTrackDetails });
}
- }
+ };
addTrack = (map, { track, pointsAndArrows }) => {
const { isAnimatingToEvent } = this.props;
@@ -140,7 +140,7 @@ class EventTrack extends React.Component {
map.addOverlay(track);
addPointOverlays(map, pointsAndArrows);
}
- }
+ };
removeTrack = function(map) {
const { trackDetails } = this.state;
@@ -158,7 +158,7 @@ class EventTrack extends React.Component {
map.removeOverlay(track);
removePointOverlays(map, pointsAndArrows);
});
- }
+ };
updateAllTracks = () => {
const {
@@ -198,7 +198,7 @@ class EventTrack extends React.Component {
});
this.setState({ allTrackDetails: allTracks });
- }
+ };
/**
* Update track
diff --git a/web/js/mapUI/combineUI.js b/web/js/mapUI/combineUI.js
index 11742a965..e66bfae03 100644
--- a/web/js/mapUI/combineUI.js
+++ b/web/js/mapUI/combineUI.js
@@ -18,7 +18,7 @@ import MapUI from './mapUI';
const { events } = util;
-const CombineUI = (props) => {
+function CombineUI(props) {
const {
models,
config,
@@ -114,18 +114,16 @@ const CombineUI = (props) => {
}, [ui]);
return (
- <>
- <MapUI
- models={models}
- compareMapUi={compareMapUi}
- config={config}
- ui={ui}
- setUI={setUI}
- layerQueue={layerQueue}
- />
- </>
+ <MapUI
+ models={models}
+ compareMapUi={compareMapUi}
+ config={config}
+ ui={ui}
+ setUI={setUI}
+ layerQueue={layerQueue}
+ />
);
-};
+}
export default CombineUI;
diff --git a/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js b/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
index 7af97c52c..0601a4edb 100644
--- a/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
+++ b/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
@@ -6,7 +6,7 @@ import { getSelectedDate } from '../../../modules/date/selectors';
import { promiseImageryForTime } from '../../../modules/map/util';
import { setPreload } from '../../../modules/date/actions';
-const BufferQuickAnimate = (props) => {
+function BufferQuickAnimate(props) {
const {
action,
date,
@@ -49,7 +49,7 @@ const BufferQuickAnimate = (props) => {
}
return null;
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/mapUI/components/create-map/createMap.js b/web/js/mapUI/components/create-map/createMap.js
index eeb6ff51f..4185ae306 100644
--- a/web/js/mapUI/components/create-map/createMap.js
+++ b/web/js/mapUI/components/create-map/createMap.js
@@ -37,7 +37,7 @@ import { granuleFootprint } from '../../../map/granule/util';
const { events } = util;
-const CreateMap = (props) => {
+function CreateMap(props) {
const {
config,
isMapSet,
@@ -237,7 +237,7 @@ const CreateMap = (props) => {
};
return null;
-};
+}
const mapDispatchToProps = (dispatch) => ({
updateRotation: (rotation) => {
diff --git a/web/js/mapUI/components/granule-hover/granuleHover.js b/web/js/mapUI/components/granule-hover/granuleHover.js
index 8c8a033d2..9a1734945 100644
--- a/web/js/mapUI/components/granule-hover/granuleHover.js
+++ b/web/js/mapUI/components/granule-hover/granuleHover.js
@@ -6,7 +6,7 @@ import util from '../../../util/util';
const { events } = util;
-const GranuleHover = (props) => {
+function GranuleHover(props) {
const {
granuleFootprints,
state,
@@ -38,7 +38,7 @@ const GranuleHover = (props) => {
events.on(GRANULE_HOVER_UPDATE, onGranuleHoverUpdate);
return null;
-};
+}
const mapStateToProps = (state) => ({
state,
diff --git a/web/js/mapUI/components/layers/addLayer.js b/web/js/mapUI/components/layers/addLayer.js
index 8e6d1a4a4..e4c5dc2f6 100644
--- a/web/js/mapUI/components/layers/addLayer.js
+++ b/web/js/mapUI/components/layers/addLayer.js
@@ -10,7 +10,7 @@ import { getActiveLayers } from '../../../modules/layers/selectors';
import * as layerConstants from '../../../modules/layers/constants';
import { clearPreload } from '../../../modules/date/actions';
-const AddLayer = (props) => {
+function AddLayer(props) {
const {
action,
activeLayersState,
@@ -73,7 +73,7 @@ const AddLayer = (props) => {
preloadNextTiles();
};
return null;
-};
+}
const mapStateToProps = (state) => {
const { compare, date } = state;
diff --git a/web/js/mapUI/components/layers/removeLayer.js b/web/js/mapUI/components/layers/removeLayer.js
index 6f31d3718..49d800c70 100644
--- a/web/js/mapUI/components/layers/removeLayer.js
+++ b/web/js/mapUI/components/layers/removeLayer.js
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
-const RemoveLayer = (props) => {
+function RemoveLayer(props) {
const {
action,
compare,
@@ -30,7 +30,7 @@ const RemoveLayer = (props) => {
};
return null;
-};
+}
const mapStateToProps = (state) => {
const { compare } = state;
diff --git a/web/js/mapUI/components/markers/markers.js b/web/js/mapUI/components/markers/markers.js
index 8108470d1..cb4c447ff 100644
--- a/web/js/mapUI/components/markers/markers.js
+++ b/web/js/mapUI/components/markers/markers.js
@@ -7,7 +7,7 @@ import { animateCoordinates, areCoordinatesWithinExtent, getCoordinatesMarker }
import { setGeocodeResults, removeMarker } from '../../../modules/location-search/actions';
import { getActiveLayers, getMaxZoomLevelLayerCollection } from '../../../modules/layers/selectors';
-const Markers = (props) => {
+function Markers(props) {
const {
action,
activeLayers,
@@ -151,7 +151,7 @@ const Markers = (props) => {
}, [ui]);
return null;
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/mapUI/components/mouse-move-events/mouseMoveEvents.js b/web/js/mapUI/components/mouse-move-events/mouseMoveEvents.js
index d8d865a30..b0dd3db7f 100644
--- a/web/js/mapUI/components/mouse-move-events/mouseMoveEvents.js
+++ b/web/js/mapUI/components/mouse-move-events/mouseMoveEvents.js
@@ -12,7 +12,7 @@ import {
const { events } = util;
-const MouseMoveEvents = (props) => {
+function MouseMoveEvents(props) {
const {
isCoordinateSearchActive,
isEventsTabActive,
@@ -55,7 +55,7 @@ const MouseMoveEvents = (props) => {
});
return null;
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/mapUI/components/update-date/updateDate.js b/web/js/mapUI/components/update-date/updateDate.js
index 122e7f27f..52e520fc7 100644
--- a/web/js/mapUI/components/update-date/updateDate.js
+++ b/web/js/mapUI/components/update-date/updateDate.js
@@ -16,7 +16,7 @@ import { getSelectedDate } from '../../../modules/date/selectors';
import * as dateConstants from '../../../modules/date/constants';
import * as layerConstants from '../../../modules/layers/constants';
-const UpdateDate = (props) => {
+function UpdateDate(props) {
const {
action,
activeLayers,
@@ -135,7 +135,7 @@ const UpdateDate = (props) => {
}
return null;
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/mapUI/components/update-opacity/updateOpacity.js b/web/js/mapUI/components/update-opacity/updateOpacity.js
index 02fa80e12..6cfe44c90 100644
--- a/web/js/mapUI/components/update-opacity/updateOpacity.js
+++ b/web/js/mapUI/components/update-opacity/updateOpacity.js
@@ -8,7 +8,7 @@ import {
import { getActiveLayers } from '../../../modules/layers/selectors';
import * as layerConstants from '../../../modules/layers/constants';
-const UpdateOpacity = (props) => {
+function UpdateOpacity(props) {
const {
action,
activeLayers,
@@ -77,7 +77,7 @@ const UpdateOpacity = (props) => {
updateLayerVisibilities();
};
return null;
-};
+}
const mapStateToProps = (state) => {
const { compare } = state;
diff --git a/web/js/mapUI/components/update-projection/updateProjection.js b/web/js/mapUI/components/update-projection/updateProjection.js
index 57e30e78c..d00e21aef 100644
--- a/web/js/mapUI/components/update-projection/updateProjection.js
+++ b/web/js/mapUI/components/update-projection/updateProjection.js
@@ -27,7 +27,7 @@ import { EXIT_ANIMATION, STOP_ANIMATION } from '../../../modules/animation/const
import { SET_SCREEN_INFO } from '../../../modules/screen-size/constants';
import { requestPalette } from '../../../modules/palettes/actions';
-const UpdateProjection = (props) => {
+function UpdateProjection(props) {
const {
action,
activeLayers,
@@ -351,7 +351,7 @@ const UpdateProjection = (props) => {
};
return null;
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/mapUI/mapUI.js b/web/js/mapUI/mapUI.js
index 097b95aa5..e2b5a828d 100644
--- a/web/js/mapUI/mapUI.js
+++ b/web/js/mapUI/mapUI.js
@@ -47,7 +47,7 @@ import { clearPreload, setPreload } from '../modules/date/actions';
const { events } = util;
-const MapUI = (props) => {
+function MapUI(props) {
const {
activeLayers,
activeLayersState,
@@ -392,7 +392,7 @@ const MapUI = (props) => {
<BufferQuickAnimate action={quickAnimateAction} />
</>
);
-};
+}
const mapStateToProps = (state) => {
const {
diff --git a/web/js/modules/alerts/reducer.test.js b/web/js/modules/alerts/reducer.test.js
index fec093471..84d5a3d05 100644
--- a/web/js/modules/alerts/reducer.test.js
+++ b/web/js/modules/alerts/reducer.test.js
@@ -22,8 +22,10 @@ describe('alertReducer', () => {
});
test('ACTIVATE_VECTOR_ZOOM_ALERT should enable vector zoom alert state', () => {
const vectorZoomEnabledState = { ...defaultAlertState, isVectorZoomAlertPresent: true };
- expect(alertReducer(undefined,
- { type: ACTIVATE_VECTOR_ZOOM_ALERT })).toEqual(vectorZoomEnabledState);
+ expect(alertReducer(
+ undefined,
+ { type: ACTIVATE_VECTOR_ZOOM_ALERT },
+ )).toEqual(vectorZoomEnabledState);
});
test('DISABLE_VECTOR_EXCEEDED_ALERT should disable vector exceeded results alert state', () => {
expect(alertReducer(
@@ -35,7 +37,9 @@ describe('alertReducer', () => {
});
test('ACTIVATE_VECTOR_EXCEEDED_ALERT should enable vector exceeded results alert state', () => {
const vectorExceededEnabledState = { ...defaultAlertState, isVectorExceededAlertPresent: true };
- expect(alertReducer(undefined,
- { type: ACTIVATE_VECTOR_EXCEEDED_ALERT })).toEqual(vectorExceededEnabledState);
+ expect(alertReducer(
+ undefined,
+ { type: ACTIVATE_VECTOR_EXCEEDED_ALERT },
+ )).toEqual(vectorExceededEnabledState);
});
});
diff --git a/web/js/modules/animation/gifstream.js b/web/js/modules/animation/gifstream.js
index 9b01b478c..9f9931174 100644
--- a/web/js/modules/animation/gifstream.js
+++ b/web/js/modules/animation/gifstream.js
@@ -161,11 +161,13 @@ export default class GifStream {
Math.round((processedImages / imageLength) * 100),
);
processedImages++;
- setTimeout(() => {
+ setTimeout(
+ () => {
// This was needed in order for callback to be applied
- pull();
- },
- 10);
+ pull();
+ },
+ 10,
+ );
}
});
};
diff --git a/web/js/modules/date/actions.test.js b/web/js/modules/date/actions.test.js
index d1a4104d4..0e89fbba5 100644
--- a/web/js/modules/date/actions.test.js
+++ b/web/js/modules/date/actions.test.js
@@ -57,25 +57,30 @@ const delta = 5;
const interval = 3;
describe('Date timescale changes', () => {
- test(`changeTimeScale action returns ${CHANGE_TIME_SCALE} as type and ${interval} as value`,
+ test(
+ `changeTimeScale action returns ${CHANGE_TIME_SCALE} as type and ${interval} as value`,
() => {
const expectedAction = {
type: CHANGE_TIME_SCALE,
value: interval,
};
expect(changeTimeScale(interval)).toEqual(expectedAction);
- });
+ },
+ );
- test(`updateAppNow action returns ${UPDATE_APP_NOW} as type and ${mockDate} as value`,
+ test(
+ `updateAppNow action returns ${UPDATE_APP_NOW} as type and ${mockDate} as value`,
() => {
const expectedAction = {
type: UPDATE_APP_NOW,
value: mockDate,
};
expect(updateAppNow(mockDate)).toEqual(expectedAction);
- });
+ },
+ );
- test(`selectDate action returns ${SELECT_DATE} as type, 'selected' as activeString, and ${mockDate} as value`,
+ test(
+ `selectDate action returns ${SELECT_DATE} as type, 'selected' as activeString, and ${mockDate} as value`,
() => {
const expectedFirst = {
type: CLEAR_PRELOAD,
@@ -113,9 +118,11 @@ describe('Date timescale changes', () => {
store.dispatch(selectDate(mockDate));
expect(store.getActions()[0]).toEqual(expectedFirst);
expect(store.getActions()[1]).toEqual(expectedSecond);
- });
+ },
+ );
- test(`selectDate action returns ${SELECT_DATE} as type and selectedB as activeString and ${mockDate} as value`,
+ test(
+ `selectDate action returns ${SELECT_DATE} as type and selectedB as activeString and ${mockDate} as value`,
() => {
const prevDate = new Date('2021-01-01');
const expectedFirst = {
@@ -154,9 +161,11 @@ describe('Date timescale changes', () => {
store.dispatch(selectDate(mockDate));
expect(store.getActions()[0]).toEqual(expectedFirst);
expect(store.getActions()[1]).toEqual(expectedSecond);
- });
+ },
+ );
- test(`changeCustomInterval action returns ${CHANGE_CUSTOM_INTERVAL} as type and ${customInterval} as value and ${delta} as delta`,
+ test(
+ `changeCustomInterval action returns ${CHANGE_CUSTOM_INTERVAL} as type and ${customInterval} as value and ${delta} as delta`,
() => {
const store = mockStore({
date: {},
@@ -179,9 +188,11 @@ describe('Date timescale changes', () => {
store.dispatch(changeCustomInterval(delta, customInterval));
expect(store.getActions()[0]).toEqual(expectedFirst);
expect(store.getActions()[1]).toEqual(expectedSecond);
- });
+ },
+ );
- test(`selectInterval action returns ${CHANGE_INTERVAL} as type and ${interval} as value and ${delta} as delta and true as customSelected`,
+ test(
+ `selectInterval action returns ${CHANGE_INTERVAL} as type and ${interval} as value and ${delta} as delta and true as customSelected`,
() => {
const store = mockStore({
date: {},
@@ -205,5 +216,6 @@ describe('Date timescale changes', () => {
store.dispatch(selectInterval(delta, interval, true));
expect(store.getActions()[0]).toEqual(expectedFirst);
expect(store.getActions()[1]).toEqual(expectedSecond);
- });
+ },
+ );
});
diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.js
index beb0fc288..3ce36470d 100644
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@ -29,11 +29,6 @@ export function getVectorStyleAttributeArray(layer) {
id: obj.key === 'custom' ? 'style' : obj.key,
value: obj.value,
});
- } else if (obj.isActive) {
- attrArray.push({
- id: obj.key === 'custom' ? 'style' : obj.key,
- value: '',
- });
}
});
return attrArray;
diff --git a/web/js/ol/lookupimagetile.js b/web/js/ol/lookupimagetile.js
index 6b3d7d327..af42fe56c 100644
--- a/web/js/ol/lookupimagetile.js
+++ b/web/js/ol/lookupimagetile.js
@@ -23,8 +23,12 @@ LookupImageTile.prototype.load = function() {
const octets = that.canvas_.width * that.canvas_.height * 4;
const g = that.canvas_.getContext('2d');
g.drawImage(that.image_, 0, 0);
- const imageData = g.getImageData(0, 0, that.canvas_.width,
- that.canvas_.height);
+ const imageData = g.getImageData(
+ 0,
+ 0,
+ that.canvas_.width,
+ that.canvas_.height,
+ );
const pixels = imageData.data;
for (let i = 0; i < octets; i += 4) {
@@ -53,7 +57,14 @@ LookupImageTile.prototype.load = function() {
export default function lookupFactory(lookup, sourceOptions) {
return function(tileCoord, state, src, crossOrigin, tileLoadFunction) {
- return new LookupImageTile(lookup, tileCoord, state, src,
- crossOrigin, tileLoadFunction, sourceOptions);
+ return new LookupImageTile(
+ lookup,
+ tileCoord,
+ state,
+ src,
+ crossOrigin,
+ tileLoadFunction,
+ sourceOptions,
+ );
};
}
diff --git a/web/js/util/util.js b/web/js/util/util.js
index 3826b8592..29c70067d 100644
--- a/web/js/util/util.js
+++ b/web/js/util/util.js
@@ -159,8 +159,15 @@ export default (function(self) {
second = hhmmss[2] || 0;
millisecond = hhmmss[3] || 0;
}
- const date = new Date(Date.UTC(year, month, day, hour, minute, second,
- millisecond));
+ const date = new Date(Date.UTC(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond,
+ ));
// eslint-disable-next-line no-restricted-globals
if (isNaN(date.getTime())) {
throw new Error(`Invalid date: ${dateAsString}`);
@@ -465,7 +472,7 @@ export default (function(self) {
const b2 = parseInt(hex2.substring(4, 6), 16);
// calculate differences in 3D Space
// eslint-disable-next-line no-restricted-properties
- return Math.sqrt(Math.pow(r1 - r2, 2) + Math.pow(g1 - g2, 2) + Math.pow(b1 - b2, 2));
+ return Math.sqrt((r1 - r2) ** 2 + (g1 - g2) ** 2 + (b1 - b2) ** 2);
};
self.fetch = function(url, mimeType) {
diff --git a/web/scss/components/dateselector.scss b/web/scss/components/dateselector.scss
index 9d775067e..23144da21 100644
--- a/web/scss/components/dateselector.scss
+++ b/web/scss/components/dateselector.scss
@@ -163,7 +163,6 @@
.wv-date-selector-widget #left-arrow-group {
transform: scaleX(-1);
- transform: scaleX(-1);
}
.wv-date-selector-widget #left-arrow-group svg {
diff --git a/web/scss/features/timeline.scss b/web/scss/features/timeline.scss
index d4c327bd5..8db244c76 100644
--- a/web/scss/features/timeline.scss
+++ b/web/scss/features/timeline.scss
@@ -114,8 +114,6 @@ button:focus {
position: absolute;
top: -15px;
height: 30px;
-
- // width: 100%;
max-width: inherit;
}
@@ -167,7 +165,6 @@ button:focus {
}
& .date-arrow-down {
- transform: scaleY(-1);
transform: scaleY(-1);
filter: flipv;
filter: "FlipV";
@@ -196,7 +193,6 @@ button:focus {
& #left-arrow-group {
transform: scaleX(-1);
- transform: scaleX(-1);
}
& #left-arrow-group svg {