mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 08:18:10 -05:00
DashboardScene: Fixes angular panels inside collapsed rows (#78532)
* DashboardScene: Fixes angular panels inside collapsed rows * Update
This commit is contained in:
+1
-10
@@ -123,11 +123,6 @@ exports[`transformSceneToSaveModel Given a scene with rows Should transform back
|
||||
</div>",
|
||||
"mode": "markdown",
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
},
|
||||
],
|
||||
"title": "",
|
||||
"transformations": [],
|
||||
"transparent": false,
|
||||
@@ -180,6 +175,7 @@ exports[`transformSceneToSaveModel Given a scene with rows Should transform back
|
||||
</div>",
|
||||
"mode": "markdown",
|
||||
},
|
||||
"title": "Text panel in collapsed row",
|
||||
"transformations": [],
|
||||
"transparent": false,
|
||||
"type": "text",
|
||||
@@ -433,11 +429,6 @@ exports[`transformSceneToSaveModel Given a simple scene with variables Should tr
|
||||
"content": "content",
|
||||
"mode": "markdown",
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
},
|
||||
],
|
||||
"title": "Transparent text panel",
|
||||
"transformations": [],
|
||||
"transparent": true,
|
||||
|
||||
+1
@@ -182,6 +182,7 @@
|
||||
"y": 26
|
||||
},
|
||||
"id": 30,
|
||||
"title": "Text panel in collapsed row",
|
||||
"options": {
|
||||
"code": {
|
||||
"language": "plaintext",
|
||||
|
||||
@@ -124,7 +124,13 @@ export function createSceneObjectsForPanels(oldPanels: PanelModel[]): SceneGridI
|
||||
function createRowFromPanelModel(row: PanelModel, content: SceneGridItemLike[]): SceneGridItemLike {
|
||||
if (Boolean(row.collapsed)) {
|
||||
if (row.panels) {
|
||||
content = row.panels.map(buildGridItemForPanel);
|
||||
content = row.panels.map((saveModel) => {
|
||||
// Collapsed panels are not actually PanelModel instances
|
||||
if (!(saveModel instanceof PanelModel)) {
|
||||
saveModel = new PanelModel(saveModel);
|
||||
}
|
||||
return buildGridItemForPanel(saveModel);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ const runRequestMock = jest.fn().mockImplementation((ds: DataSourceApi, request:
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
...jest.requireActual('@grafana/runtime'),
|
||||
getDataSourceSrv: () => ({
|
||||
@@ -135,7 +136,9 @@ jest.mock('@grafana/runtime', () => ({
|
||||
return runRequestMock(ds, request);
|
||||
},
|
||||
config: {
|
||||
panels: [],
|
||||
panels: {
|
||||
text: { skipDataQuery: true },
|
||||
},
|
||||
featureToggles: {
|
||||
dataTrails: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user