From 46dc898a877e3f56adb3931780a58cc63037f586 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Wed, 11 Oct 2023 16:56:50 +0200 Subject: [PATCH] Fix container width not being set after latest scenes update (#76372) * Fix container width after latest scenes update * typecheck --- public/app/features/dashboard-scene/utils/test-utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/app/features/dashboard-scene/utils/test-utils.ts b/public/app/features/dashboard-scene/utils/test-utils.ts index aa56667363c..269e2423082 100644 --- a/public/app/features/dashboard-scene/utils/test-utils.ts +++ b/public/app/features/dashboard-scene/utils/test-utils.ts @@ -52,6 +52,12 @@ export function activateFullSceneTree(scene: SceneObject): SceneDeactivationHand const deactivationHandlers: SceneDeactivationHandler[] = []; scene.forEachChild((child) => { + // For query runners which by default use the container width for maxDataPoints calculation we are setting a width. + // In real life this is done by the React component when VizPanel is rendered. + if ('setContainerWidth' in child) { + // @ts-expect-error + child.setContainerWidth(500); + } deactivationHandlers.push(activateFullSceneTree(child)); });