Interactive interface for browsing global, full-resolution satellite imagery
fix ci error #1801
Benjamin King55576f3fa133
diff --git a/web/js/modules/animation/constants.js b/web/js/modules/animation/constants.jsindex 0457f1fc6..2711a476a 100644--- a/web/js/modules/animation/constants.js+++ b/web/js/modules/animation/constants.js@@ -8,3 +8,4 @@ export const UPDATE_START_AND_END_DATE = 'ANIMATION/UPDATE_START_AND_END_DATE';export const UPDATE_START_DATE = 'ANIMATION/UPDATE_START_DATE';export const UPDATE_END_DATE = 'ANIMATION/UPDATE_END_DATE';export const TOGGLE_GIF = 'ANIMATION/TOGGLE_GIF';+export const KEY_PRESS_ACTION = 'ANIMATION/KEY_PRESS_ACTION';diff --git a/web/js/modules/animation/reducer.test.js b/web/js/modules/animation/reducer.test.jsindex 0954cfb6b..a27c52611 100644--- a/web/js/modules/animation/reducer.test.js+++ b/web/js/modules/animation/reducer.test.js@@ -86,7 +86,7 @@ test('TOGGLE_GIF action toggles gifActive bool value', () => {test('KEY_PRESS_ACTION action toggles isPlaying bool when animation is active', () => {let updatedState = update(defaultState, { isActive: { $set: true } });const response = animationReducer(updatedState, {- type: 'KEY_PRESS_ACTION',+ type: CONSTANTS.KEY_PRESS_ACTION,keyCode: 32});expect(updatedState.isPlaying).toBeFalsy();@@ -94,7 +94,7 @@ test('KEY_PRESS_ACTION action toggles isPlaying bool when animation is active',});test('KEY_PRESS_ACTION action does not toggle isPlaying bool when animation is inActive', () => {const response = animationReducer(defaultState, {- type: 'KEY_PRESS_ACTION',+ type: CONSTANTS.KEY_PRESS_ACTION,keyCode: 32});expect(defaultState.isPlaying).toBeFalsy();diff --git a/web/js/modules/animation/reducers.js b/web/js/modules/animation/reducers.jsindex 10ca3e2d5..7e3f0a9a8 100644--- a/web/js/modules/animation/reducers.js+++ b/web/js/modules/animation/reducers.js@@ -10,7 +10,8 @@ import {UPDATE_START_AND_END_DATE,UPDATE_START_DATE,UPDATE_END_DATE,- TOGGLE_GIF+ TOGGLE_GIF,+ KEY_PRESS_ACTION} from './constants';export const defaultState = {@@ -84,7 +85,7 @@ export function animationReducer(state = defaultState, action) {gifActive: !state.gifActive,isPlaying: false});- case 'ANIMATION_KEY_PRESS_ACTION':+ case KEY_PRESS_ACTION:if (action.keyCode === 32 && state.isActive) {return lodashAssign({}, state, {isPlaying: !state.isPlayingdiff --git a/web/js/modules/key-press/actions.js b/web/js/modules/key-press/actions.jsindex 69eb9e26c..f19769017 100644--- a/web/js/modules/key-press/actions.js+++ b/web/js/modules/key-press/actions.js@@ -1,3 +1,5 @@+import { KEY_PRESS_ACTION as ANIMATION_KEY_PRESS_ACTION } from '../animation/constants';+/*** Function to dispatch actions* based on keyCode and active@@ -11,7 +13,7 @@ export function keyPress(keyCode) {if (animation.isActive && !modal.isOpen) {// can get more specific modal.key !== "LAYER_PICKER_COMPONENT"dispatch({- type: 'ANIMATION_KEY_PRESS_ACTION',+ type: ANIMATION_KEY_PRESS_ACTION,keyCode});}