Commit b4d5ddd6 by Peter Holmberg

fix for initial options

parent fd8fe35e
......@@ -19,14 +19,22 @@ export class VisualizationTab extends PureComponent<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() {
const { plugin, panel } = this.props;
const { plugin } = this.props;
const { PanelOptions } = plugin.exports;
if (PanelOptions) {
return (
<PanelOptions options={panel.getOptions(plugin.exports.PanelDefaults)} onChange={this.onPanelOptionsChanged} />
);
return <PanelOptions options={this.getPanelDefaultOptions()} onChange={this.onPanelOptionsChanged} />;
} else {
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