diff --git a/pkg/api/dashboard_test.go b/pkg/api/dashboard_test.go index 2ad87a053c6..7f3b8dce121 100644 --- a/pkg/api/dashboard_test.go +++ b/pkg/api/dashboard_test.go @@ -1081,3 +1081,8 @@ func (l *mockLibraryElementService) DisconnectElementsFromDashboard(c context.Co func (l *mockLibraryElementService) DeleteLibraryElementsInFolder(c context.Context, signedInUser identity.Requester, folderUID string) error { return nil } + +// GetAll gets all library elements with support to query filters. +func (l *mockLibraryElementService) GetAllElements(c context.Context, signedInUser identity.Requester, query model.SearchLibraryElementsQuery) (model.LibraryElementSearchResult, error) { + return model.LibraryElementSearchResult{}, nil +} diff --git a/pkg/services/libraryelements/libraryelements.go b/pkg/services/libraryelements/libraryelements.go index 6108e585ef0..02fb5f0ad73 100644 --- a/pkg/services/libraryelements/libraryelements.go +++ b/pkg/services/libraryelements/libraryelements.go @@ -40,6 +40,7 @@ type Service interface { ConnectElementsToDashboard(c context.Context, signedInUser identity.Requester, elementUIDs []string, dashboardID int64) error DisconnectElementsFromDashboard(c context.Context, dashboardID int64) error DeleteLibraryElementsInFolder(c context.Context, signedInUser identity.Requester, folderUID string) error + GetAllElements(c context.Context, signedInUser identity.Requester, query model.SearchLibraryElementsQuery) (model.LibraryElementSearchResult, error) } // LibraryElementService is the service for the Library Element feature. @@ -85,6 +86,11 @@ func (l *LibraryElementService) DeleteLibraryElementsInFolder(c context.Context, return l.deleteLibraryElementsInFolderUID(c, signedInUser, folderUID) } +// GetAll gets all library elements with support to query filters. +func (l *LibraryElementService) GetAllElements(c context.Context, signedInUser identity.Requester, query model.SearchLibraryElementsQuery) (model.LibraryElementSearchResult, error) { + return l.getAllLibraryElements(c, signedInUser, query) +} + func (l *LibraryElementService) addUidToLibraryPanel(model []byte, newUid string) (json.RawMessage, error) { var modelMap map[string]any err := json.Unmarshal(model, &modelMap)