[release-11.6.1] Dashboards: Limit panel title length (#102920)

Dashboards: Limit panel title length (#102911)

Limit panel title length

(cherry picked from commit 44c471d10c)
This commit is contained in:
Oscar Kilhed
2025-03-26 18:42:04 +02:00
committed by GitHub
parent f71ffd245b
commit 42d624cce5
3 changed files with 3 additions and 2 deletions
@@ -47,7 +47,7 @@ export function buildVizPanel(panel: PanelKind): VizPanel {
const vizPanelState: VizPanelState = {
key: getVizPanelKeyForPanelId(panel.spec.id),
title: panel.spec.title,
title: panel.spec.title?.substring(0, 5000),
description: panel.spec.description,
pluginId: panel.spec.vizConfig.kind,
options: panel.spec.vizConfig.spec.options,
@@ -324,7 +324,7 @@ export function buildGridItemForPanel(panel: PanelModel): DashboardGridItem {
const vizPanelState: VizPanelState = {
key: getVizPanelKeyForPanelId(panel.id),
title: panel.title,
title: panel.title?.substring(0, 5000),
description: panel.description,
pluginId: panel.type ?? 'timeseries',
options: panel.options ?? {},
@@ -111,6 +111,7 @@ export class DashboardGrid extends PureComponent<Props, State> {
if (!panel.key) {
panel.key = `panel-${panel.id}-${Date.now()}`;
}
panel.title = panel.title?.substring(0, 5000);
this.panelMap[panel.key] = panel;
if (!panel.gridPos) {