Dashboards: Limit panel title length (#102911)

Limit panel title length
pull/102927/head
Oscar Kilhed 3 months ago committed by GitHub
parent 80e58efd46
commit 44c471d10c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      public/app/features/dashboard-scene/serialization/layoutSerializers/utils.ts
  2. 2
      public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts
  3. 1
      public/app/features/dashboard/dashgrid/DashboardGrid.tsx

@ -59,7 +59,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,

@ -323,7 +323,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) {

Loading…
Cancel
Save