mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LibraryElements: export GetAllElements to service (#93782)
This commit is contained in:
parent
87c81825b7
commit
40bcd0df41
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user