Silcense warning message for row (#32985)

This commit is contained in:
Alex Khomenko 2021-04-14 16:48:53 +03:00 committed by GitHub
parent 282c62d8bf
commit 4b801be98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -51,14 +51,15 @@ export function getPanelPluginLoadError(meta: PanelPluginMeta, err: any): PanelP
return plugin; return plugin;
} }
export function getPanelPluginNotFound(id: string): PanelPlugin { export function getPanelPluginNotFound(id: string, silent?: boolean): PanelPlugin {
const NotFound = class NotFound extends PureComponent<PanelProps> { const NotFound = class NotFound extends PureComponent<PanelProps> {
render() { render() {
return <PanelPluginError title={`Panel plugin not found: ${id}`} />; return <PanelPluginError title={`Panel plugin not found: ${id}`} />;
} }
}; };
const plugin = new PanelPlugin(NotFound); const plugin = new PanelPlugin(silent ? () => null : NotFound);
plugin.meta = { plugin.meta = {
id: id, id: id,
name: id, name: id,

View File

@ -134,8 +134,10 @@ export function initDashboardPanel(panel: PanelModel): ThunkResult<void> {
plugin = await dispatch(loadPanelPlugin(pluginToLoad)); plugin = await dispatch(loadPanelPlugin(pluginToLoad));
} catch (e) { } catch (e) {
// When plugin not found // When plugin not found
plugin = getPanelPluginNotFound(pluginToLoad); plugin = getPanelPluginNotFound(pluginToLoad, pluginToLoad === 'row');
notFound = true; if (pluginToLoad !== 'row') {
notFound = true;
}
} }
} }