mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Deprecate FolderID in GetLibraryElementCommand (#77404)
This commit is contained in:
parent
91398a173f
commit
87717849da
@ -661,14 +661,14 @@ func TestIntegrationNestedFolderService(t *testing.T) {
|
|||||||
|
|
||||||
_, err = lps.LibraryElementService.GetElement(context.Background(), &signedInUser, model.GetLibraryElementCommand{
|
_, err = lps.LibraryElementService.GetElement(context.Background(), &signedInUser, model.GetLibraryElementCommand{
|
||||||
FolderName: parent.Title,
|
FolderName: parent.Title,
|
||||||
FolderID: parent.ID,
|
FolderID: parent.ID, // nolint:staticcheck
|
||||||
UID: parentPanel.UID,
|
UID: parentPanel.UID,
|
||||||
})
|
})
|
||||||
require.ErrorIs(t, err, tc.libPanelParentErr)
|
require.ErrorIs(t, err, tc.libPanelParentErr)
|
||||||
if tc.depth > 1 {
|
if tc.depth > 1 {
|
||||||
_, err = lps.LibraryElementService.GetElement(context.Background(), &signedInUser, model.GetLibraryElementCommand{
|
_, err = lps.LibraryElementService.GetElement(context.Background(), &signedInUser, model.GetLibraryElementCommand{
|
||||||
FolderName: subfolder.Title,
|
FolderName: subfolder.Title,
|
||||||
FolderID: subfolder.ID,
|
FolderID: subfolder.ID, // nolint:staticcheck
|
||||||
UID: subPanel.UID,
|
UID: subPanel.UID,
|
||||||
})
|
})
|
||||||
require.ErrorIs(t, err, tc.libPanelSubErr)
|
require.ErrorIs(t, err, tc.libPanelSubErr)
|
||||||
|
@ -277,6 +277,7 @@ func (l *LibraryElementService) getLibraryElements(c context.Context, store db.D
|
|||||||
builder.Write(", ? as folder_name ", cmd.FolderName)
|
builder.Write(", ? as folder_name ", cmd.FolderName)
|
||||||
builder.Write(", '' as folder_uid ")
|
builder.Write(", '' as folder_uid ")
|
||||||
builder.Write(getFromLibraryElementDTOWithMeta(store.GetDialect()))
|
builder.Write(getFromLibraryElementDTOWithMeta(store.GetDialect()))
|
||||||
|
// nolint:staticcheck
|
||||||
writeParamSelectorSQL(&builder, append(params, Pair{"folder_id", cmd.FolderID})...)
|
writeParamSelectorSQL(&builder, append(params, Pair{"folder_id", cmd.FolderID})...)
|
||||||
builder.Write(" UNION ")
|
builder.Write(" UNION ")
|
||||||
builder.Write(selectLibraryElementDTOWithMeta)
|
builder.Write(selectLibraryElementDTOWithMeta)
|
||||||
|
@ -233,8 +233,9 @@ type PatchLibraryElementCommand struct {
|
|||||||
// GetLibraryElementCommand is the command for getting a library element.
|
// GetLibraryElementCommand is the command for getting a library element.
|
||||||
type GetLibraryElementCommand struct {
|
type GetLibraryElementCommand struct {
|
||||||
FolderName string
|
FolderName string
|
||||||
FolderID int64
|
// Deprecated: use FolderUID instead
|
||||||
UID string
|
FolderID int64
|
||||||
|
UID string
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchLibraryElementsQuery is the query used for searching for Elements
|
// SearchLibraryElementsQuery is the query used for searching for Elements
|
||||||
|
Loading…
Reference in New Issue
Block a user