Skip to content

Commit

Permalink
Allow deletion of layers in xy charts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavies committed Jul 19, 2019

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
1 parent 91c6881 commit e263e4c
Showing 1 changed file with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -8,7 +8,15 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { Position } from '@elastic/charts';
import { EuiButton, EuiButtonGroup, EuiForm, EuiFormRow, EuiPanel, IconType } from '@elastic/eui';
import {
EuiButton,
EuiButtonGroup,
EuiForm,
EuiFormRow,
EuiPanel,
IconType,
EuiButtonIcon,
} from '@elastic/eui';
import { State, SeriesType, LayerConfig } from './types';
import { VisualizationProps } from '../types';
import { NativeRenderer } from '../native_renderer';
@@ -246,11 +254,19 @@ export function XYConfigPanel(props: VisualizationProps<State>) {
defaultMessage: 'Layer',
})}
>
<NativeRenderer
data-test-subj="lnsXY_layerHeader"
render={props.frame.datasourceLayers[layer.layerId].renderLayerPanel}
nativeProps={{ layerId: layer.layerId }}
/>
<>
<EuiButtonIcon
iconType="trash"
onClick={() => {
setState({ ...state, layers: state.layers.filter(l => l !== layer) });
}}

This comment has been minimized.

Copy link
@wylieconlon

wylieconlon Jul 19, 2019

Contributor

@chrisdavies This is throwing a warning for me about missing aria-label

/>
<NativeRenderer
data-test-subj="lnsXY_layerHeader"
render={props.frame.datasourceLayers[layer.layerId].renderLayerPanel}
nativeProps={{ layerId: layer.layerId }}
/>
</>
</EuiFormRow>

<EuiFormRow

0 comments on commit e263e4c

Please sign in to comment.