Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

more aria labels and tooltips

Jason Kent68bc83671db6
diff --git a/web/js/components/animation-widget/loop-button.js b/web/js/components/animation-widget/loop-button.js
index 9c8f92d4c..8f4cbb0a2 100644
--- a/web/js/components/animation-widget/loop-button.js
+++ b/web/js/components/animation-widget/loop-button.js
@@ -23,7 +23,7 @@ const LoopButton = ({ looping, onLoop }) => {
onClick={onLoop}
>
<UncontrolledTooltip
- placement="right"
+ placement="top"
target={buttonId}
>
{labelText}
diff --git a/web/js/components/map/coordinates.js b/web/js/components/map/coordinates.js
index c645c5465..87d2eaae0 100644
--- a/web/js/components/map/coordinates.js
+++ b/web/js/components/map/coordinates.js
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
+import { UncontrolledTooltip } from 'reactstrap';
import util from '../../util/util';
// previous : next
@@ -39,15 +40,17 @@ export default class Coordinates extends React.Component {
return (
<div
+ id="coords-panel"
className="wv-coords-map wv-coords-map-btn"
onClick={this.changeFormat}
>
+ <UncontrolledTooltip placement="bottom" target="coords-panel">
+ Change coordinates format
+ </UncontrolledTooltip>
<span className="map-coord">
- {coords}
- {' '}
- {crs}
+ {`${coords} ${crs}`}
</span>
- <div className="coord-btn">
+ <div aria-label="Change coordinates format" className="coord-btn">
<i className="coord-switch" />
</div>
</div>
diff --git a/web/js/components/measure-tool/measure-button.js b/web/js/components/measure-tool/measure-button.js
index 1453ba49d..6d834eb85 100644
--- a/web/js/components/measure-tool/measure-button.js
+++ b/web/js/components/measure-tool/measure-button.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
-import { Button } from 'reactstrap';
+import { Button, UncontrolledTooltip } from 'reactstrap';
import googleTagManager from 'googleTagManager';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import MeasureMenu from './measure-menu';
@@ -58,6 +58,8 @@ class MeasureButton extends React.Component {
const { showAlert, isTouchDevice } = this.state;
const shouldShowAlert = isActive && showAlert;
const message = isTouchDevice ? mobileHelpMsg : helpMsg;
+ const buttonId = 'wv-measure-button';
+ const labelText = 'Measure distances & areas';
return (
<>
@@ -74,13 +76,19 @@ class MeasureButton extends React.Component {
<Button
style={{ display: isDistractionFreeModeActive ? 'none' : 'block' }}
- id="wv-measure-button"
+ id={buttonId}
className="wv-measure-button wv-toolbar-button"
- title="Measure distances &amp; areas"
+ aria-label={labelText}
onTouchEnd={this.onButtonClick}
onMouseDown={this.onButtonClick}
disabled={isActive}
>
+ <UncontrolledTooltip
+ placement="top"
+ target={buttonId}
+ >
+ {labelText}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon="ruler" size="2x" />
</Button>
</>
diff --git a/web/js/components/sidebar/collapsed-button.js b/web/js/components/sidebar/collapsed-button.js
index 024f9ed60..1d8b00bcf 100644
--- a/web/js/components/sidebar/collapsed-button.js
+++ b/web/js/components/sidebar/collapsed-button.js
@@ -1,6 +1,7 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { UncontrolledTooltip } from 'reactstrap';
class CollapsedButton extends PureComponent {
render() {
@@ -11,6 +12,8 @@ class CollapsedButton extends PureComponent {
numberOfLayers,
onclick,
} = this.props;
+ const buttonId = 'accordion-toggler-bButton';
+ const labelText = 'Expand sidebar';
return (
<div
@@ -19,11 +22,14 @@ class CollapsedButton extends PureComponent {
style={!isCollapsed || isDistractionFreeModeActive ? { display: 'none' } : {}}
>
<a
- id="accordionTogglerButton"
+ id={buttonId}
+ aria-label={labelText}
className="accordionToggler dateHolder staticLayers"
- title="Show Layer Selector"
onClick={onclick}
>
+ <UncontrolledTooltip placement="right" target={buttonId}>
+ {labelText}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon="layer-group" />
{isMobile
? (
diff --git a/web/js/components/sidebar/nav/nav-case.js b/web/js/components/sidebar/nav/nav-case.js
index 639786304..bdbd72251 100644
--- a/web/js/components/sidebar/nav/nav-case.js
+++ b/web/js/components/sidebar/nav/nav-case.js
@@ -1,8 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { Nav } from 'reactstrap';
+import { Nav, UncontrolledTooltip } from 'reactstrap';
import CustomNavItem from './nav-item';
+
const tabClasses = 'sidebar-tab';
function NavCase (props) {
@@ -27,17 +28,17 @@ function NavCase (props) {
iconClassName="icon-download"
disabled={!!isCompareMode}
label={
- isCompareMode
- ? 'You must exit comparison mode to download data'
- : 'Data download'
- }
+ isCompareMode
+ ? 'You must exit comparison mode to download data'
+ : 'Data download'
+ }
className={
- activeTab === 'download'
- ? `${tabClasses} third-tab active`
- : isCompareMode
- ? `${tabClasses} third-tab disabled`
- : `${tabClasses} third-tab`
- }
+ activeTab === 'download'
+ ? `${tabClasses} third-tab active`
+ : isCompareMode
+ ? `${tabClasses} third-tab disabled`
+ : `${tabClasses} third-tab`
+ }
/>
);
@@ -52,17 +53,17 @@ function NavCase (props) {
iconClassName="icon-events"
disabled={!!isCompareMode}
label={
- isCompareMode
- ? 'You must exit comparison mode to use the natural events feature'
- : 'Natural Events'
- }
+ isCompareMode
+ ? 'You must exit comparison mode to use the natural events feature'
+ : 'Natural Events'
+ }
className={
- activeTab === 'events'
- ? `${tabClasses} second-tab active`
- : isCompareMode
- ? `${tabClasses} second-tab disabled`
- : `${tabClasses} second-tab`
- }
+ activeTab === 'events'
+ ? `${tabClasses} second-tab active`
+ : isCompareMode
+ ? `${tabClasses} second-tab disabled`
+ : `${tabClasses} second-tab`
+ }
/>
);
@@ -86,11 +87,14 @@ function NavCase (props) {
{renderEvents()}
{renderDataDownload()}
<div className="toggleIconHolder">
+ <UncontrolledTooltip placement="right" target="accordion-toggler-Button">
+ Hide Sidebar
+ </UncontrolledTooltip>
<a
- id="accordionTogglerButton"
+ id="accordion-toggler-Button"
className="accordionToggler atcollapse arrow"
onClick={toggleSidebar}
- title="Hide"
+ aria-label="Hide Sidebar"
/>
</div>
</Nav>
diff --git a/web/js/components/timeline/timeline-controls/animation-button.js b/web/js/components/timeline/timeline-controls/animation-button.js
index 7edaf2dbd..96098b602 100644
--- a/web/js/components/timeline/timeline-controls/animation-button.js
+++ b/web/js/components/timeline/timeline-controls/animation-button.js
@@ -16,7 +16,7 @@ class AnimationButton extends PureComponent {
>
<div id={buttonId} onClick={clickAnimationButton}>
<UncontrolledTooltip
- placement="right"
+ placement="top"
target={buttonId}
>
{labelText}
diff --git a/web/js/components/timeline/timeline-data/timeline-data.js b/web/js/components/timeline/timeline-data/timeline-data.js
index 26f788730..b53550e58 100644
--- a/web/js/components/timeline/timeline-data/timeline-data.js
+++ b/web/js/components/timeline/timeline-data/timeline-data.js
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
+import { UncontrolledTooltip } from 'reactstrap';
import moment from 'moment';
import {
isEqual as lodashIsEqual,
@@ -298,17 +299,23 @@ class TimelineData extends Component {
const animateBottomClassName = `animate-timeline-data-panel-slide-${isDataCoveragePanelOpen ? 'up' : 'down'}`;
const panelChevronClassName = `wv-timeline-data-availability-handle-chevron-${isDataCoveragePanelOpen ? 'open' : 'closed'}`;
+ const panelToggleLabelText = isDataCoveragePanelOpen ? 'Collapse data coverage panel' : 'Show data coverage panel';
+
return (
<>
{/* Data Coverage Panel open/close handle */}
<div
id="timeline-data-availability-panel-handle"
+ aria-label={panelToggleLabelText}
onClick={this.togglePanelOpenClose}
style={{
right: Math.floor((axisWidth + 75) / 2),
top: isDataCoveragePanelOpen ? dataAvailabilityHandleTopOffset : '-19px',
}}
>
+ <UncontrolledTooltip placement="top" target="timeline-data-availability-panel-handle">
+ {panelToggleLabelText}
+ </UncontrolledTooltip>
<div className={`wv-timeline-data-availability-handle-chevron ${panelChevronClassName}`} />
</div>
<div
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index aa4d2f354..35b083c62 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -414,7 +414,6 @@ class AnimationWidget extends React.Component {
return (
<a
id="create-gif-button"
- title={!gifDisabled ? 'Create Animated GIF' : ''}
aria-label={labelText}
className={gifDisabled ? 'wv-icon-case disabled' : 'wv-icon-case'}
onClick={openGif}
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index 38b1eb249..d3bd70d82 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -55,6 +55,7 @@ class FooterContent extends React.Component {
compareFeature,
showAll,
} = this.props;
+ const compareBtnText = !isCompareActive ? 'Start Comparison' : 'Exit Comparison';
if (isCompareActive && isMobile) {
toggleCompare();
}
@@ -68,9 +69,10 @@ class FooterContent extends React.Component {
/>
<div className="product-buttons">
<Button
- text="+ Add Layers"
id="layers-add"
+ aria-label="Add layers"
className="layers-add red"
+ text="+ Add Layers"
onClick={(e) => {
e.stopPropagation();
addLayers();
@@ -80,6 +82,10 @@ class FooterContent extends React.Component {
}}
/>
<Button
+ id="compare-toggle-button"
+ aria-label={compareBtnText}
+ className="compare-toggle-button"
+ style={isMobile || !compareFeature ? { display: 'none' } : null}
onClick={(e) => {
e.stopPropagation();
toggleCompare();
@@ -87,10 +93,7 @@ class FooterContent extends React.Component {
event: 'comparison_mode',
});
}}
- className="compare-toggle-button"
- id="compare-toggle-button"
- style={isMobile || !compareFeature ? { display: 'none' } : null}
- text={!isCompareActive ? 'Start Comparison' : 'Exit Comparison'}
+ text={compareBtnText}
/>
</div>
</>
diff --git a/web/js/containers/sidebar/layer.js b/web/js/containers/sidebar/layer.js
index a739b119c..11ae7dad9 100644
--- a/web/js/containers/sidebar/layer.js
+++ b/web/js/containers/sidebar/layer.js
@@ -7,6 +7,7 @@ import { isEmpty as lodashIsEmpty, get as lodashGet } from 'lodash';
import googleTagManager from 'googleTagManager';
import { connect } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { UncontrolledTooltip } from 'reactstrap';
import PaletteLegend from '../../components/sidebar/paletteLegend';
import util from '../../util/util';
import {
@@ -124,30 +125,50 @@ class Layer extends React.Component {
onOptionsClick,
} = this.props;
const { title } = names;
+ const removeLayerBtnId = `close${layerGroupName}${util.encodeId(layer.id)}`;
+ const removeLayerBtnTitle = 'Remove Layer';
+
+ const layerOptionsBtnId = `layer-options-btn-${util.encodeId(layer.id)}`;
+ const layerOptionsBtnTitle = 'View layer options';
+
+ const layerInfoBtnId = `layer-info-btn-${util.encodeId(layer.id)}`;
+ const layerInfoBtnTitle = 'View layer description';
+
return (
<>
<a
- id={`close${layerGroupName}${util.encodeId(layer.id)}`}
- title="Remove Layer"
+ id={removeLayerBtnId}
+ arira-label={removeLayerBtnTitle}
className="button wv-layers-close"
onClick={() => onRemoveClick(layer.id)}
>
+ <UncontrolledTooltip placement="top" target={removeLayerBtnId}>
+ {removeLayerBtnTitle}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon="times" fixedWidth />
</a>
<a
- title={`Layer options for ${title}`}
+ id={layerOptionsBtnId}
+ aria-label={layerOptionsBtnTitle}
className={isMobile ? 'hidden wv-layers-options' : 'wv-layers-options'}
onMouseDown={this.stopPropagation}
onClick={() => onOptionsClick(layer, title)}
>
+ <UncontrolledTooltip placement="top" target={layerOptionsBtnId}>
+ {layerOptionsBtnTitle}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon="sliders-h" className="wv-layers-options-icon" />
</a>
<a
- title={`Layer description for ${title}`}
+ id={layerInfoBtnId}
+ aria-label={layerInfoBtnTitle}
className={isMobile ? 'hidden wv-layers-info' : 'wv-layers-info'}
onMouseDown={this.stopPropagation}
onClick={() => onInfoClick(layer, title)}
>
+ <UncontrolledTooltip placement="top" target={layerInfoBtnId}>
+ {layerInfoBtnTitle}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon="info" className="wv-layers-info-icon" />
</a>
</>
@@ -238,11 +259,18 @@ class Layer extends React.Component {
onMouseLeave={() => hover(layer.id, false)}
>
<a
- className={visibilityToggleClass}
id={`hide${util.encodeId(layer.id)}`}
+ className={visibilityToggleClass}
+ aria-label={visibilityTitle}
onClick={() => toggleVisibility(layer.id, !isVisible)}
title={visibilityTitle}
>
+ <UncontrolledTooltip
+ placement="right"
+ target={`hide${util.encodeId(layer.id)}`}
+ >
+ {visibilityTitle}
+ </UncontrolledTooltip>
<FontAwesomeIcon icon={visibilityIconClass} className="layer-eye-icon" />
</a>
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 82175e59d..e3a88d684 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import moment from 'moment';
import googleTagManager from 'googleTagManager';
+import { UncontrolledTooltip } from 'reactstrap';
import {
debounce as lodashDebounce,
@@ -1343,7 +1344,14 @@ class Timeline extends React.Component {
/>
{/* Open/Close Chevron */}
- <div id="timeline-hide" onClick={this.toggleHideTimeline}>
+ <div
+ id="timeline-hide"
+ aria-label={isTimelineHidden ? 'Show timeline' : 'Hide timeline'}
+ onClick={this.toggleHideTimeline}
+ >
+ <UncontrolledTooltip target="timeline-hide" placement="top">
+ {isTimelineHidden ? 'Show timeline' : 'Hide timeline'}
+ </UncontrolledTooltip>
<div
className={`wv-timeline-hide wv-timeline-hide-double-chevron-${chevronDirection}`}
/>