SearchV2: Fix reading library panels (#92961)

* Fix reading of library panel field
* Add test to check reading of library panel field
This commit is contained in:
Arati R.
2024-09-05 13:42:15 +02:00
committed by GitHub
parent ebd17adecf
commit 47cd8288cd
4 changed files with 120 additions and 2 deletions
@@ -396,9 +396,13 @@ func readpanelInfo(iter *jsoniter.Iterator, lookup DatasourceLookup) panelInfo {
panel.PluginVersion = iter.ReadString() // since 7x (the saved version for the plugin model)
case "libraryPanel":
var v map[string]string
var v map[string]interface{}
iter.ReadVal(&v)
panel.LibraryPanel = v["uid"]
if uid, ok := v["uid"]; ok {
if u, isString := uid.(string); isString {
panel.LibraryPanel = u
}
}
case "datasource":
targets.addDatasource(iter)