|
@@ -1,5 +1,5 @@
|
|
|
import { ReactPanelPlugin } from '@grafana/ui';
|
|
import { ReactPanelPlugin } from '@grafana/ui';
|
|
|
-import { SingleStatOptions, defaults } from './types';
|
|
|
|
|
|
|
+import { SingleStatOptions, defaults, SingleStatBaseOptions } from './types';
|
|
|
import { SingleStatPanel } from './SingleStatPanel';
|
|
import { SingleStatPanel } from './SingleStatPanel';
|
|
|
import cloneDeep from 'lodash/cloneDeep';
|
|
import cloneDeep from 'lodash/cloneDeep';
|
|
|
import { SingleStatEditor } from './SingleStatEditor';
|
|
import { SingleStatEditor } from './SingleStatEditor';
|
|
@@ -8,8 +8,8 @@ export const reactPanel = new ReactPanelPlugin<SingleStatOptions>(SingleStatPane
|
|
|
|
|
|
|
|
const optionsToKeep = ['valueOptions', 'stat', 'maxValue', 'maxValue', 'thresholds', 'valueMappings'];
|
|
const optionsToKeep = ['valueOptions', 'stat', 'maxValue', 'maxValue', 'thresholds', 'valueMappings'];
|
|
|
|
|
|
|
|
-export const singleStatOptionsCheck = (
|
|
|
|
|
- options: Partial<SingleStatOptions>,
|
|
|
|
|
|
|
+export const singleStatBaseOptionsCheck = (
|
|
|
|
|
+ options: Partial<SingleStatBaseOptions>,
|
|
|
prevPluginId?: string,
|
|
prevPluginId?: string,
|
|
|
prevOptions?: any
|
|
prevOptions?: any
|
|
|
) => {
|
|
) => {
|
|
@@ -26,4 +26,4 @@ export const singleStatOptionsCheck = (
|
|
|
|
|
|
|
|
reactPanel.setEditor(SingleStatEditor);
|
|
reactPanel.setEditor(SingleStatEditor);
|
|
|
reactPanel.setDefaults(defaults);
|
|
reactPanel.setDefaults(defaults);
|
|
|
-reactPanel.setPanelTypeChangedHook(singleStatOptionsCheck);
|
|
|
|
|
|
|
+reactPanel.setPanelTypeChangedHook(singleStatBaseOptionsCheck);
|