Fix the disjuction of panels (#39412)

[As code] Correct trim apply defaults when import/export dashboards
This commit is contained in:
ying-jeanne
2021-10-06 11:39:23 +02:00
committed by GitHub
parent ccd6a2eae3
commit 227c8403b5
25 changed files with 27834 additions and 131 deletions
+2 -2
View File
@@ -73,11 +73,11 @@ func (rs *SchemaLoaderService) DashboardTrimDefaults(input simplejson.Json) (sim
val = removeNils(val)
data, _ := json.Marshal(val)
dsSchema, err := schema.SearchAndValidate(rs.DashFamily, data)
dsSchema, err := schema.SearchAndValidate(rs.DashFamily, string(data))
if err != nil {
return input, err
}
// spew.Dump(dsSchema)
result, err := schema.TrimDefaults(schema.Resource{Value: data}, dsSchema.CUE())
if err != nil {
return input, err