Dashboards: Fix inconsistent variable quoting for repeated panels (#102030)

* fix inconsistent variable quoting

* remove unnecessary code
This commit is contained in:
Victor Marin
2025-03-12 16:29:06 +02:00
committed by GitHub
parent 1f637d07eb
commit d1a1c07bdd
2 changed files with 23 additions and 0 deletions
@@ -58,6 +58,27 @@ describe('PanelRepeaterGridItem', () => {
expect(repeater.state.repeatedPanels?.length).toBe(5);
});
it('Should pass isMulti/includeAll values if variable is multi variable and has them set', async () => {
const { scene, repeater } = buildPanelRepeaterScene({ variableQueryTime: 1 });
activateFullSceneTree(scene);
expect(repeater.state.repeatedPanels?.length).toBe(0);
await new Promise((r) => setTimeout(r, 10));
expect(repeater.state.repeatedPanels?.length).toBe(5);
// LocalValueVariableState is not exposed, so we build this type casting
const variableState = repeater.state.repeatedPanels![0].state.$variables?.state.variables[0].state as {
isMulti?: boolean;
includeAll?: boolean;
};
expect(variableState.isMulti).toBe(true);
expect(variableState.includeAll).toBe(true);
});
it('Should display a panel when there are no options', async () => {
const { scene, repeater } = buildPanelRepeaterScene({ variableQueryTime: 1, numberOfOptions: 0 });
@@ -157,6 +157,8 @@ export class DashboardGridItem
name: variable.state.name,
value: variableValues[index],
text: String(variableTexts[index]),
isMulti: variable.state.isMulti,
includeAll: variable.state.includeAll,
}),
],
}),