Search: Search dashboards without a parent (#100615)

* Search dashboards without a parent
pull/100704/head
Karl Persson 4 months ago committed by GitHub
parent 12bb50f97f
commit d8b26b0a31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      pkg/services/dashboards/service/dashboard_service.go

@ -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),

Loading…
Cancel
Save