Aftermerge fixes

pull/15511/head
corpglory-dev 6 years ago
parent 250ee2298a
commit 083cc0bbca
  1. 4
      public/app/plugins/panel/piechart/PiechartOptionsBox.tsx
  2. 6
      public/app/plugins/panel/piechart/PiechartPanelEditor.tsx
  3. 3
      public/app/plugins/panel/piechart/PiechartValueEditor.tsx

@ -16,8 +16,8 @@ const labelWidth = 8;
const piechartOptions = [{ value: PiechartType.PIE, label: 'Pie' }, { value: PiechartType.DONUT, label: 'Donut' }]; const piechartOptions = [{ value: PiechartType.PIE, label: 'Pie' }, { value: PiechartType.DONUT, label: 'Donut' }];
export class PiechartOptionsBox extends PureComponent<PanelEditorProps<PiechartOptions>> { export class PiechartOptionsBox extends PureComponent<PanelEditorProps<PiechartOptions>> {
onPieTypeChange = ({ target }) => this.props.onChange({ ...this.props.options, pieType: target.value }); onPieTypeChange = ({ target }) => this.props.onOptionsChange({ ...this.props.options, pieType: target.value });
onStrokeWidthChange = ({ target }) => this.props.onChange({ ...this.props.options, strokeWidth: target.value }); onStrokeWidthChange = ({ target }) => this.props.onOptionsChange({ ...this.props.options, strokeWidth: target.value });
render() { render() {
const { options } = this.props; const { options } = this.props;

@ -7,19 +7,19 @@ import { PiechartOptions, PiechartValueOptions } from './types';
export default class PiechartPanelEditor extends PureComponent<PanelEditorProps<PiechartOptions>> { export default class PiechartPanelEditor extends PureComponent<PanelEditorProps<PiechartOptions>> {
onValueOptionsChanged = (valueOptions: PiechartValueOptions) => onValueOptionsChanged = (valueOptions: PiechartValueOptions) =>
this.props.onChange({ this.props.onOptionsChange({
...this.props.options, ...this.props.options,
valueOptions, valueOptions,
}); });
render() { render() {
const { onChange, options } = this.props; const { onOptionsChange, options } = this.props;
return ( return (
<> <>
<PanelOptionsGrid> <PanelOptionsGrid>
<PiechartValueEditor onChange={this.onValueOptionsChanged} options={options.valueOptions} /> <PiechartValueEditor onChange={this.onValueOptionsChanged} options={options.valueOptions} />
<PiechartOptionsBox onChange={onChange} options={options} /> <PiechartOptionsBox onOptionsChange={onOptionsChange} options={options} />
</PanelOptionsGrid> </PanelOptionsGrid>
</> </>
); );

@ -1,6 +1,5 @@
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { FormLabel, PanelOptionsGroup, Select } from '@grafana/ui'; import { FormLabel, PanelOptionsGroup, Select, UnitPicker } from '@grafana/ui';
import UnitPicker from 'app/core/components/Select/UnitPicker';
import { PiechartValueOptions } from './types'; import { PiechartValueOptions } from './types';
const statOptions = [ const statOptions = [

Loading…
Cancel
Save