Chore: Deprecate ID from Folder (#78281)
* Chore: Deprecate ID from Folder * chore: add more linter comments * chore: add missing lint comment
This commit is contained in:
@@ -193,7 +193,7 @@ func (lps LibraryPanelService) CountInFolder(ctx context.Context, orgID int64, f
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// nolint:staticcheck
|
||||
q := sess.Table("library_element").Where("org_id = ?", u.GetOrgID()).
|
||||
Where("folder_id = ?", folder.ID).Where("kind = ?", int64(model.PanelElement))
|
||||
count, err = q.Count()
|
||||
|
||||
@@ -80,6 +80,7 @@ func TestConnectLibraryPanelsForDashboard(t *testing.T) {
|
||||
Title: "Testing ConnectLibraryPanelsForDashboard",
|
||||
Data: simplejson.NewFromAny(dashJSON),
|
||||
}
|
||||
// nolint:staticcheck
|
||||
dashInDB := createDashboard(t, sc.sqlStore, sc.user, &dash, sc.folder.ID)
|
||||
|
||||
err := sc.service.ConnectLibraryPanelsForDashboard(sc.ctx, sc.user, dashInDB)
|
||||
@@ -178,6 +179,7 @@ func TestConnectLibraryPanelsForDashboard(t *testing.T) {
|
||||
Title: "Testing ConnectLibraryPanelsForDashboard",
|
||||
Data: simplejson.NewFromAny(dashJSON),
|
||||
}
|
||||
// nolint:staticcheck
|
||||
dashInDB := createDashboard(t, sc.sqlStore, sc.user, &dash, sc.folder.ID)
|
||||
|
||||
err = sc.service.ConnectLibraryPanelsForDashboard(sc.ctx, sc.user, dashInDB)
|
||||
@@ -224,6 +226,7 @@ func TestConnectLibraryPanelsForDashboard(t *testing.T) {
|
||||
Title: "Testing ConnectLibraryPanelsForDashboard",
|
||||
Data: simplejson.NewFromAny(dashJSON),
|
||||
}
|
||||
// nolint:staticcheck
|
||||
dashInDB := createDashboard(t, sc.sqlStore, sc.user, &dash, sc.folder.ID)
|
||||
|
||||
err := sc.service.ConnectLibraryPanelsForDashboard(sc.ctx, sc.user, dashInDB)
|
||||
@@ -280,6 +283,7 @@ func TestConnectLibraryPanelsForDashboard(t *testing.T) {
|
||||
Title: "Testing ConnectLibraryPanelsForDashboard",
|
||||
Data: simplejson.NewFromAny(dashJSON),
|
||||
}
|
||||
// nolint:staticcheck
|
||||
dashInDB := createDashboard(t, sc.sqlStore, sc.user, &dash, sc.folder.ID)
|
||||
err = sc.elementService.ConnectElementsToDashboard(sc.ctx, sc.user, []string{sc.initialResult.Result.UID}, dashInDB.ID)
|
||||
require.NoError(t, err)
|
||||
@@ -429,6 +433,7 @@ func TestImportLibraryPanelsForDashboard(t *testing.T) {
|
||||
model.GetLibraryElementCommand{UID: existingUID, FolderName: dashboards.RootFolderName})
|
||||
require.NoError(t, err)
|
||||
|
||||
// nolint:staticcheck
|
||||
err = sc.service.ImportLibraryPanelsForDashboard(sc.ctx, sc.user, simplejson.New(), panels, sc.folder.ID)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -880,7 +885,7 @@ func testScenario(t *testing.T, desc string, fn func(t *testing.T, sc scenarioCo
|
||||
|
||||
foldr := createFolder(t, sc, "ScenarioFolder")
|
||||
sc.folder = &folder.Folder{
|
||||
ID: foldr.ID,
|
||||
ID: foldr.ID, // nolint:staticcheck
|
||||
UID: foldr.UID,
|
||||
Title: foldr.Title,
|
||||
URL: dashboards.GetFolderURL(foldr.UID, slugify.Slugify(foldr.Title)),
|
||||
|
||||
Reference in New Issue
Block a user