mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 01:12:19 +08:00
Annotations: Use dashboard uids instead of dashboard ids (#106676)
This commit is contained in:

committed by
GitHub

parent
47f3073ab8
commit
a8886ad5ec
@ -81,7 +81,7 @@ func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
|
||||
}),
|
||||
})
|
||||
|
||||
_ = testutil.CreateDashboard(t, sql, cfg, features, dashboards.SaveDashboardCommand{
|
||||
dashboard2 := testutil.CreateDashboard(t, sql, cfg, features, dashboards.SaveDashboardCommand{
|
||||
UserID: 1,
|
||||
OrgID: 1,
|
||||
IsFolder: false,
|
||||
@ -91,18 +91,20 @@ func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
|
||||
})
|
||||
|
||||
dash1Annotation := &annotations.Item{
|
||||
OrgID: 1,
|
||||
DashboardID: 1,
|
||||
Epoch: 10,
|
||||
OrgID: 1,
|
||||
DashboardID: 1, // nolint: staticcheck
|
||||
DashboardUID: dashboard1.UID,
|
||||
Epoch: 10,
|
||||
}
|
||||
err = repo.Save(context.Background(), dash1Annotation)
|
||||
require.NoError(t, err)
|
||||
|
||||
dash2Annotation := &annotations.Item{
|
||||
OrgID: 1,
|
||||
DashboardID: 2,
|
||||
Epoch: 10,
|
||||
Tags: []string{"foo:bar"},
|
||||
OrgID: 1,
|
||||
DashboardID: 2, // nolint: staticcheck
|
||||
DashboardUID: dashboard2.UID,
|
||||
Epoch: 10,
|
||||
Tags: []string{"foo:bar"},
|
||||
}
|
||||
err = repo.Save(context.Background(), dash2Annotation)
|
||||
require.NoError(t, err)
|
||||
@ -292,10 +294,11 @@ func TestIntegrationAnnotationListingWithInheritedRBAC(t *testing.T) {
|
||||
|
||||
annotationTxt := fmt.Sprintf("annotation %d", i)
|
||||
dash1Annotation := &annotations.Item{
|
||||
OrgID: orgID,
|
||||
DashboardID: dashboard.ID,
|
||||
Epoch: 10,
|
||||
Text: annotationTxt,
|
||||
OrgID: orgID,
|
||||
DashboardID: dashboard.ID, // nolint: staticcheck
|
||||
DashboardUID: dashboard.UID,
|
||||
Epoch: 10,
|
||||
Text: annotationTxt,
|
||||
}
|
||||
err = store.Add(context.Background(), dash1Annotation)
|
||||
require.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user