mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: Search dashboards without a parent (#100615)
* Search dashboards without a parent
This commit is contained in:
@@ -1690,6 +1690,16 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex
|
||||
}
|
||||
|
||||
if len(query.FolderUIDs) > 0 {
|
||||
// Grafana frontend issues a call to search for dashboards in "general" folder. General folder doesn't exists and
|
||||
// should return all dashboards without a parent folder.
|
||||
// We do something similar in the old sql search query https://github.com/grafana/grafana/blob/a58564a35efe8c05a21d8190b283af5bc0979d2a/pkg/services/sqlstore/searchstore/filters.go#L103
|
||||
for i := range query.FolderUIDs {
|
||||
if query.FolderUIDs[i] == folder.GeneralFolderUID {
|
||||
query.FolderUIDs[i] = ""
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
req := []*resource.Requirement{{
|
||||
Key: resource.SEARCH_FIELD_FOLDER,
|
||||
Operator: string(selection.In),
|
||||
|
||||
Reference in New Issue
Block a user