NestedFolders: Add library panels counting and deletion to folder registry (#69149)

* Expose library element service's folder service
* Register library panels, add count implementation
* Expand folder counts test
* Update registry deletion method interface
* Allow getting library elements from any folder
* Add test for library panel deletion
* Add test for library panel counting
This commit is contained in:
Arati R
2023-07-25 13:05:53 +02:00
committed by GitHub
parent 32e2304f10
commit 20ffbbc41e
16 changed files with 305 additions and 182 deletions
+6 -1
View File
@@ -112,7 +112,12 @@ func (l *LibraryElementService) deleteHandler(c *contextmodel.ReqContext) respon
// 404: notFoundError
// 500: internalServerError
func (l *LibraryElementService) getHandler(c *contextmodel.ReqContext) response.Response {
element, err := l.getLibraryElementByUid(c.Req.Context(), c.SignedInUser, web.Params(c.Req)[":uid"])
element, err := l.getLibraryElementByUid(c.Req.Context(), c.SignedInUser,
model.GetLibraryElementCommand{
UID: web.Params(c.Req)[":uid"],
FolderName: dashboards.RootFolderName,
},
)
if err != nil {
return toLibraryElementError(err, "Failed to get library element")
}