diff --git a/packages/grafana-ui/src/types/panel.ts b/packages/grafana-ui/src/types/panel.ts index 6c0e827a9bf..888e1eb5924 100644 --- a/packages/grafana-ui/src/types/panel.ts +++ b/packages/grafana-ui/src/types/panel.ts @@ -10,7 +10,7 @@ export interface PanelPluginMeta extends PluginMeta { hideFromList?: boolean; sort: number; angularPlugin: AngularPanelPlugin | null; - vizPlugin: PanelPlugin | null; + panelPlugin: PanelPlugin | null; hasBeenImported?: boolean; // if length>0 the query tab will show up diff --git a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx index a4f8eb2063b..0d2fc80ab71 100644 --- a/public/app/features/dashboard/dashgrid/DashboardPanel.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardPanel.tsx @@ -101,7 +101,7 @@ export class DashboardPanel extends PureComponent { if (importedPlugin instanceof AngularPanelPlugin) { plugin.angularPlugin = importedPlugin as AngularPanelPlugin; } else if (importedPlugin instanceof PanelPlugin) { - plugin.vizPlugin = importedPlugin as PanelPlugin; + plugin.panelPlugin = importedPlugin as PanelPlugin; } } catch (e) { plugin = getPanelPluginNotFound(plugin.id); @@ -209,7 +209,7 @@ export class DashboardPanel extends PureComponent { onMouseLeave={this.onMouseLeave} style={styles} > - {plugin.vizPlugin && this.renderReactPanel()} + {plugin.panelPlugin && this.renderReactPanel()} {plugin.angularPlugin && this.renderAngularPanel()} )} diff --git a/public/app/features/dashboard/dashgrid/PanelChrome.tsx b/public/app/features/dashboard/dashgrid/PanelChrome.tsx index 57b80739e88..967bb67153b 100644 --- a/public/app/features/dashboard/dashgrid/PanelChrome.tsx +++ b/public/app/features/dashboard/dashgrid/PanelChrome.tsx @@ -215,7 +215,7 @@ export class PanelChrome extends PureComponent { renderPanel(width: number, height: number): JSX.Element { const { panel, plugin } = this.props; const { renderCounter, data, isFirstLoad } = this.state; - const PanelComponent = plugin.vizPlugin.panel; + const PanelComponent = plugin.panelPlugin.panel; // This is only done to increase a counter that is used by backend // image rendering (phantomjs/headless chrome) to know when to capture image @@ -236,7 +236,7 @@ export class PanelChrome extends PureComponent { { getReactPanelOptions = () => { const { panel, plugin } = this.props; - return panel.getOptions(plugin.vizPlugin.defaults); + return panel.getOptions(plugin.panelPlugin.defaults); }; renderPanelOptions() { @@ -64,8 +64,8 @@ export class VisualizationTab extends PureComponent { return
(this.element = element)} />; } - if (plugin.vizPlugin) { - const PanelEditor = plugin.vizPlugin.editor; + if (plugin.panelPlugin) { + const PanelEditor = plugin.panelPlugin.editor; if (PanelEditor) { return ; diff --git a/public/app/features/dashboard/state/PanelModel.test.ts b/public/app/features/dashboard/state/PanelModel.test.ts index 6cde516d1af..a16a9c30cab 100644 --- a/public/app/features/dashboard/state/PanelModel.test.ts +++ b/public/app/features/dashboard/state/PanelModel.test.ts @@ -129,7 +129,7 @@ describe('PanelModel', () => { model.changePlugin( getPanelPlugin({ id: 'react', - vizPlugin: reactPlugin, + panelPlugin: reactPlugin, }) ); }); diff --git a/public/app/features/dashboard/state/PanelModel.ts b/public/app/features/dashboard/state/PanelModel.ts index 3b7f754bc40..30ee3bfa3f9 100644 --- a/public/app/features/dashboard/state/PanelModel.ts +++ b/public/app/features/dashboard/state/PanelModel.ts @@ -255,10 +255,10 @@ export class PanelModel { pluginLoaded(plugin: PanelPluginMeta) { this.plugin = plugin; - if (plugin.vizPlugin && plugin.vizPlugin.onPanelMigration) { + if (plugin.panelPlugin && plugin.panelPlugin.onPanelMigration) { const version = this.getPluginVersion(plugin); if (version !== this.pluginVersion) { - this.options = plugin.vizPlugin.onPanelMigration(this); + this.options = plugin.panelPlugin.onPanelMigration(this); this.pluginVersion = version; } } @@ -291,7 +291,7 @@ export class PanelModel { this.plugin = newPlugin; // Let panel plugins inspect options from previous panel and keep any that it can use - const reactPanel = newPlugin.vizPlugin; + const reactPanel = newPlugin.panelPlugin; if (reactPanel) { if (reactPanel.onPanelTypeChanged) { diff --git a/public/app/features/plugins/__mocks__/pluginMocks.ts b/public/app/features/plugins/__mocks__/pluginMocks.ts index bd6ab0d9f29..3d2cb4c5fdc 100644 --- a/public/app/features/plugins/__mocks__/pluginMocks.ts +++ b/public/app/features/plugins/__mocks__/pluginMocks.ts @@ -57,7 +57,7 @@ export const getPanelPlugin = (options: Partial): PanelPluginMe hideFromList: options.hideFromList === true, module: '', baseUrl: '', - vizPlugin: options.vizPlugin, + panelPlugin: options.panelPlugin, angularPlugin: options.angularPlugin, }; };