Library Panels: Remove dashboards table dependency when getting all library panels (#99160)

* Remove dashboards table dependency when getting all library panels
* Filter library elements a user can see using the folder service
* Stop using folder name as UID in get all elements tests
* Set actual folder name not UID when getting all elements
* Stop selecting folder name in the get all elements sql query
* Introduce a library elements param selector without where clause
* Include empty string as general folder UID when getting all library elements

---------

Co-authored-by: suntala <arati.rana@grafana.com>
This commit is contained in:
Leonor Oliveira
2025-01-27 10:51:41 +01:00
committed by GitHub
parent 25bb210ca3
commit 0003efa285
7 changed files with 73 additions and 37 deletions

View File

@ -67,7 +67,7 @@ func TestPatchLibraryElement(t *testing.T) {
Version: 2,
Meta: model.LibraryElementDTOMeta{
FolderName: "NewFolder",
FolderUID: "NewFolder",
FolderUID: "uid_for_NewFolder",
ConnectedDashboards: 0,
Created: sc.initialResult.Result.Meta.Created,
Updated: result.Result.Meta.Updated,
@ -111,7 +111,7 @@ func TestPatchLibraryElement(t *testing.T) {
sc.initialResult.Result.Meta.Updated = result.Result.Meta.Updated
sc.initialResult.Result.Version = 2
sc.initialResult.Result.Meta.FolderName = "NewFolder"
sc.initialResult.Result.Meta.FolderUID = "NewFolder"
sc.initialResult.Result.Meta.FolderUID = "uid_for_NewFolder"
if diff := cmp.Diff(sc.initialResult.Result, result.Result, getCompareOptions()...); diff != "" {
t.Fatalf("Result mismatch (-want +got):\n%s", diff)
}