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;
}
export function getPanelPluginNotFound(id: string): PanelPlugin {
export function getPanelPluginNotFound(id: string, silent?: boolean): PanelPlugin {
const NotFound = class NotFound extends PureComponent<PanelProps> {
render() {
return <PanelPluginError title={`Panel plugin not found: ${id}`} />;
}
};
const plugin = new PanelPlugin(NotFound);
const plugin = new PanelPlugin(silent ? () => null : NotFound);
plugin.meta = {
id: id,
name: id,

View File

@ -134,10 +134,12 @@ export function initDashboardPanel(panel: PanelModel): ThunkResult<void> {
plugin = await dispatch(loadPanelPlugin(pluginToLoad));
} catch (e) {
// When plugin not found
plugin = getPanelPluginNotFound(pluginToLoad);
plugin = getPanelPluginNotFound(pluginToLoad, pluginToLoad === 'row');
if (pluginToLoad !== 'row') {
notFound = true;
}
}
}
// if there isn't an "external" plugin with the same name as deprecated one, load the deprecated panel replacement
if (notFound && isDeprecated) {