mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Panels: Refactoring how panel plugins sets hooks and components, #16166
This commit is contained in:
@@ -6,7 +6,7 @@ import { PieChartOptions } from './types';
|
||||
import { SingleStatValueEditor } from '../singlestat2/SingleStatValueEditor';
|
||||
import { SingleStatValueOptions } from '../singlestat2/types';
|
||||
|
||||
export default class PieChartPanelEditor extends PureComponent<PanelEditorProps<PieChartOptions>> {
|
||||
export class PieChartPanelEditor extends PureComponent<PanelEditorProps<PieChartOptions>> {
|
||||
onValueMappingsChanged = (valueMappings: ValueMapping[]) =>
|
||||
this.props.onOptionsChange({
|
||||
...this.props.options,
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { ReactPanelPlugin } from '@grafana/ui';
|
||||
|
||||
import PieChartPanelEditor from './PieChartPanelEditor';
|
||||
import { PieChartPanelEditor } from './PieChartPanelEditor';
|
||||
import { PieChartPanel } from './PieChartPanel';
|
||||
import { PieChartOptions, defaults } from './types';
|
||||
import { singleStatBaseOptionsCheck } from '../singlestat2/module';
|
||||
|
||||
export const reactPanel = new ReactPanelPlugin<PieChartOptions>(PieChartPanel, defaults);
|
||||
|
||||
reactPanel.editor = PieChartPanelEditor;
|
||||
reactPanel.onPanelTypeChanged = singleStatBaseOptionsCheck;
|
||||
export const reactPanel = new ReactPanelPlugin<PieChartOptions>(PieChartPanel)
|
||||
.setDefaults(defaults)
|
||||
.setEditor(PieChartPanelEditor);
|
||||
|
||||
Reference in New Issue
Block a user