kindsys: Adapt to new PanelCfg schema interface (#65297)

* kindsys: Adapt to new PanelCfg schema interface

* building locally

* Remove Panel prefix in cue files

* Regenerate

* Update imports

* fixup! Merge branch 'remove-panel-prefix' into sdboyer/redundant-panelcfg-prefixes

* Fix formatting

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
This commit is contained in:
sam boyer 2023-05-15 23:07:54 -04:00 committed by GitHub
parent 5a5860256f
commit 33fd83f7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
202 changed files with 618 additions and 617 deletions

View File

@ -13,11 +13,11 @@ title: AlertGroupsPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|----------------|---------|----------|---------|-------------------------------------------------------------|

View File

@ -13,11 +13,11 @@ title: AnnotationsListPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|-------------------------|----------|----------|---------|-------------|

View File

@ -13,12 +13,12 @@ title: BarChartPanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|------------------------|----------|---------|-------------|
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig
### FieldConfig
It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig).
@ -91,7 +91,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions
### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTextFormatting](#optionswithtextformatting).

View File

@ -13,11 +13,11 @@ title: BarGaugePanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -13,11 +13,11 @@ title: DashboardListPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|----------------------|----------|----------|---------|-------------|

View File

@ -13,11 +13,11 @@ title: DatagridPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|------------------|---------|----------|---------|-----------------------------------|

View File

