From 9537de26a53b6f4dff8fcd7dee8fbaf17db884eb Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:45:24 +0100 Subject: [PATCH] Scenes: Fix issue where annotations with same name wouldn't render properly (#85489) Closes #85457 --- .../serialization/transformSaveModelToScene.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts index 8a7bd3de4ed..bbbae286968 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts @@ -1,3 +1,5 @@ +import { uniqueId } from 'lodash'; + import { DataFrameDTO, DataFrameJSON, TypedVariableModel } from '@grafana/data'; import { config } from '@grafana/runtime'; import { @@ -248,7 +250,7 @@ export function createDashboardSceneFromDashboardModel(oldModel: DashboardModel) annotationLayers = oldModel.annotations?.list.map((a) => { // Each annotation query is an individual data layer return new DashboardAnnotationsDataLayer({ - key: `annotations-${a.name}`, + key: uniqueId('annotations-'), query: a, name: a.name, isEnabled: Boolean(a.enable),