module.tsx 541 B

1234567891011121314151617
  1. import { ReactPanelPlugin } from '@grafana/ui';
  2. import { TextPanelEditor } from './TextPanelEditor';
  3. import { TextPanel } from './TextPanel';
  4. import { TextOptions, defaults } from './types';
  5. export const reactPanel = new ReactPanelPlugin<TextOptions>(TextPanel);
  6. reactPanel.setEditor(TextPanelEditor);
  7. reactPanel.setDefaults(defaults);
  8. reactPanel.setPanelTypeChangedHook((options: TextOptions, prevPluginId: string, prevOptions: any) => {
  9. if (prevPluginId === 'text') {
  10. return prevOptions as TextOptions;
  11. }
  12. return options;
  13. });