Scenes: Panel repeater change (#61302)

* Update scene panel repeater by change in scenes package

* Use latest scenes package

* Fix package.json

* lock update

* Fix lock

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Torkel Ödegaard
2023-01-14 09:30:43 +01:00
committed by GitHub
parent 9d57b1c72e
commit 8f37295b02
3 changed files with 61 additions and 42 deletions

View File

@@ -2,11 +2,12 @@ import {
SceneFlexLayout,
SceneTimeRange,
SceneTimePicker,
ScenePanelRepeater,
SceneByFrameRepeater,
VizPanel,
SceneCanvasText,
SceneToolbarInput,
EmbeddedScene,
SceneDataNode,
} from '@grafana/scenes';
import { panelBuilders } from '../builders/panelBuilders';
@@ -76,33 +77,41 @@ export function getScenePanelRepeaterTest(standalone: boolean): Scene | Embedded
const state = {
title: 'Panel repeater test',
body: new ScenePanelRepeater({
layout: new SceneFlexLayout({
body: new SceneByFrameRepeater({
body: new SceneFlexLayout({
direction: 'column',
children: [
new SceneFlexLayout({
direction: 'row',
placement: { minHeight: 200 },
children: [
new VizPanel({
pluginId: 'timeseries',
title: 'Title',
options: {
legend: { displayMode: 'hidden' },
},
}),
new VizPanel({
placement: { width: 300 },
pluginId: 'stat',
fieldConfig: { defaults: { displayName: 'Last' }, overrides: [] },
options: {
graphMode: 'none',
},
}),
],
}),
],
children: [],
}),
getLayoutChild: (data, frame, frameIndex) => {
return new SceneFlexLayout({
key: `panel-${frameIndex}`,
$data: new SceneDataNode({
data: {
...data,
series: [frame],
},
}),
direction: 'row',
placement: { minHeight: 200 },
children: [
new VizPanel({
pluginId: 'timeseries',
title: 'Title',
options: {
legend: { displayMode: 'hidden' },
},
}),
new VizPanel({
placement: { width: 300 },
pluginId: 'stat',
fieldConfig: { defaults: { displayName: 'Last' }, overrides: [] },
options: {
graphMode: 'none',
},
}),
],
});
},
}),
$editor: new SceneEditManager({}),
$timeRange: new SceneTimeRange(),