Adapt dashboard schema to validate on some devenv dashboards (#37594)

* Remove null values from JSON

* Specify the color field

* Add note about openness of custom field's struct

* Update schemaVersion

* Specify thresholds

* Add panel id

* Add maxDataPoints and interval

* Add mappings, albeit very under-specified

* Allow empty string for timezone field

This is probably not a good idea - same as allowing nulls.

* Allow false for refresh - otherwise, string

* Make threshold value optional

* Make interval optional

* Fix broken and changed decls in ui models

* Add models.cue for timeseries panel

* Fixups for home dashboard

* Add timeShift, timeFrom

* Abstract out #Target, rejigger comments
This commit is contained in:
sam boyer
2021-08-09 12:49:58 -04:00
committed by GitHub
parent e1637f70bd
commit 6ae5db5608
4 changed files with 156 additions and 23 deletions

View File

@@ -0,0 +1,42 @@
// Copyright 2021 Grafana Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package grafanaschema
import (
ui "github.com/grafana/grafana/cue/ui:grafanaschema"
)
Family: {
lineages: [
[
{
PanelOptions: {
legend: ui.VizLegendOptions
tooltip: ui.VizTooltipOptions
}
PanelFieldConfig: {
ui.LineConfig
ui.FillConfig
ui.PointsConfig
ui.AxisConfig
drawStyle?: ui.DrawStyle
gradientMode?: ui.GraphGradientMode
hideFrom?: ui.HideSeriesConfig
}
}
]
]
migrations: []
}