From 4d50cb2b7be03fd45ec123d25a914c63aae432aa Mon Sep 17 00:00:00 2001 From: Oscar Kilhed Date: Tue, 17 Sep 2024 14:33:06 +0200 Subject: [PATCH] Scenes: Ensure scenes dashboards interpolate variables in sql queries the same as old arch (#93270) Ensure scenes dashboards interpolate variables in sql queries the same as old arch --- .betterer.results | 3 -- .../scene/RowRepeaterBehavior.test.tsx | 18 ---------- .../scene/RowRepeaterBehavior.ts | 33 +++++++++++++------ 3 files changed, 23 insertions(+), 31 deletions(-) diff --git a/.betterer.results b/.betterer.results index fcfce0cf94b..8858cfe8c29 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2771,9 +2771,6 @@ exports[`better eslint`] = { "public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"] - ], "public/app/features/dashboard-scene/scene/row-actions/RowActions.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], diff --git a/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.test.tsx b/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.test.tsx index 67701dfeacd..f9cd350a9a7 100644 --- a/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.test.tsx @@ -167,24 +167,6 @@ describe('RowRepeaterBehavior', () => { }); }); - describe('Should not repeat row', () => { - it('Should ignore repeat process if the variable is not a multi select variable', async () => { - const { scene, grid, repeatBehavior } = buildScene({ variableQueryTime: 0 }, undefined, { isMulti: false }); - const gridStateUpdates = []; - grid.subscribeToState((state) => gridStateUpdates.push(state)); - - activateFullSceneTree(scene); - await new Promise((r) => setTimeout(r, 1)); - - // trigger another repeat cycle by changing the variable - repeatBehavior.performRepeat(); - - await new Promise((r) => setTimeout(r, 1)); - - expect(gridStateUpdates.length).toBe(0); - }); - }); - describe('Given scene with DashboardGridItem', () => { let scene: DashboardScene; let grid: SceneGridLayout; diff --git a/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts b/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts index ae1aefee9f6..cf28361b3e5 100644 --- a/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts +++ b/public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts @@ -141,12 +141,7 @@ export class RowRepeaterBehavior extends SceneObjectBase