@ -16,10 +16,10 @@ title: DebugPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|---------------------------------------------------------------------------|
| `DebugMode` | string | **Yes** | | Possible values are: `render`, `events`, `cursor`, `State`, `ThrowError`. |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
| `UpdateConfig` | [object](#updateconfig) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|------------|-------------------------------|----------|---------|---------------------------------------------------------------------------|

View File

@ -13,11 +13,11 @@ title: GaugePanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -18,7 +18,7 @@ title: GeomapPanelCfg kind
| `ControlsOptions` | [object](#controlsoptions) | **Yes** | | |
| `MapCenterID` | string | **Yes** | | Possible values are: `zero`, `coords`, `fit`. |
| `MapViewConfig` | [object](#mapviewconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
| `TooltipMode` | string | **Yes** | | Possible values are: `none`, `details`. |
| `TooltipOptions` | [object](#tooltipoptions) | **Yes** | | |
@ -49,7 +49,7 @@ title: GeomapPanelCfg kind
| `shared` | boolean | No | | |
| `zoom` | int64 | No | `1` | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------|

View File

@ -17,14 +17,14 @@ title: HeatmapPanelCfg kind
|-----------------------|--------------------------------|----------|---------|-------------------------------------------------------------------------------------------|
| `CellValues` | [object](#cellvalues) | **Yes** | | Controls cell value options |
| `ExemplarConfig` | [object](#exemplarconfig) | **Yes** | | Controls exemplar options |
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `FilterValueRange` | [object](#filtervaluerange) | **Yes** | | Controls the value filter range |
| `HeatmapColorMode` | string | **Yes** | | Controls the color mode of the heatmap<br/>Possible values are: `opacity`, `scheme`. |
| `HeatmapColorOptions` | [object](#heatmapcoloroptions) | **Yes** | | Controls various color options |
| `HeatmapColorScale` | string | **Yes** | | Controls the color scale of the heatmap<br/>Possible values are: `linear`, `exponential`. |
| `HeatmapLegend` | [object](#heatmaplegend) | **Yes** | | Controls legend options |
| `HeatmapTooltip` | [object](#heatmaptooltip) | **Yes** | | Controls tooltip options |
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
| `RowsHeatmapOptions` | [object](#rowsheatmapoptions) | **Yes** | | Controls frame rows options |
| `YAxisConfig` | [object](#yaxisconfig) | **Yes** | | Configuration options for the yAxis |
@ -45,6 +45,43 @@ Controls exemplar options
|----------|--------|----------|---------|----------------------------------------|
| `color` | string | **Yes** | | Sets the color of the exemplar markers |
### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig).
| Property | Type | Required | Default | Description |
|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*<br/>TODO docs |
| `scaleDistribution` | [ScaleDistributionConfig](#scaledistributionconfig) | No | | TODO docs |
### HideSeriesConfig
TODO docs
| Property | Type | Required | Default | Description |
|-----------|---------|----------|---------|-------------|
| `legend` | boolean | **Yes** | | |
| `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | |
### HideableFieldConfig
TODO docs
| Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### ScaleDistributionConfig
TODO docs
| Property | Type | Required | Default | Description |
|-------------------|--------|----------|---------|--------------------------------------------------------------------------|
| `type` | string | **Yes** | | TODO docs<br/>Possible values are: `linear`, `log`, `ordinal`, `symlog`. |
| `linearThreshold` | number | No | | |
| `log` | number | No | | |
### FilterValueRange
Controls the value filter range
@ -87,44 +124,7 @@ Controls tooltip options
| `show` | boolean | **Yes** | | Controls if the tooltip is shown |
| `yHistogram` | boolean | No | | Controls if the tooltip shows a histogram of the y-axis values |
### PanelFieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig).
| Property | Type | Required | Default | Description |
|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*<br/>TODO docs |
| `scaleDistribution` | [ScaleDistributionConfig](#scaledistributionconfig) | No | | TODO docs |
### HideSeriesConfig
TODO docs
| Property | Type | Required | Default | Description |
|-----------|---------|----------|---------|-------------|
| `legend` | boolean | **Yes** | | |
| `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | |
### HideableFieldConfig
TODO docs
| Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### ScaleDistributionConfig
TODO docs
| Property | Type | Required | Default | Description |
|-------------------|--------|----------|---------|--------------------------------------------------------------------------|
| `type` | string | **Yes** | | TODO docs<br/>Possible values are: `linear`, `log`, `ordinal`, `symlog`. |
| `linearThreshold` | number | No | | |
| `log` | number | No | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|----------------|---------------------------------------------------------|----------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

View File

@ -13,12 +13,12 @@ title: HistogramPanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|------------------------|----------|---------|-------------|
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig
### FieldConfig
It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig).
@ -82,7 +82,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions
### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip).

View File

@ -13,11 +13,11 @@ title: LogsPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|----------------------|---------|----------|---------|---------------------------------------------------------------|

View File

@ -13,11 +13,11 @@ title: NewsPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|-------------|---------|----------|---------|--------------------------------------------|

View File

@ -13,12 +13,12 @@ title: NodeGraphPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `ArcOption` | [object](#arcoption) | **Yes** | | |
| `EdgeOptions` | [object](#edgeoptions) | **Yes** | | |
| `NodeOptions` | [object](#nodeoptions) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|------------------------|----------|---------|-------------|
| `ArcOption` | [object](#arcoption) | **Yes** | | |
| `EdgeOptions` | [object](#edgeoptions) | **Yes** | | |
| `NodeOptions` | [object](#nodeoptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
### ArcOption
@ -42,7 +42,7 @@ title: NodeGraphPanelCfg kind
| `mainStatUnit` | string | No | | Unit for the main stat to override what ever is set in the data frame. |
| `secondaryStatUnit` | string | No | | Unit for the secondary stat to override what ever is set in the data frame. |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|----------|-----------------------------|----------|---------|-------------|

View File

@ -15,8 +15,8 @@ title: PieChartPanelCfg kind
| Property | Type | Required | Default | Description |
|-------------------------|---------------------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PanelFieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `FieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs |
| `Options` | [object](#options) | **Yes** | | |
| `PieChartLabels` | string | **Yes** | | Select labels to display on the pie chart.<br/> - Name - The series or field name.<br/> - Percent - The percentage of the whole.<br/> - Value - The raw numerical value.<br/>Possible values are: `name`, `value`, `percent`. |
| `PieChartLegendOptions` | [object](#piechartlegendoptions) | **Yes** | | |
| `PieChartLegendValues` | string | **Yes** | | Select values to display in the legend.<br/> - Percent: The percentage of the whole.<br/> - Value: The raw numerical value.<br/>Possible values are: `value`, `percent`. |
@ -40,7 +40,7 @@ TODO docs
| `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | |
### PanelOptions
### Options
It extends [OptionsWithTooltip](#optionswithtooltip) and [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -13,12 +13,12 @@ title: StateTimelinePanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|------------------------|----------|---------|-------------|
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig
### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig).
@ -46,7 +46,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions
### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones).

View File

@ -13,11 +13,11 @@ title: StatPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -13,12 +13,12 @@ title: StatusHistoryPanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|------------------------|----------|---------|-------------|
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig
### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig).
@ -46,7 +46,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions
### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones).

View File

@ -13,11 +13,11 @@ title: TablePanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `Options` | [object](#options) | **Yes** | | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|-----------------|---------------------------------------------------|----------|----------------------------------------------|--------------------------------------------------------------------|

View File

@ -13,12 +13,12 @@ title: TextPanelCfg kind
| Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------|
| `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. |
| `CodeOptions` | [object](#codeoptions) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. |
| Property | Type | Required | Default | Description |
|----------------|------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------|
| `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. |
| `CodeOptions` | [object](#codeoptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
| `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. |
### CodeOptions
@ -28,7 +28,7 @@ title: TextPanelCfg kind
| `showLineNumbers` | boolean | **Yes** | `false` | |
| `showMiniMap` | boolean | **Yes** | `false` | |
### PanelOptions
### Options
| Property | Type | Required | Default | Description |
|-----------|-----------------------------|----------|--------------------------------------------------------------------------------|--------------------------------------------------|

View File

@ -13,10 +13,10 @@ title: TimeSeriesPanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|---------------------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|---------------------------------------|----------|---------|-------------|
| `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `Options` | [object](#options) | **Yes** | | |
### GraphFieldConfig
@ -178,7 +178,7 @@ TODO docs
| `group` | string | No | | |
| `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. |
### PanelOptions
### Options
It extends [OptionsWithTimezones](#optionswithtimezones).

View File

@ -13,10 +13,10 @@ title: TrendPanelCfg kind
| Property | Type | Required | Default | Description |
|--------------------|---------------------------------------|----------|---------|----------------------------------------------------------------------|
| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | Identical to timeseries... except it does not have timezone settings |
| Property | Type | Required | Default | Description |
|---------------|---------------------------------------|----------|---------|----------------------------------------------------------------------|
| `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `Options` | [object](#options) | **Yes** | | Identical to timeseries... except it does not have timezone settings |
### GraphFieldConfig
@ -178,7 +178,7 @@ TODO docs
| `group` | string | No | | |
| `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. |
### PanelOptions
### Options
Identical to timeseries... except it does not have timezone settings

View File

@ -15,14 +15,14 @@ title: XYChartPanelCfg kind
| Property | Type | Required | Default | Description |
|-----------------------|--------------------------------|----------|---------|---------------------------------------------------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `Options` | [object](#options) | **Yes** | | |
| `ScatterFieldConfig` | [object](#scatterfieldconfig) | **Yes** | | |
| `ScatterSeriesConfig` | [object](#scatterseriesconfig) | **Yes** | | |
| `ScatterShow` | string | **Yes** | | Possible values are: `points`, `lines`, `points+lines`. |
| `SeriesMapping` | string | **Yes** | | Possible values are: `auto`, `manual`. |
| `XYDimensionConfig` | [object](#xydimensionconfig) | **Yes** | | |
### PanelOptions
### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip).

View File

@ -215,7 +215,7 @@ TODO docs
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [object](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `custom` | [object](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@ -339,7 +339,7 @@ TODO docs
### Custom
custom is specified by the PanelFieldConfig field
custom is specified by the FieldConfig field
in panel plugin schemas.
| Property | Type | Required | Default | Description |
@ -410,7 +410,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [object](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `options` | [object](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
@ -446,7 +446,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [custom](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `custom` | [custom](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@ -513,7 +513,7 @@ The datasource used in all targets.
### Options
options is specified by the PanelOptions field in panel
options is specified by the Options field in panel
plugin schemas.
| Property | Type | Required | Default | Description |
@ -567,7 +567,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [options](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `options` | [options](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
@ -663,7 +663,7 @@ TODO this appears to be spread all over in the frontend. Concepts will likely ne
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -74,7 +74,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -108,7 +108,7 @@ Typescript: Omit<Panel, 'gridPos' | 'id' | 'libraryPanel'>;
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -77,7 +77,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -81,7 +81,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

View File

@ -78,7 +78,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use |
| `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields

2
go.mod
View File

@ -264,7 +264,7 @@ require (
github.com/grafana/dataplane/examples v0.0.0-20230404174214-4d6fd58a18ad
github.com/grafana/dataplane/sdata v0.0.6
github.com/grafana/go-mssqldb v0.9.1
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a
github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b
github.com/grafana/thema v0.0.0-20230417103609-99b482c479fe
github.com/redis/go-redis/v9 v9.0.2
github.com/weaveworks/common v0.0.0-20230208133027-16871410fca4

6
go.sum
View File

@ -1062,8 +1062,14 @@ github.com/grafana/grafana-plugin-sdk-go v0.94.0/go.mod h1:3VXz4nCv6wH5SfgB3mlW3
github.com/grafana/grafana-plugin-sdk-go v0.114.0/go.mod h1:D7x3ah+1d4phNXpbnOaxa/osSaZlwh9/ZUnGGzegRbk=
github.com/grafana/grafana-plugin-sdk-go v0.160.0 h1:jELbsqee5kRz9vD1hZeP8+984xMZDU/M6uGv0RhOR34=
github.com/grafana/grafana-plugin-sdk-go v0.160.0/go.mod h1:dPhljkVno3Bg/ZYafMrR/BfYjtCRJD2hU2719Nl3QzM=
github.com/grafana/kindsys v0.0.0-20230323180930-c2a9ced5c751 h1:X5jwaMcpUMQ+xv7fKhs9U+oBxfo2x+x8GpHWybDSgk0=
github.com/grafana/kindsys v0.0.0-20230323180930-c2a9ced5c751/go.mod h1:213a3clTiegHfheYcLPLeEyHv/azK/fAF67OEbzuLzw=
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a h1:i2YhC6eTyDp+7Ftv5c6VZDUQskmKX4oIPGf38qfiZiU=
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/kindsys v0.0.0-20230508172648-19fc432f045a h1:L8Qph5iUyVnLGinQzPmtJYUtPDG4TyT6vGDFT9EdCTU=
github.com/grafana/kindsys v0.0.0-20230508172648-19fc432f045a/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b h1:x3gw5zsWZ2vxQ0GYucB2PFQ6eISAoWkba5MrQd8ZK0E=
github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413 h1:bBzCezZNRyYlJpXTkyZdY4fpPxHZUdyeyRWzhtw/P6I=
github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413/go.mod h1:IvwuGG9xa/h96UH/exgvsfy3zE+ZpctkNT9o5aaGdrU=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230508090422-7d5630522a53 h1:X3Jl4PBIGCtlPSMa6Uiu2+3FDNWmddSjivp+1DDznQs=

View File

@ -460,7 +460,7 @@ lineage: seqs: [
// Dynamically load the panel
libraryPanel?: #LibraryPanelRef
// options is specified by the PanelOptions field in panel
// options is specified by the Options field in panel
// plugin schemas.
options: {...} @grafanamaturity(NeedsExpertReview)
@ -541,7 +541,7 @@ lineage: seqs: [
// Alternative to empty string
noValue?: string @grafanamaturity(NeedsExpertReview)
// custom is specified by the PanelFieldConfig field
// custom is specified by the FieldConfig field
// in panel plugin schemas.
custom?: {...} @grafanamaturity(NeedsExpertReview)
} @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)

View File

@ -482,7 +482,7 @@ export interface Panel {
*/
maxDataPoints?: number;
/**
* options is specified by the PanelOptions field in panel
* options is specified by the Options field in panel
* plugin schemas.
*/
options: Record<string, unknown>;
@ -591,7 +591,7 @@ export interface FieldConfig {
*/
color?: FieldColor;
/**
* custom is specified by the PanelFieldConfig field
* custom is specified by the FieldConfig field
* in panel plugin schemas.
*/
custom?: Record<string, unknown>;

View File

@ -279,7 +279,7 @@ type FieldConfig struct {
// TODO docs
Color *FieldColor `json:"color,omitempty"`
// custom is specified by the PanelFieldConfig field
// custom is specified by the FieldConfig field
// in panel plugin schemas.
Custom map[string]interface{} `json:"custom,omitempty"`
@ -422,7 +422,7 @@ type Panel struct {
// TODO docs
MaxDataPoints *float32 `json:"maxDataPoints,omitempty"`
// options is specified by the PanelOptions field in panel
// options is specified by the Options field in panel
// plugin schemas.
Options map[string]interface{} `json:"options"`

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status.
type Status struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"`
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -14,7 +14,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
foo: string
} @cuetsy(kind="interface")
},

View File

@ -6,7 +6,7 @@ composableKinds: PanelCfg: lineage: {
{
schemas: [
{
PanelOptions: {
Options: {
foo: string
} @cuetsy(kind="interface")
},

View File

@ -5,18 +5,18 @@ import "github.com/grafana/thema"
composableKinds: PanelCfg: {
lineage: {
joinSchema: {
PanelOptions: {...}
PanelFieldConfig: string
Options: {...}
FieldConfig: string
}
name: "panel_conflicting_joinschema"
seqs: [
{
schemas: [
{
PanelOptions: {
Options: {
foo: string
} @cuetsy(kind="interface")
PanelFieldConfig: string
FieldConfig: string
},
]
},

View File

@ -9,10 +9,10 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
foo: string
} @cuetsy(kind="interface")
PanelFieldConfig: string
FieldConfig: string
},
]
},

View File

@ -5,7 +5,7 @@ composableKinds: PanelCfg: lineage: {
{
schemas: [
{
PanelOptions: {
Options: {
foo: string
} @cuetsy(kind="interface")
},

View File

@ -6,8 +6,8 @@ import { VisibilityMode, TimelineValueAlignment } from '@grafana/schema';
import { FIXED_UNIT } from '@grafana/ui/src/components/GraphNG/GraphNG';
import { distribute, SPACE_BETWEEN } from 'app/plugins/panel/barchart/distribute';
import { pointWithin, Quadtree, Rect } from 'app/plugins/panel/barchart/quadtree';
import { PanelFieldConfig as StateTimeLineFieldConfig } from 'app/plugins/panel/state-timeline/panelcfg.gen';
import { PanelFieldConfig as StatusHistoryFieldConfig } from 'app/plugins/panel/status-history/panelcfg.gen';
import { FieldConfig as StateTimeLineFieldConfig } from 'app/plugins/panel/state-timeline/panelcfg.gen';
import { FieldConfig as StatusHistoryFieldConfig } from 'app/plugins/panel/status-history/panelcfg.gen';
import { TimelineMode } from './utils';

View File

@ -4,7 +4,7 @@ import { RefreshEvent } from '@grafana/runtime';
import { PanelChrome } from '@grafana/ui';
import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';
import { PanelRenderer } from 'app/features/panel/components/PanelRenderer';
import { PanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
import { Options } from 'app/plugins/panel/table/panelcfg.gen';
import PanelHeaderCorner from '../../dashgrid/PanelHeader/PanelHeaderCorner';
import { getTimeSrv } from '../../services/TimeSrv';
@ -21,7 +21,7 @@ export interface Props {
export function PanelEditorTableView({ width, height, panel, dashboard }: Props) {
const { data } = usePanelLatestData(panel, { withTransforms: true, withFieldConfig: false }, false);
const [options, setOptions] = useState<PanelOptions>({
const [options, setOptions] = useState<Options>({
frameIndex: 0,
showHeader: true,
showTypeIcons: true,

View File

@ -38,7 +38,7 @@ import {
} from '@grafana/ui';
import { GraphFieldConfig } from 'app/plugins/panel/graph/types';
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
import { ExploreGraphStyle } from 'app/types';
import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory';

View File

@ -1,8 +1,8 @@
import { VizPanel, VizPanelState } from '@grafana/scenes';
import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema';
import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen';
import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
import { Options as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen';
import { Options as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
export type TypedVizPanelState<TOptions, TFieldConfig> = Omit<
Partial<VizPanelState<TOptions, TFieldConfig>>,

View File

@ -19,7 +19,7 @@ import { DashboardModel } from 'app/features/dashboard/state';
import { configureStore } from 'app/store/configureStore';
import { AlertGroupsPanel } from './AlertGroupsPanel';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
jest.mock('app/features/alerting/unified/api/alertmanager');
@ -46,13 +46,13 @@ const dataSources = {
}),
};
const defaultOptions: PanelOptions = {
const defaultOptions: Options = {
labels: '',
alertmanager: 'Alertmanager',
expandAll: false,
};
const defaultProps: PanelProps<PanelOptions> = {
const defaultProps: PanelProps<Options> = {
data: { state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() },
id: 1,
timeRange: getDefaultTimeRange(),
@ -79,7 +79,7 @@ const defaultProps: PanelProps<PanelOptions> = {
width: 320,
};
const renderPanel = (options: PanelOptions = defaultOptions) => {
const renderPanel = (options: Options = defaultOptions) => {
const store = configureStore();
const dash = new DashboardModel({ id: 1 } as Dashboard);
dash.formatDate = (time: number) => new Date(time).toISOString();

View File

@ -12,10 +12,10 @@ import { AlertmanagerGroup, Matcher } from 'app/plugins/datasource/alertmanager/
import { useDispatch } from 'app/types';
import { AlertGroup } from './AlertGroup';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
import { useFilteredGroups } from './useFilteredGroups';
export const AlertGroupsPanel = (props: PanelProps<PanelOptions>) => {
export const AlertGroupsPanel = (props: PanelProps<Options>) => {
const dispatch = useDispatch();
const isAlertingEnabled = config.unifiedAlertingEnabled;

View File

@ -8,9 +8,9 @@ import {
} from 'app/features/alerting/unified/utils/datasource';
import { AlertGroupsPanel } from './AlertGroupsPanel';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(AlertGroupsPanel).setPanelOptions((builder) => {
export const plugin = new PanelPlugin<Options>(AlertGroupsPanel).setPanelOptions((builder) => {
return builder
.addCustomEditor({
name: 'Alertmanager',

View File

@ -20,7 +20,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
// Comma-separated list of values used to filter alert results
labels: string
// Name of the alertmanager used as a source for alerts

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions {
export interface Options {
/**
* Name of the alertmanager used as a source for alerts
*/

View File

@ -10,14 +10,14 @@ import { backendSrv } from '../../../core/services/backend_srv';
import { setDashboardSrv } from '../../../features/dashboard/services/DashboardSrv';
import { AnnoListPanel, Props } from './AnnoListPanel';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
jest.mock('@grafana/runtime', () => ({
...jest.requireActual('@grafana/runtime'),
getBackendSrv: () => backendSrv,
}));
const defaultOptions: PanelOptions = {
const defaultOptions: Options = {
limit: 10,
navigateAfter: '10m',
navigateBefore: '10m',
@ -49,7 +49,7 @@ const defaultResult: any = {
async function setupTestContext({
options = defaultOptions,
results = [defaultResult],
}: { options?: PanelOptions; results?: AnnotationEvent[] } = {}) {
}: { options?: Options; results?: AnnotationEvent[] } = {}) {
jest.clearAllMocks();
const getMock = jest.spyOn(backendSrv, 'get');

View File

@ -19,7 +19,7 @@ import appEvents from 'app/core/app_events';
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
import { AnnotationListItem } from './AnnotationListItem';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
interface UserInfo {
id?: number;
@ -27,7 +27,7 @@ interface UserInfo {
email?: string;
}
export interface Props extends PanelProps<PanelOptions> {}
export interface Props extends PanelProps<Options> {}
interface State {
annotations: AnnotationEvent[];
timeInfo: string;

View File

@ -4,9 +4,9 @@ import React, { MouseEvent } from 'react';
import { AnnotationEvent, DateTimeInput, GrafanaTheme2, PanelProps } from '@grafana/data';
import { Card, TagList, Tooltip, RenderUserContentAsHTML, useStyles2 } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
interface Props extends Pick<PanelProps<PanelOptions>, 'options'> {
interface Props extends Pick<PanelProps<Options>, 'options'> {
annotation: AnnotationEvent;
formatDate: (date: DateTimeInput, format?: string) => string;
onClick: (annotation: AnnotationEvent) => void;

View File

@ -4,16 +4,16 @@ import { PanelModel, PanelPlugin } from '@grafana/data';
import { TagsInput } from '@grafana/ui';
import { AnnoListPanel } from './AnnoListPanel';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen';
import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
export const plugin = new PanelPlugin<Options>(AnnoListPanel)
.setPanelOptions((builder) => {
builder
.addRadio({
category: ['Annotation query'],
path: 'onlyFromThisDashboard',
name: 'Query filter',
defaultValue: defaultPanelOptions.onlyFromThisDashboard,
defaultValue: defaultOptions.onlyFromThisDashboard,
settings: {
options: [
{ value: false, label: 'All dashboards' },
@ -25,7 +25,7 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Annotation query'],
path: 'onlyInTimeRange',
name: 'Time range',
defaultValue: defaultPanelOptions.onlyInTimeRange,
defaultValue: defaultOptions.onlyInTimeRange,
settings: {
options: [
{ value: false, label: 'None' },
@ -47,31 +47,31 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Annotation query'],
path: 'limit',
name: 'Limit',
defaultValue: defaultPanelOptions.limit,
defaultValue: defaultOptions.limit,
})
.addBooleanSwitch({
category: ['Display'],
path: 'showUser',
name: 'Show user',
defaultValue: defaultPanelOptions.showUser,
defaultValue: defaultOptions.showUser,
})
.addBooleanSwitch({
category: ['Display'],
path: 'showTime',
name: 'Show time',
defaultValue: defaultPanelOptions.showTime,
defaultValue: defaultOptions.showTime,
})
.addBooleanSwitch({
category: ['Display'],
path: 'showTags',
name: 'Show tags',
defaultValue: defaultPanelOptions.showTags,
defaultValue: defaultOptions.showTags,
})
.addRadio({
category: ['Link behavior'],
path: 'navigateToPanel',
name: 'Link target',
defaultValue: defaultPanelOptions.navigateToPanel,
defaultValue: defaultOptions.navigateToPanel,
settings: {
options: [
{ value: true, label: 'Panel' },
@ -83,21 +83,21 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Link behavior'],
path: 'navigateBefore',
name: 'Time before',
defaultValue: defaultPanelOptions.navigateBefore,
defaultValue: defaultOptions.navigateBefore,
description: '',
})
.addTextInput({
category: ['Link behavior'],
path: 'navigateAfter',
name: 'Time after',
defaultValue: defaultPanelOptions.navigateAfter,
defaultValue: defaultOptions.navigateAfter,
description: '',
});
})
// TODO, we should support this directly in the plugin infrastructure
.setPanelChangeHandler((panel: PanelModel<PanelOptions>, prevPluginId: string, prevOptions: unknown) => {
.setPanelChangeHandler((panel: PanelModel<Options>, prevPluginId: string, prevOptions: unknown) => {
if (prevPluginId === 'ryantxu-annolist-panel') {
return prevOptions as PanelOptions;
return prevOptions as Options;
}
return panel.options;

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
onlyFromThisDashboard: bool | *false
onlyInTimeRange: bool | *false
tags: [...string]

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions {
export interface Options {
limit: number;
navigateAfter: string;
navigateBefore: string;
@ -23,7 +23,7 @@ export interface PanelOptions {
tags: Array<string>;
}
export const defaultPanelOptions: Partial<PanelOptions> = {
export const defaultOptions: Partial<Options> = {
limit: 10,
navigateAfter: '10m',
navigateBefore: '10m',

View File

@ -38,7 +38,7 @@ import { getFieldLegendItem } from 'app/core/components/TimelineChart/utils';
import { DataHoverView } from '../geomap/components/DataHoverView';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
import { prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils';
const TOOLTIP_OFFSET = 10;
@ -47,7 +47,7 @@ const TOOLTIP_OFFSET = 10;
* @alpha
*/
export interface BarChartProps
extends PanelOptions,
extends Options,
Omit<GraphNGProps, 'prepConfig' | 'propsToDiff' | 'renderLegend' | 'theme'> {}
const propsToDiff: Array<string | PropDiffFn> = [
@ -66,7 +66,7 @@ const propsToDiff: Array<string | PropDiffFn> = [
(prev: BarChartProps, next: BarChartProps) => next.text?.valueSize === prev.text?.valueSize,
];
interface Props extends PanelProps<PanelOptions> {}
interface Props extends PanelProps<Options> {}
export const BarChartPanel = ({ data, options, fieldConfig, width, height, timeZone, id }: Props) => {
const theme = useTheme2();

View File

@ -16,11 +16,11 @@ import { ThresholdsStyleEditor } from '../timeseries/ThresholdsStyleEditor';
import { BarChartPanel } from './BarChartPanel';
import { TickSpacingEditor } from './TickSpacingEditor';
import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig, defaultPanelOptions } from './panelcfg.gen';
import { FieldConfig, Options, defaultFieldConfig, defaultOptions } from './panelcfg.gen';
import { BarChartSuggestionsSupplier } from './suggestions';
import { prepareBarChartDisplayValues } from './utils';
export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPanel)
export const plugin = new PanelPlugin<Options, FieldConfig>(BarChartPanel)
.useFieldConfig({
standardOptions: {
[FieldConfigProperty.Color]: {
@ -34,7 +34,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
},
},
useCustomConfig: (builder) => {
const cfg = defaultPanelFieldConfig;
const cfg = defaultFieldConfig;
builder
.addSliderInput({
@ -108,7 +108,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
},
})
.setPanelOptions((builder, context) => {
const disp = prepareBarChartDisplayValues(context.data, config.theme2, context.options ?? ({} as PanelOptions));
const disp = prepareBarChartDisplayValues(context.data, config.theme2, context.options ?? ({} as Options));
let xaxisPlaceholder = 'First string or time field';
const viz = 'viz' in disp ? disp.viz[0] : undefined;
if (viz?.fields?.length) {
@ -134,12 +134,12 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
{ value: VizOrientation.Vertical, label: 'Vertical' },
],
},
defaultValue: defaultPanelOptions.orientation,
defaultValue: defaultOptions.orientation,
})
.addSliderInput({
path: 'xTickLabelRotation',
name: 'Rotate x-axis tick labels',
defaultValue: defaultPanelOptions.xTickLabelRotation,
defaultValue: defaultOptions.xTickLabelRotation,
settings: {
min: -90,
max: 90,
@ -162,7 +162,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
id: 'xTickLabelSpacing',
path: 'xTickLabelSpacing',
name: 'X-axis labels minimum spacing',
defaultValue: defaultPanelOptions.xTickLabelSpacing,
defaultValue: defaultOptions.xTickLabelSpacing,
editor: TickSpacingEditor,
})
.addRadio({
@ -175,7 +175,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
{ value: VisibilityMode.Never, label: 'Never' },
],
},
defaultValue: defaultPanelOptions.showValue,
defaultValue: defaultOptions.showValue,
})
.addRadio({
path: 'stacking',
@ -183,12 +183,12 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
settings: {
options: graphFieldOptions.stacking,
},
defaultValue: defaultPanelOptions.stacking,
defaultValue: defaultOptions.stacking,
})
.addSliderInput({
path: 'groupWidth',
name: 'Group width',
defaultValue: defaultPanelOptions.groupWidth,
defaultValue: defaultOptions.groupWidth,
settings: {
min: 0,
max: 1,
@ -204,7 +204,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addSliderInput({
path: 'barWidth',
name: 'Bar width',
defaultValue: defaultPanelOptions.barWidth,
defaultValue: defaultOptions.barWidth,
settings: {
min: 0,
max: 1,
@ -214,7 +214,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addSliderInput({
path: 'barRadius',
name: 'Bar radius',
defaultValue: defaultPanelOptions.barRadius,
defaultValue: defaultOptions.barRadius,
settings: {
min: 0,
max: 0.5,
@ -224,7 +224,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addBooleanSwitch({
path: 'fullHighlight',
name: 'Highlight full area on hover',
defaultValue: defaultPanelOptions.fullHighlight,
defaultValue: defaultOptions.fullHighlight,
});
builder.addFieldNamePicker({

View File

@ -27,7 +27,7 @@ composableKinds: PanelCfg: {
schemas: [
// v0.0
{
PanelOptions: {
Options: {
common.OptionsWithLegend
common.OptionsWithTooltip
common.OptionsWithTextFormatting
@ -59,7 +59,7 @@ composableKinds: PanelCfg: {
// hovers over highlighted area
fullHighlight: bool | *false
} @cuetsy(kind="interface")
PanelFieldConfig: {
FieldConfig: {
common.AxisConfig
common.HideableFieldConfig

View File

@ -12,7 +12,7 @@ import * as common from '@grafana/schema';
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting {
export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting {
/**
* Controls the radius of each bar.
*/
@ -65,7 +65,7 @@ export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWi
xTickLabelSpacing?: number;
}
export const defaultPanelOptions: Partial<PanelOptions> = {
export const defaultOptions: Partial<Options> = {
barRadius: 0,
barWidth: 0.97,
fullHighlight: false,
@ -77,7 +77,7 @@ export const defaultPanelOptions: Partial<PanelOptions> = {
xTickLabelSpacing: 0,
};
export interface PanelFieldConfig extends common.AxisConfig, common.HideableFieldConfig {
export interface FieldConfig extends common.AxisConfig, common.HideableFieldConfig {
/**
* Controls the fill opacity of the bars.
*/
@ -97,7 +97,7 @@ export interface PanelFieldConfig extends common.AxisConfig, common.HideableFiel
thresholdsStyle?: common.GraphThresholdsStyleConfig;
}
export const defaultPanelFieldConfig: Partial<PanelFieldConfig> = {
export const defaultFieldConfig: Partial<FieldConfig> = {
fillOpacity: 80,
gradientMode: common.GraphGradientMode.None,
lineWidth: 1,

View File

@ -2,11 +2,11 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data';
import { LegendDisplayMode, StackingMode, VisibilityMode } from '@grafana/schema';
import { SuggestionName } from 'app/types/suggestions';
import { PanelFieldConfig, PanelOptions } from './panelcfg.gen';
import { FieldConfig, Options } from './panelcfg.gen';
export class BarChartSuggestionsSupplier {
getListWithDefaults(builder: VisualizationSuggestionsBuilder) {
return builder.getListAppender<PanelOptions, PanelFieldConfig>({
return builder.getListAppender<Options, FieldConfig>({
name: SuggestionName.BarChart,
pluginId: 'barchart',
options: {

View File

@ -19,7 +19,7 @@ import {
SortOrder,
} from '@grafana/schema';
import { PanelFieldConfig, PanelOptions } from './panelcfg.gen';
import { FieldConfig as PanelFieldConfig, Options } from './panelcfg.gen';
import { BarChartOptionsEX, prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils';
function mockDataFrame() {
@ -69,7 +69,7 @@ function mockDataFrame() {
state: {},
});
const info = prepareBarChartDisplayValues([df1], createTheme(), {} as PanelOptions);
const info = prepareBarChartDisplayValues([df1], createTheme(), {} as Options);
if (!('aligned' in info)) {
throw new Error('Bar chart not prepared correctly');
@ -159,7 +159,7 @@ describe('BarChart utils', () => {
describe('prepareGraphableFrames', () => {
it('will warn when there is no data in the response', () => {
const result = prepareBarChartDisplayValues([], createTheme(), { stacking: StackingMode.None } as PanelOptions);
const result = prepareBarChartDisplayValues([], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('No data in response');
@ -172,7 +172,7 @@ describe('BarChart utils', () => {
{ name: 'value', values: [1, 2, 3, 4, 5] },
],
});
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions);
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('Bar charts requires a string or time field');
expect(warning).not.toHaveProperty('viz');
@ -185,7 +185,7 @@ describe('BarChart utils', () => {
{ name: 'value', type: FieldType.boolean, values: [true, true, true, true, true] },
],
});
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions);
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('No numeric fields found');
expect(warning).not.toHaveProperty('viz');
@ -198,7 +198,7 @@ describe('BarChart utils', () => {
{ name: 'value', values: [-10, NaN, 10, -Infinity, +Infinity] },
],
});
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions);
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const displayValues = assertIsDefined('viz' in result ? result : null);
const field = displayValues.viz[0].fields[1];
@ -238,7 +238,7 @@ describe('BarChart utils', () => {
const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), {
legend: { sortBy: 'Min', sortDesc: false },
} as PanelOptions);
} as Options);
const displayValuesAsc = assertIsDefined('viz' in resultAsc ? resultAsc : null).viz[0];
expect(displayValuesAsc.fields[0].type).toBe(FieldType.string);
expect(displayValuesAsc.fields[1].name).toBe('a');
@ -253,7 +253,7 @@ describe('BarChart utils', () => {
const resultDesc = prepareBarChartDisplayValues([frame], createTheme(), {
legend: { sortBy: 'Min', sortDesc: true },
} as PanelOptions);
} as Options);
const displayValuesDesc = assertIsDefined('viz' in resultDesc ? resultDesc : null).viz[0];
expect(displayValuesDesc.fields[0].type).toBe(FieldType.string);
expect(displayValuesDesc.fields[1].name).toBe('b');
@ -279,7 +279,7 @@ describe('BarChart utils', () => {
const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), {
stacking: StackingMode.Percent,
} as PanelOptions);
} as Options);
const displayLegendValuesAsc = assertIsDefined('legend' in resultAsc ? resultAsc : null).legend;
expect(displayLegendValuesAsc.fields[1].config.unit).toBeUndefined();

View File

@ -31,7 +31,7 @@ import { getStackingGroups } from '@grafana/ui/src/components/uPlot/utils';
import { findField } from 'app/features/dimensions';
import { BarsOptions, getConfig } from './bars';
import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig } from './panelcfg.gen';
import { FieldConfig, Options, defaultFieldConfig } from './panelcfg.gen';
import { BarChartDisplayValues, BarChartDisplayWarning } from './types';
function getBarCharScaleOrientation(orientation: VizOrientation) {
@ -52,7 +52,7 @@ function getBarCharScaleOrientation(orientation: VizOrientation) {
};
}
export interface BarChartOptionsEX extends PanelOptions {
export interface BarChartOptionsEX extends Options {
rawValue: (seriesIdx: number, valueIdx: number) => number | null;
getColor?: (seriesIdx: number, valueIdx: number, value: unknown) => string | null;
timeZone?: TimeZone;
@ -185,7 +185,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<BarChartOptionsEX> = ({
seriesIndex++;
const customConfig: PanelFieldConfig = { ...defaultPanelFieldConfig, ...field.config.custom };
const customConfig: FieldConfig = { ...defaultFieldConfig, ...field.config.custom };
const scaleKey = field.config.unit || FIXED_UNIT;
const colorMode = getFieldColorModeForField(field);
@ -358,7 +358,7 @@ function getRotationPadding(
export function prepareBarChartDisplayValues(
series: DataFrame[],
theme: GrafanaTheme2,
options: PanelOptions
options: Options
): BarChartDisplayValues | BarChartDisplayWarning {
if (!series?.length) {
return { warn: 'No data in response' };

View File

@ -1,8 +1,8 @@
import { PanelModel } from '@grafana/data';
import { sharedSingleStatMigrationHandler } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
export const barGaugePanelMigrationHandler = (panel: PanelModel<PanelOptions>): Partial<PanelOptions> => {
export const barGaugePanelMigrationHandler = (panel: PanelModel<Options>): Partial<Options> => {
return sharedSingleStatMigrationHandler(panel);
};

View File

@ -16,7 +16,7 @@ import { BarGauge, DataLinksContextMenu, VizRepeater, VizRepeaterRenderValueProp
import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu';
import { config } from 'app/core/config';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
export class BarGaugePanel extends PureComponent<BarGaugePanelProps> {
renderComponent = (
@ -110,7 +110,7 @@ export class BarGaugePanel extends PureComponent<BarGaugePanelProps> {
);
}
}
export type BarGaugePanelProps = PanelProps<PanelOptions>;
export type BarGaugePanelProps = PanelProps<Options>;
export function clearNameForSingleSeries(count: number, field: FieldConfig, display: DisplayValue): DisplayValue {
if (count === 1 && !field.displayName) {

View File

@ -6,10 +6,10 @@ import { addOrientationOption, addStandardDataReduceOptions } from '../stat/comm
import { barGaugePanelMigrationHandler } from './BarGaugeMigrations';
import { BarGaugePanel } from './BarGaugePanel';
import { PanelOptions, defaultPanelOptions } from './panelcfg.gen';
import { Options, defaultOptions } from './panelcfg.gen';
import { BarGaugeSuggestionsSupplier } from './suggestions';
export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel)
export const plugin = new PanelPlugin<Options>(BarGaugePanel)
.useFieldConfig()
.setPanelOptions((builder) => {
addStandardDataReduceOptions(builder);
@ -27,7 +27,7 @@ export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel)
{ value: BarGaugeDisplayMode.Basic, label: 'Basic' },
],
},
defaultValue: defaultPanelOptions.displayMode,
defaultValue: defaultOptions.displayMode,
})
.addRadio({
path: 'valueMode',
@ -39,27 +39,27 @@ export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel)
{ value: BarGaugeValueMode.Hidden, label: 'Hidden' },
],
},
defaultValue: defaultPanelOptions.valueMode,
defaultValue: defaultOptions.valueMode,
})
.addBooleanSwitch({
path: 'showUnfilled',
name: 'Show unfilled area',
description: 'When enabled renders the unfilled region as gray',
defaultValue: defaultPanelOptions.showUnfilled,
defaultValue: defaultOptions.showUnfilled,
showIf: (options) => options.displayMode !== 'lcd',
})
.addNumberInput({
path: 'minVizWidth',
name: 'Min width',
description: 'Minimum column width',
defaultValue: defaultPanelOptions.minVizWidth,
defaultValue: defaultOptions.minVizWidth,
showIf: (options) => options.orientation === VizOrientation.Vertical,
})
.addNumberInput({
path: 'minVizHeight',
name: 'Min height',
description: 'Minimum row height',
defaultValue: defaultPanelOptions.minVizHeight,
defaultValue: defaultOptions.minVizHeight,
showIf: (options) => options.orientation === VizOrientation.Horizontal,
});
})

View File

@ -26,7 +26,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
common.SingleStatBaseOptions
displayMode: common.BarGaugeDisplayMode & (*"gradient" | _)
valueMode: common.BarGaugeValueMode & (*"color" | _)

View File

@ -12,7 +12,7 @@ import * as common from '@grafana/schema';
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions extends common.SingleStatBaseOptions {
export interface Options extends common.SingleStatBaseOptions {
displayMode: common.BarGaugeDisplayMode;
minVizHeight: number;
minVizWidth: number;
@ -20,7 +20,7 @@ export interface PanelOptions extends common.SingleStatBaseOptions {
valueMode: common.BarGaugeValueMode;
}
export const defaultPanelOptions: Partial<PanelOptions> = {
export const defaultOptions: Partial<Options> = {
displayMode: common.BarGaugeDisplayMode.Gradient,
minVizHeight: 10,
minVizWidth: 0,

View File

@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data';
import { BarGaugeDisplayMode } from '@grafana/ui';
import { SuggestionName } from 'app/types/suggestions';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
export class BarGaugeSuggestionsSupplier {
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
@ -12,7 +12,7 @@ export class BarGaugeSuggestionsSupplier {
return;
}
const list = builder.getListAppender<PanelOptions, {}>({
const list = builder.getListAppender<Options, {}>({
name: '',
pluginId: 'bargauge',
options: {},

View File

@ -58,7 +58,7 @@ export interface CandlestickOptions extends OptionsWithLegend {
includeAllFields?: boolean;
}
export const defaultPanelOptions: CandlestickOptions = {
export const defaultOptions: CandlestickOptions = {
mode: VizDisplayMode.CandlesVolume,
candleStyle: CandleStyle.Candles,
colorStrategy: ColorStrategy.OpenClose,

View File

@ -19,7 +19,7 @@ import {
CandlestickOptions,
VizDisplayMode,
ColorStrategy,
defaultPanelOptions,
defaultOptions,
CandleStyle,
} from './models.gen';
import { CandlestickSuggestionsSupplier } from './suggestions';
@ -77,7 +77,7 @@ function addFieldPicker(
export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(CandlestickPanel)
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
.setPanelOptions((builder, context) => {
const opts = context.options ?? defaultPanelOptions;
const opts = context.options ?? defaultOptions;
const info = prepareCandlestickFields(context.data, opts, config.theme2);
builder
@ -85,7 +85,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'mode',
name: 'Mode',
description: '',
defaultValue: defaultPanelOptions.mode,
defaultValue: defaultOptions.mode,
settings: {
options: modeOptions,
},
@ -94,7 +94,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'candleStyle',
name: 'Candle style',
description: '',
defaultValue: defaultPanelOptions.candleStyle,
defaultValue: defaultOptions.candleStyle,
settings: {
options: candleStyles,
},
@ -104,7 +104,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'colorStrategy',
name: 'Color strategy',
description: '',
defaultValue: defaultPanelOptions.colorStrategy,
defaultValue: defaultOptions.colorStrategy,
settings: {
options: colorStrategies,
},
@ -135,7 +135,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'includeAllFields',
name: 'Additional fields',
description: 'Use standard timeseries options to configure any fields not mapped above',
defaultValue: defaultPanelOptions.includeAllFields,
defaultValue: defaultOptions.includeAllFields,
settings: {
options: [
{ label: 'Ignore', value: false },

View File

@ -20,11 +20,11 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
// anything for now
...
} @cuetsy(kind="interface")
PanelFieldConfig: {
FieldConfig: {
// anything for now
...
} @cuetsy(kind="interface")

View File

@ -3,7 +3,7 @@ import { config } from '@grafana/runtime';
import { SuggestionName } from 'app/types/suggestions';
import { prepareCandlestickFields } from './fields';
import { CandlestickOptions, defaultPanelOptions } from './models.gen';
import { CandlestickOptions, defaultOptions } from './models.gen';
export class CandlestickSuggestionsSupplier {
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
@ -19,7 +19,7 @@ export class CandlestickSuggestionsSupplier {
return;
}
const info = prepareCandlestickFields(builder.data.series, defaultPanelOptions, config.theme2);
const info = prepareCandlestickFields(builder.data.series, defaultOptions, config.theme2);
if (!info) {
return;
}
@ -43,7 +43,7 @@ export class CandlestickSuggestionsSupplier {
list.append({
name: SuggestionName.Candlestick,
options: defaultPanelOptions,
options: defaultOptions,
fieldConfig: {
defaults: {},
overrides: [],

View File

@ -11,10 +11,10 @@ import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events';
import { InlineEdit } from './InlineEdit';
import { SetBackground } from './SetBackground';
import { PanelOptions } from './models.gen';
import { Options } from './models.gen';
import { AnchorPoint, CanvasTooltipPayload, ConnectionState } from './types';
interface Props extends PanelProps<PanelOptions> {}
interface Props extends PanelProps<Options> {}
interface State {
refresh: number;

View File

@ -7,7 +7,7 @@ import { Field, HorizontalGroup, Icon, InlineField, InlineFieldRow, Select, Vert
import { NumberInput } from 'app/core/components/OptionsUI/NumberInput';
import { HorizontalConstraint, Placement, VerticalConstraint } from 'app/features/canvas';
import { PanelOptions } from '../models.gen';
import { Options } from '../models.gen';
import { ConstraintSelectionBox } from './ConstraintSelectionBox';
import { QuickPositioning } from './QuickPositioning';
@ -31,7 +31,7 @@ const verticalOptions: Array<SelectableValue<VerticalConstraint>> = [
{ label: 'Scale', value: VerticalConstraint.Scale },
];
type Props = StandardEditorProps<any, CanvasEditorOptions, PanelOptions>;
type Props = StandardEditorProps<any, CanvasEditorOptions, Options>;
export function PlacementEditor({ item }: Props) {
const settings = item.settings;

View File

@ -10,7 +10,7 @@ import { ElementState } from 'app/features/canvas/runtime/element';
import { AddLayerButton } from '../../../../core/components/Layers/AddLayerButton';
import { getGlobalStyles } from '../globalStyles';
import { PanelOptions } from '../models.gen';
import { Options } from '../models.gen';
import { getTreeData, onNodeDrop, TreeElement } from '../tree';
import { DragNode, DropNode } from '../types';
import { doSelect, getElementTypes, onAddItem } from '../utils';
@ -20,7 +20,7 @@ import { TreeViewEditorProps } from './elementEditor';
let allowSelection = true;
export const TreeNavigationEditor = ({ item }: StandardEditorProps<any, TreeViewEditorProps, PanelOptions>) => {
export const TreeNavigationEditor = ({ item }: StandardEditorProps<any, TreeViewEditorProps, Options>) => {
const [treeData, setTreeData] = useState(getTreeData(item?.settings?.scene.root));
const [autoExpandParent, setAutoExpandParent] = useState(true);
const [expandedKeys, setExpandedKeys] = useState<Key[]>([]);

View File

@ -1,8 +1,8 @@
import { PanelModel } from '@grafana/data';
import { PanelOptions } from './models.gen';
import { Options } from './models.gen';
export const canvasMigrationHandler = (panel: PanelModel): Partial<PanelOptions> => {
export const canvasMigrationHandler = (panel: PanelModel): Partial<Options> => {
const pluginVersion = panel?.pluginVersion ?? '';
// Rename text-box to rectangle

View File

@ -7,13 +7,13 @@ import { CanvasFrameOptions, DEFAULT_CANVAS_ELEMENT_CONFIG } from 'app/features/
export const modelVersion = Object.freeze([1, 0]);
export interface PanelOptions {
export interface Options {
inlineEditing: boolean;
showAdvancedTypes: boolean;
root: CanvasFrameOptions;
}
export const defaultPanelOptions: PanelOptions = {
export const defaultOptions: Options = {
inlineEditing: true,
showAdvancedTypes: false,
root: {

View File

@ -6,9 +6,9 @@ import { getConnectionEditor } from './editor/connectionEditor';
import { getElementEditor } from './editor/elementEditor';
import { getLayerEditor } from './editor/layerEditor';
import { canvasMigrationHandler } from './migrations';
import { PanelOptions } from './models.gen';
import { Options } from './models.gen';
export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder<PanelOptions>) => {
export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder<Options>) => {
builder.addBooleanSwitch({
path: 'inlineEditing',
name: 'Inline editing',
@ -24,7 +24,7 @@ export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilde
});
};
export const plugin = new PanelPlugin<PanelOptions>(CanvasPanel)
export const plugin = new PanelPlugin<Options>(CanvasPanel)
.setNoPadding() // extend to panel edges
.useFieldConfig({
standardOptions: {

View File

@ -20,7 +20,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
// anything for now
...
} @cuetsy(kind="interface")

View File

@ -24,7 +24,7 @@ import { DashboardSearchItem } from 'app/features/search/types';
import { getVariablesUrlParams } from 'app/features/variables/getAllVariableValuesForUrl';
import { useDispatch } from 'app/types';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
import { getStyles } from './styles';
type Dashboard = DashboardSearchItem & { id?: number; isSearchResult?: boolean; isRecent?: boolean };
@ -35,7 +35,7 @@ interface DashboardGroup {
dashboards: Dashboard[];
}
async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFunction) {
async function fetchDashboards(options: Options, replaceVars: InterpolateFunction) {
let starredDashboards: Promise<DashboardSearchItem[]> = Promise.resolve([]);
if (options.showStarred) {
const params = { limit: options.maxItems, starred: 'true' };
@ -99,7 +99,7 @@ async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFu
return dashMap;
}
export function DashList(props: PanelProps<PanelOptions>) {
export function DashList(props: PanelProps<Options>) {
const [dashboards, setDashboards] = useState(new Map<string, Dashboard>());
const dispatch = useDispatch();
useEffect(() => {

View File

@ -10,50 +10,50 @@ import {
} from '../../../core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker';
import { DashList } from './DashList';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen';
import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DashList)
export const plugin = new PanelPlugin<Options>(DashList)
.setPanelOptions((builder) => {
builder
.addBooleanSwitch({
path: 'keepTime',
name: 'Include current time range',
defaultValue: defaultPanelOptions.keepTime,
defaultValue: defaultOptions.keepTime,
})
.addBooleanSwitch({
path: 'includeVars',
name: 'Include current template variable values',
defaultValue: defaultPanelOptions.includeVars,
defaultValue: defaultOptions.includeVars,
})
.addBooleanSwitch({
path: 'showStarred',
name: 'Starred',
defaultValue: defaultPanelOptions.showStarred,
defaultValue: defaultOptions.showStarred,
})
.addBooleanSwitch({
path: 'showRecentlyViewed',
name: 'Recently viewed',
defaultValue: defaultPanelOptions.showRecentlyViewed,
defaultValue: defaultOptions.showRecentlyViewed,
})
.addBooleanSwitch({
path: 'showSearch',
name: 'Search',
defaultValue: defaultPanelOptions.showSearch,
defaultValue: defaultOptions.showSearch,
})
.addBooleanSwitch({
path: 'showHeadings',
name: 'Show headings',
defaultValue: defaultPanelOptions.showHeadings,
defaultValue: defaultOptions.showHeadings,
})
.addNumberInput({
path: 'maxItems',
name: 'Max items',
defaultValue: defaultPanelOptions.maxItems,
defaultValue: defaultOptions.maxItems,
})
.addTextInput({
path: 'query',
name: 'Query',
defaultValue: defaultPanelOptions.query,
defaultValue: defaultOptions.query,
})
.addCustomEditor({
path: 'folderId',
@ -75,13 +75,13 @@ export const plugin = new PanelPlugin<PanelOptions>(DashList)
path: 'tags',
name: 'Tags',
description: '',
defaultValue: defaultPanelOptions.tags,
defaultValue: defaultOptions.tags,
editor(props) {
return <TagsInput tags={props.value} onChange={props.onChange} />;
},
});
})
.setMigrationHandler((panel: PanelModel<PanelOptions> & Record<string, any>) => {
.setMigrationHandler((panel: PanelModel<Options> & Record<string, any>) => {
const newOptions = {
showStarred: panel.options.showStarred ?? panel.starred,
showRecentlyViewed: panel.options.showRecentlyViewed ?? panel.recent,

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
keepTime: bool | *false
includeVars: bool | *false
showStarred: bool | *true

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions {
export interface Options {
folderId?: number;
includeVars: boolean;
keepTime: boolean;
@ -23,7 +23,7 @@ export interface PanelOptions {
tags: Array<string>;
}
export const defaultPanelOptions: Partial<PanelOptions> = {
export const defaultOptions: Partial<Options> = {
includeVars: false,
keepTime: false,
maxItems: 10,

View File

@ -20,7 +20,7 @@ import { AddColumn } from './components/AddColumn';
import { DatagridContextMenu } from './components/DatagridContextMenu';
import { RenameColumnCell } from './components/RenameColumnCell';
import { isDatagridEnabled } from './featureFlagUtils';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
import { DatagridActionType, datagridReducer, initialState } from './state';
import {
clearCellsFromRangeSelection,
@ -37,7 +37,7 @@ import {
updateSnapshot,
} from './utils';
export interface DataGridProps extends PanelProps<PanelOptions> {}
export interface DataGridProps extends PanelProps<Options> {}
export function DataGridPanel({ options, data, id, fieldConfig, width, height }: DataGridProps) {
const [state, dispatch] = useReducer(datagridReducer, initialState);

View File

@ -1,22 +1,22 @@
import { PanelPlugin } from '@grafana/data';
import { DataGridPanel } from './DataGridPanel';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen';
import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DataGridPanel).setPanelOptions((builder, context) => {
export const plugin = new PanelPlugin<Options>(DataGridPanel).setPanelOptions((builder, context) => {
const seriesOptions = context.data.map((frame, idx) => ({ value: idx, label: frame.refId }));
if (
context.options &&
!seriesOptions.map((s: { value: number }) => s.value).includes(context.options.selectedSeries ?? 0)
) {
context.options.selectedSeries = defaultPanelOptions.selectedSeries!;
context.options.selectedSeries = defaultOptions.selectedSeries!;
}
return builder.addSelect({
path: 'selectedSeries',
name: 'Select series',
defaultValue: defaultPanelOptions.selectedSeries,
defaultValue: defaultOptions.selectedSeries,
settings: {
options: seriesOptions,
},

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{
schemas: [
{
PanelOptions: {
Options: {
selectedSeries: int32 & >=0 | *0
} @cuetsy(kind="interface")
},

View File

@ -10,10 +10,10 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions {
export interface Options {
selectedSeries: number;
}
export const defaultPanelOptions: Partial<PanelOptions> = {
export const defaultOptions: Partial<Options> = {
selectedSeries: 0,
};

View File

@ -6,9 +6,9 @@ import { CursorView } from './CursorView';
import { EventBusLoggerPanel } from './EventBusLogger';
import { RenderInfoViewer } from './RenderInfoViewer';
import { StateView } from './StateView';
import { PanelOptions, DebugMode } from './panelcfg.gen';
import { Options, DebugMode } from './panelcfg.gen';
type Props = PanelProps<PanelOptions>;
type Props = PanelProps<Options>;
export class DebugPanel extends Component<Props> {
render() {

View File

@ -11,9 +11,9 @@ import {
} from '@grafana/data';
import { IconButton } from '@grafana/ui';
import { PanelOptions, UpdateConfig } from './panelcfg.gen';
import { Options, UpdateConfig } from './panelcfg.gen';
type Props = PanelProps<PanelOptions>;
type Props = PanelProps<Options>;
type UpdateCounters = {
[K in keyof UpdateConfig]: number;

View File

@ -3,9 +3,9 @@ import React, { FormEvent } from 'react';
import { PanelOptionsEditorProps, PanelProps } from '@grafana/data';
import { Field, Input, usePanelContext } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen';
import { Options } from './panelcfg.gen';
export function StateView(props: PanelProps<PanelOptions>) {
export function StateView(props: PanelProps<Options>) {
const context = usePanelContext();
const onChangeName = (e: FormEvent<HTMLInputElement>) => {

View File

@ -2,9 +2,9 @@ import { PanelPlugin } from '@grafana/data';
import { DebugPanel } from './DebugPanel';
import { StateViewEditor } from './StateView';
import { DebugMode, PanelOptions } from './panelcfg.gen';
import { DebugMode, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DebugPanel).useFieldConfig().setPanelOptions((builder) => {
export const plugin = new PanelPlugin<Options>(DebugPanel).useFieldConfig().setPanelOptions((builder) => {
builder
.addSelect({
path: 'mode',

Some files were not shown because too many files have changed in this diff Show More