diff --git a/.eslintrc b/.eslintrc index 3532d3844a0..cbecd02a239 100644 --- a/.eslintrc +++ b/.eslintrc @@ -73,7 +73,6 @@ // we should remove the corresponding line and fix them one by one // any marked "error" contain specific overrides we'll need to keep "jsx-a11y/click-events-have-key-events": "off", - "jsx-a11y/label-has-associated-control": "off", "jsx-a11y/mouse-events-have-key-events": "off", "jsx-a11y/no-autofocus": [ "error", diff --git a/packages/grafana-ui/src/components/ColorPicker/SeriesColorPickerPopover.tsx b/packages/grafana-ui/src/components/ColorPicker/SeriesColorPickerPopover.tsx index 20d2e4af2e6..c463571f6b0 100644 --- a/packages/grafana-ui/src/components/ColorPicker/SeriesColorPickerPopover.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/SeriesColorPickerPopover.tsx @@ -1,8 +1,7 @@ import { css } from '@emotion/css'; -import React, { FunctionComponent, PureComponent } from 'react'; +import React, { FunctionComponent } from 'react'; import { withTheme2, useStyles2 } from '../../themes'; -import { Button } from '../Button'; import { Switch } from '../Forms/Legacy/Switch/Switch'; import { PopoverContentProps } from '../Tooltip'; @@ -43,52 +42,6 @@ export const SeriesColorPickerPopover: FunctionComponent; }; -interface AxisSelectorProps { - yaxis: number; - onToggleAxis?: () => void; -} - -interface AxisSelectorState { - yaxis: number; -} - -export class AxisSelector extends PureComponent { - constructor(props: AxisSelectorProps) { - super(props); - this.state = { - yaxis: this.props.yaxis, - }; - this.onToggleAxis = this.onToggleAxis.bind(this); - } - - onToggleAxis() { - this.setState({ - yaxis: this.state.yaxis === 2 ? 1 : 2, - }); - - if (this.props.onToggleAxis) { - this.props.onToggleAxis(); - } - } - - render() { - const leftButtonVariant = this.state.yaxis === 1 ? 'primary' : 'secondary'; - const rightButtonVariant = this.state.yaxis === 2 ? 'primary' : 'secondary'; - - return ( -
- - - -
- ); - } -} - // This component is to enable SeriesColorPickerPopover usage via series-color-picker-popover directive export const SeriesColorPickerPopoverWithTheme = withTheme2(SeriesColorPickerPopover); diff --git a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx index 37af44271d8..77609e1966a 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx @@ -155,13 +155,14 @@ export const DataSourceHttpSettings: React.FC = (props) => {
- +
{isAccessHelpVisible && } diff --git a/packages/grafana-ui/src/components/Switch/Switch.tsx b/packages/grafana-ui/src/components/Switch/Switch.tsx index d1d22d44d26..e6ab6df43cb 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.tsx @@ -14,7 +14,7 @@ export interface Props extends Omit, 'value'> { } export const Switch = React.forwardRef( - ({ value, checked, disabled, onChange, id, ...inputProps }, ref) => { + ({ value, checked, disabled, onChange, id, label, ...inputProps }, ref) => { if (checked) { deprecationWarning('Switch', 'checked prop', 'value'); } @@ -36,7 +36,7 @@ export const Switch = React.forwardRef( {...inputProps} ref={ref} /> -