Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix tests and custom palette loading

Jason Kent2932b095fb67
diff --git a/e2e/features/ui/distraction-free-mode-test.js b/e2e/features/ui/distraction-free-mode-test.js
index 6ab9dd1f3..2c481c017 100644
--- a/e2e/features/ui/distraction-free-mode-test.js
+++ b/e2e/features/ui/distraction-free-mode-test.js
@@ -20,14 +20,17 @@ const TIME_LIMIT = 5000;
module.exports = {
before: (c) => {
reuseables.loadAndSkipTour(c, TIME_LIMIT);
+ c.url(`${c.globals.url}?p=arctic`);
// ensure geosearch is minimized
c.click(geosearchMinimizeButton);
},
// verify distraction free mode shortcut hides ui elements
'Enabling distraction free mode with shortcut key hides UI elements': (c) => {
- c.pause(300);
- c.sendKeys('body', [c.Keys.SHIFT, 'd', c.Keys.NULL]);
+ c.waitForElementVisible('#wv-info-button');
+ c.click('#wv-info-button');
+ c.waitForElementVisible('#distraction_free_info_item');
+ c.click('#distraction_free_info_item');
c.pause(300);
c.waitForElementNotVisible(timelineContainer, TIME_LIMIT);
@@ -37,17 +40,19 @@ module.exports = {
c.waitForElementNotPresent(projToolbarButton, TIME_LIMIT);
c.waitForElementNotPresent(snapshotToolbarButton, TIME_LIMIT);
c.waitForElementNotVisible(measureBtn, TIME_LIMIT);
- c.waitForElementNotVisible(zoomInButton, TIME_LIMIT);
- c.waitForElementNotVisible(zoomOutButton, TIME_LIMIT);
+ c.waitForElementNotPresent(zoomInButton, TIME_LIMIT);
+ c.waitForElementNotPresent(zoomOutButton, TIME_LIMIT);
c.waitForElementNotVisible(mapScaleMetric, TIME_LIMIT);
c.waitForElementNotVisible(mapScaleImperial, TIME_LIMIT);
+ c.waitForElementNotPresent('.wv-map-rotate-left', TIME_LIMIT);
+ c.waitForElementNotPresent('.wv-map-reset-rotation', TIME_LIMIT);
+ c.waitForElementNotPresent('.wv-map-rotate-right', TIME_LIMIT);
},
// verify turning off distraction free mode shortcut returns hidden ui elements
'Disabling distraction free mode with shortcut key returns UI elements': (c) => {
- c.pause(300);
c.sendKeys('body', [c.Keys.SHIFT, 'd', c.Keys.NULL]);
- c.pause(300);
+ c.pause(500);
c.waitForElementVisible(timelineContainer, TIME_LIMIT);
c.waitForElementVisible(sidebarContainer, TIME_LIMIT);
@@ -60,6 +65,9 @@ module.exports = {
c.waitForElementPresent(zoomOutButton, TIME_LIMIT);
c.waitForElementPresent(mapScaleMetric, TIME_LIMIT);
c.waitForElementPresent(mapScaleImperial, TIME_LIMIT);
+ c.waitForElementPresent('.wv-map-rotate-left', TIME_LIMIT);
+ c.waitForElementPresent('.wv-map-reset-rotation', TIME_LIMIT);
+ c.waitForElementPresent('.wv-map-rotate-right', TIME_LIMIT);
},
after: (c) => {
diff --git a/e2e/reuseables/zoom.js b/e2e/reuseables/zoom.js
index b7c7b1322..8983ad988 100644
--- a/e2e/reuseables/zoom.js
+++ b/e2e/reuseables/zoom.js
@@ -1,6 +1,6 @@
module.exports = {
zoomIn(c, proj) {
- c.click(`#wv-map [data-proj='${proj}'] div.wv-map-zoom-in`);
+ c.click('button.wv-map-zoom-in');
c.pause(300);
},
};
diff --git a/web/js/components/map/rotation.js b/web/js/components/map/rotation.js
index f7639399c..9ebd33b74 100644
--- a/web/js/components/map/rotation.js
+++ b/web/js/components/map/rotation.js
@@ -51,10 +51,11 @@ class Rotation extends React.Component {
}
render() {
- const { rotation, proj } = this.props;
+ const { rotation, proj, isDistractionFreeModeActive } = this.props;
const currentRotation = Number(rotation * (180 / Math.PI)).toFixed();
+ const isPolarProj = proj.id !== 'geographic' && proj.id !== 'webmerc';
- return proj.id !== 'geographic' && proj.id !== 'webmerc' && (
+ return !isDistractionFreeModeActive && isPolarProj && (
<>
<button
type="button"
@@ -97,11 +98,12 @@ class Rotation extends React.Component {
}
const mapStateToProps = (state) => {
- const { map, proj } = state;
+ const { map, proj, ui } = state;
return {
map,
proj,
rotation: map.rotation,
+ isDistractionFreeModeActive: ui.isDistractionFreeModeActive,
};
};
@@ -117,6 +119,7 @@ const mapDispatchToProps = (dispatch) => ({
Rotation.propTypes = {
map: PropTypes.object,
rotation: PropTypes.number,
+ isDistractionFreeModeActive: PropTypes.bool,
proj: PropTypes.object,
updateRotationState: PropTypes.func,
};
diff --git a/web/js/components/map/zoom.js b/web/js/components/map/zoom.js
index 9ee6b456e..b3b9926da 100644
--- a/web/js/components/map/zoom.js
+++ b/web/js/components/map/zoom.js
@@ -4,12 +4,12 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { mapUtilZoomAction } from '../../map/util';
-function Zoom({ map, proj }) {
+function Zoom({ map, proj, isDistractionFreeModeActive }) {
if (!map) return null;
const zoomLevel = map.getView().getZoom();
const { numZoomLevels } = proj;
- return (
+ return !isDistractionFreeModeActive && (
<>
<button
type="button"
@@ -36,15 +36,17 @@ function Zoom({ map, proj }) {
}
const mapStateToProps = (state) => {
- const { map, proj } = state;
+ const { map, proj, ui } = state;
return {
map: map.ui.selected,
proj,
+ isDistractionFreeModeActive: ui.isDistractionFreeModeActive,
};
};
Zoom.propTypes = {
map: PropTypes.object,
+ isDistractionFreeModeActive: PropTypes.bool,
proj: PropTypes.object,
};
diff --git a/web/js/util/load.js b/web/js/util/load.js
index b8bc9f947..30291c644 100644
--- a/web/js/util/load.js
+++ b/web/js/util/load.js
@@ -23,6 +23,7 @@ export default (function() {
.then((response) => response.json())
.then((result) => {
root[attr] = result;
+ return result;
})
.finally(() => {
delete configPromises[url];