2019-04-26 19:16:38 +02:00
|
|
|
import { PanelPlugin } from '@grafana/ui';
|
2018-01-02 14:52:30 +01:00
|
|
|
|
2019-02-23 21:53:20 -08:00
|
|
|
import { TextPanelEditor } from './TextPanelEditor';
|
|
|
|
|
import { TextPanel } from './TextPanel';
|
|
|
|
|
import { TextOptions, defaults } from './types';
|
2018-01-02 14:52:30 +01:00
|
|
|
|
2019-04-26 19:16:38 +02:00
|
|
|
export const plugin = new PanelPlugin<TextOptions>(TextPanel)
|
2019-03-24 15:56:32 +01:00
|
|
|
.setDefaults(defaults)
|
|
|
|
|
.setEditor(TextPanelEditor)
|
|
|
|
|
.setPanelChangeHandler((options: TextOptions, prevPluginId: string, prevOptions: any) => {
|
|
|
|
|
if (prevPluginId === 'text') {
|
|
|
|
|
return prevOptions as TextOptions;
|
|
|
|
|
}
|
|
|
|
|
return options;
|
|
|
|
|
});
|