diff --git a/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx b/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx index 56ecb18e3cb..15ab2587058 100644 --- a/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx +++ b/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx @@ -107,6 +107,9 @@ function UnconfiguredPanelComp(props: PanelProps) { // Set the query in the panel queryRunner.setState({ queries: [enrichedQuery] }); + // TODO: Update this to utilize viz suggestions + panel.changePluginType('table'); + // Update datasource if needed if (enrichedQuery.datasource?.uid) { const dsSettings = await getDataSourceSrv().get({ uid: enrichedQuery.datasource.uid }); @@ -115,7 +118,10 @@ function UnconfiguredPanelComp(props: PanelProps) { locationService.partial({ editPanel: props.id }); - queryRunner.runQueries(); + // This is needed to ensure the query runner is initialized before running queries + setTimeout(() => { + queryRunner.runQueries(); + }, 0); } catch (error) { console.error('Failed to set query from library:', error); }