Commit b4d5ddd6 by Peter Holmberg

fix for initial options

parent fd8fe35e
...@@ -19,14 +19,22 @@ export class VisualizationTab extends PureComponent<Props> { ...@@ -19,14 +19,22 @@ export class VisualizationTab extends PureComponent<Props> {
super(props); super(props);
} }
getPanelDefaultOptions() {
const { panel, plugin } = this.props;
if (plugin.exports.PanelDefaults) {
return panel.getOptions(plugin.exports.PanelDefaults.options);
}
return panel.getOptions(plugin.exports.PanelDefaults);
}
renderPanelOptions() { renderPanelOptions() {
const { plugin, panel } = this.props; const { plugin } = this.props;
const { PanelOptions } = plugin.exports; const { PanelOptions } = plugin.exports;
if (PanelOptions) { if (PanelOptions) {
return ( return <PanelOptions options={this.getPanelDefaultOptions()} onChange={this.onPanelOptionsChanged} />;
<PanelOptions options={panel.getOptions(plugin.exports.PanelDefaults)} onChange={this.onPanelOptionsChanged} />
);
} else { } else {
return <p>Visualization has no options</p>; return <p>Visualization has no options</p>;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment