Changed how react panels store their options (#15468)

Changed how react panels store their options

* Added a ReactPanelPlugin as the interface that react panels export, this way react panels have clearer api, and gives us hooks to handle migrations and a way for panel to handle panel changes in the future
* Moved gauge value options into a sub oject and made editor more generic, will be moved out of gauge pane later and shared between singlestat, gauge, bargauge, honecomb
* Also remove nested options prop that was there due to bug
* Added missing Gauge props
* Fixed gauge issue that will require migration later and also value options editor did not handle null decimals or 0 decimals
* Fixed unit tests
* More fixes for react panels
This commit is contained in:
Torkel Ödegaard
2019-02-18 11:41:14 +01:00
committed by GitHub
parent a6cae5b2b8
commit abddb442a1
23 changed files with 203 additions and 117 deletions

View File

@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import { PanelProps } from '@grafana/ui';
import { PanelProps, ReactPanelPlugin } from '@grafana/ui';
export class Text2 extends PureComponent<PanelProps> {
constructor(props: PanelProps) {
@@ -11,4 +11,4 @@ export class Text2 extends PureComponent<PanelProps> {
}
}
export { Text2 as Panel };
export const reactPanel = new ReactPanelPlugin(Text2);