chore: enable no-static-element-interactions eslint rule (#10351)

This commit is contained in:
Erik Ritter 2020-07-17 09:19:16 -07:00 committed by GitHub
parent aaad4522f0
commit 5984df3522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 43 additions and 6 deletions

View File

@ -76,7 +76,6 @@ module.exports = {
indent: 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/href-no-hash': 0,
'jsx-a11y/no-static-element-interactions': 0,
'new-cap': 0,
'no-bitwise': 0,
'no-confusing-arrow': 0,
@ -136,7 +135,6 @@ module.exports = {
indent: 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/href-no-hash': 0,
'jsx-a11y/no-static-element-interactions': 0,
'new-cap': 0,
'no-bitwise': 0,
'no-confusing-arrow': 0,

View File

@ -183,6 +183,8 @@ export default class CRUDCollection extends React.PureComponent {
tds.push(
<td key="__expand" className="expand">
<i
role="button"
tabIndex={0}
className={`fa fa-caret-${
isExpanded ? 'down' : 'right'
} text-primary pointer`}
@ -200,6 +202,8 @@ export default class CRUDCollection extends React.PureComponent {
tds.push(
<td key="__actions">
<i
role="button"
tabIndex={0}
className="fa fa-close text-primary pointer"
onClick={this.deleteItem.bind(this, record.id)}
/>

View File

@ -212,6 +212,8 @@ class TableElement extends React.PureComponent {
<Fade in={this.state.hovered}>{this.renderControls()}</Fade>
)}
<i
role="button"
tabIndex={0}
onClick={e => {
this.toggleTable(e);
}}

View File

@ -29,6 +29,8 @@ export default function Checkbox({ checked, onChange, style }) {
return (
<span style={style}>
<i
role="button"
tabIndex={0}
className={`fa fa-check ${
checked ? 'text-primary' : 'text-transparent'
}`}

View File

@ -95,7 +95,9 @@ export default class CopyToClipboard extends React.Component {
throw new Error(t('Not successful'));
}
} catch (err) {
window.alert(t('Sorry, your browser does not support copying. Use Ctrl / Cmd + C!')); // eslint-disable-line
window.alert(
t('Sorry, your browser does not support copying. Use Ctrl / Cmd + C!'),
); // eslint-disable-line
}
document.body.removeChild(span);
@ -164,7 +166,12 @@ export default class CopyToClipboard extends React.Component {
trigger={['hover']}
>
<MenuItem>
<span onClick={this.onClick} onMouseOut={this.onMouseOut}>
<span
role="button"
tabIndex={0}
onClick={this.onClick}
onMouseOut={this.onMouseOut}
>
{this.props.copyNode}
</span>
</MenuItem>

View File

@ -37,7 +37,7 @@ export default function PopoverSection({
}) {
return (
<div className={`PopoverSection ${!isSelected ? 'dimmed' : ''}`}>
<div onClick={onSelect} className="pointer">
<div role="button" tabIndex={0} onClick={onSelect} className="pointer">
<strong>{title}</strong> &nbsp;
{info && (
<InfoTooltipWithTrigger tooltip={info} label="date-free-tooltip" />

View File

@ -32,6 +32,8 @@ class RefreshLabel extends React.PureComponent {
return (
<TooltipWrapper tooltip={this.props.tooltipContent} label="cache-desc">
<i
role="button"
tabIndex={0}
className="RefreshLabel fa fa-refresh pointer"
onClick={this.props.onClick}
/>

View File

@ -183,6 +183,8 @@ export default class AdhocFilterEditPopover extends React.Component {
Close
</Button>
<i
role="button"
tabIndex={0}
onMouseDown={this.onDragDown}
className="fa fa-expand edit-popover-resize text-muted"
/>

View File

@ -317,6 +317,8 @@ export default class AdhocMetricEditPopover extends React.Component {
Close
</Button>
<i
role="button"
tabIndex={0}
onMouseDown={this.onDragDown}
className="fa fa-expand edit-popover-resize text-muted"
/>

View File

@ -86,6 +86,8 @@ export default class ControlHeader extends React.Component {
<ControlLabel>
{this.props.leftNode && <span>{this.props.leftNode}</span>}
<span
role="button"
tabIndex={0}
onClick={this.props.onClick}
className={labelClass}
style={{ cursor: this.props.onClick ? 'pointer' : '' }}

View File

@ -51,7 +51,9 @@ export default class ControlPanelSection extends React.Component {
label && (
<div>
<span>
<span onClick={this.toggleExpand}>{label}</span>{' '}
<span role="button" tabIndex={0} onClick={this.toggleExpand}>
{label}
</span>{' '}
{description && (
<InfoTooltipWithTrigger label={label} tooltip={description} />
)}
@ -64,6 +66,8 @@ export default class ControlPanelSection extends React.Component {
)}
</span>
<i
role="button"
tabIndex={0}
className={`float-right fa-lg text-primary expander fa fa-angle-${
this.state.expanded ? 'up' : 'down'
}`}

View File

@ -176,6 +176,8 @@ class ControlPanelsContainer extends React.Component {
<Alert bsStyle="warning">
{this.props.alert}
<i
role="button"
tabIndex={0}
className="fa fa-close pull-right"
onClick={this.removeAlert}
style={{ cursor: 'pointer' }}

View File

@ -76,6 +76,8 @@ export default function ExploreActionButtons({
{latestQueryFormData && (
<a
role="button"
tabIndex={0}
onClick={doExportChart}
className="btn btn-default btn-sm"
title={t('Export to .json')}
@ -87,6 +89,8 @@ export default function ExploreActionButtons({
)}
{latestQueryFormData && (
<a
role="button"
tabIndex={0}
onClick={doExportCSV}
className={exportToCSVClasses}
title={t('Export to .csv format')}

View File

@ -176,6 +176,8 @@ class SaveModal extends React.Component {
<Alert>
{this.state.alert ? this.state.alert : this.props.alert}
<i
role="button"
tabIndex={0}
className="fa fa-close pull-right"
onClick={this.removeAlert.bind(this)}
style={{ cursor: 'pointer' }}

View File

@ -177,6 +177,8 @@ class DatasourceControl extends React.PureComponent {
>
<a href="#">
<i
role="button"
tabIndex={0}
className={`fa fa-${
this.state.showDatasource ? 'minus' : 'plus'
}-square m-r-5 m-l-5 m-t-4`}

View File

@ -144,6 +144,8 @@ export default class VizTypeControl extends React.PureComponent {
return (
<div
role="button"
tabIndex={0}
className={`viztype-selector-container ${isSelected ? 'selected' : ''}`}
onClick={this.onChange.bind(this, key)}
>