Began work on handling panel type switching and keep setting

This commit is contained in:
Torkel Ödegaard
2019-02-17 07:03:42 +01:00
parent 1d4dae7aa8
commit dede40d459
5 changed files with 25 additions and 11 deletions

View File

@@ -76,21 +76,19 @@ export class DashboardPanel extends PureComponent<Props, State> {
// unmount angular panel
this.cleanUpAngularPanel();
if (panel.type !== pluginId) {
this.props.panel.changeType(pluginId, fromAngularPanel);
}
if (plugin.exports) {
this.setState({ plugin, angularPanel: null });
} else {
if (!plugin.exports) {
try {
plugin.exports = await importPluginModule(plugin.module);
} catch (e) {
plugin = getPanelPluginNotFound(pluginId);
}
this.setState({ plugin, angularPanel: null });
}
if (panel.type !== pluginId) {
this.props.panel.changeType(pluginId, fromAngularPanel);
}
this.setState({ plugin, angularPanel: null });
}
}