Transforms: Fix schema definition (#62619)

This commit is contained in:
Ryan McKinley
2023-01-31 18:03:08 +00:00
committed by GitHub
parent 91221bc436
commit 4186871390
9 changed files with 58 additions and 64 deletions
+16 -11
View File
@@ -334,6 +334,20 @@ type DataSourceRef struct {
Uid *string `json:"uid,omitempty"`
}
// TODO docs
type DataTransformerConfig struct {
// Disabled transformations are skipped
Disabled *bool `json:"disabled,omitempty"`
Filter *MatcherConfig `json:"filter,omitempty"`
// Unique identifier of transformer
Id string `json:"id"`
// Options to be passed to the transformer
// Valid options depend on the transformer id
Options interface{} `json:"options"`
}
// DynamicConfigValue defines model for DynamicConfigValue.
type DynamicConfigValue struct {
Id string `json:"id"`
@@ -545,8 +559,8 @@ type Panel struct {
TimeShift *string `json:"timeShift,omitempty"`
// Panel title.
Title *string `json:"title,omitempty"`
Transformations []Transformation `json:"transformations"`
Title *string `json:"title,omitempty"`
Transformations []DataTransformerConfig `json:"transformations"`
// Whether to display the panel without a background.
Transparent bool `json:"transparent"`
@@ -707,15 +721,6 @@ type ThresholdsConfig struct {
// ThresholdsMode defines model for ThresholdsMode.
type ThresholdsMode string
// TODO docs
// FIXME this is extremely underspecfied; wasn't obvious which typescript types corresponded to it
type Transformation struct {
Filter *MatcherConfig `json:"filter,omitempty"`
Hide bool `json:"hide"`
Id string `json:"id"`
Options map[string]interface{} `json:"options"`
}
// TODO docs
type ValueMap struct {
Options map[string]ValueMappingResult `json:"options"`