mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 06:22:13 +08:00
Schema: Add origin property to AdHocFilterWithLabels (#104320)
* add origin to AdHocFilterWithLabels * typo * fix * use singular for FilterOrigin * run ./hack/update-codegen.sh * add canary scenes to verify typechecks * update dashboard schema json snapshot * fix * fix * update canaries * fix * bump scenes version
This commit is contained in:
@ -704,6 +704,10 @@ VariableRefresh: *"never" | "onDashboardLoad" | "onTimeRangeChanged"
|
||||
// Accepted values are `dontHide` (show label and value), `hideLabel` (show value only), `hideVariable` (show nothing).
|
||||
VariableHide: *"dontHide" | "hideLabel" | "hideVariable"
|
||||
|
||||
// Determine the origin of the adhoc variable filter
|
||||
// Accepted values are `dashboard` (filter originated from dashboard), or `scope` (filter originated from scope).
|
||||
FilterOrigin: "dashboard" | "scope"
|
||||
|
||||
// FIXME: should we introduce this? --- Variable value option
|
||||
VariableValueOption: {
|
||||
label: string
|
||||
@ -915,6 +919,7 @@ AdHocFilterWithLabels: {
|
||||
keyLabel?: string
|
||||
valueLabels?: [...string]
|
||||
forceEdit?: bool
|
||||
origin?: FilterOrigin
|
||||
// @deprecated
|
||||
condition?: string
|
||||
}
|
||||
|
@ -294,6 +294,8 @@ var _ resource.ListObject = &DashboardList{}
|
||||
|
||||
// Copy methods for all subresource types
|
||||
|
||||
|
||||
|
||||
// DeepCopy creates a full deep copy of DashboardStatus
|
||||
func (s *DashboardStatus) DeepCopy() *DashboardStatus {
|
||||
cpy := &DashboardStatus{}
|
||||
|
@ -294,6 +294,8 @@ var _ resource.ListObject = &DashboardList{}
|
||||
|
||||
// Copy methods for all subresource types
|
||||
|
||||
|
||||
|
||||
// DeepCopy creates a full deep copy of DashboardStatus
|
||||
func (s *DashboardStatus) DeepCopy() *DashboardStatus {
|
||||
cpy := &DashboardStatus{}
|
||||
|
@ -708,6 +708,10 @@ VariableRefresh: *"never" | "onDashboardLoad" | "onTimeRangeChanged"
|
||||
// Accepted values are `dontHide` (show label and value), `hideLabel` (show value only), `hideVariable` (show nothing).
|
||||
VariableHide: *"dontHide" | "hideLabel" | "hideVariable"
|
||||
|
||||
// Determine the origin of the adhoc variable filter
|
||||
// Accepted values are `dashboard` (filter originated from dashboard), or `scope` (filter originated from scope).
|
||||
FilterOrigin: "dashboard" | "scope"
|
||||
|
||||
// FIXME: should we introduce this? --- Variable value option
|
||||
VariableValueOption: {
|
||||
label: string
|
||||
@ -919,6 +923,7 @@ AdHocFilterWithLabels: {
|
||||
keyLabel?: string
|
||||
valueLabels?: [...string]
|
||||
forceEdit?: bool
|
||||
origin?: FilterOrigin
|
||||
// @deprecated
|
||||
condition?: string
|
||||
}
|
||||
|
@ -1665,13 +1665,14 @@ func NewDashboardAdhocVariableSpec() *DashboardAdhocVariableSpec {
|
||||
// Define the AdHocFilterWithLabels type
|
||||
// +k8s:openapi-gen=true
|
||||
type DashboardAdHocFilterWithLabels struct {
|
||||
Key string `json:"key"`
|
||||
Operator string `json:"operator"`
|
||||
Value string `json:"value"`
|
||||
Values []string `json:"values,omitempty"`
|
||||
KeyLabel *string `json:"keyLabel,omitempty"`
|
||||
ValueLabels []string `json:"valueLabels,omitempty"`
|
||||
ForceEdit *bool `json:"forceEdit,omitempty"`
|
||||
Key string `json:"key"`
|
||||
Operator string `json:"operator"`
|
||||
Value string `json:"value"`
|
||||
Values []string `json:"values,omitempty"`
|
||||
KeyLabel *string `json:"keyLabel,omitempty"`
|
||||
ValueLabels []string `json:"valueLabels,omitempty"`
|
||||
ForceEdit *bool `json:"forceEdit,omitempty"`
|
||||
Origin *DashboardFilterOrigin `json:"origin,omitempty"`
|
||||
// @deprecated
|
||||
Condition *string `json:"condition,omitempty"`
|
||||
}
|
||||
@ -1681,6 +1682,16 @@ func NewDashboardAdHocFilterWithLabels() *DashboardAdHocFilterWithLabels {
|
||||
return &DashboardAdHocFilterWithLabels{}
|
||||
}
|
||||
|
||||
// Determine the origin of the adhoc variable filter
|
||||
// Accepted values are `dashboard` (filter originated from dashboard), or `scope` (filter originated from scope).
|
||||
// +k8s:openapi-gen=true
|
||||
type DashboardFilterOrigin string
|
||||
|
||||
const (
|
||||
DashboardFilterOriginDashboard DashboardFilterOrigin = "dashboard"
|
||||
DashboardFilterOriginScope DashboardFilterOrigin = "scope"
|
||||
)
|
||||
|
||||
// Define the MetricFindValue type
|
||||
// +k8s:openapi-gen=true
|
||||
type DashboardMetricFindValue struct {
|
||||
|
@ -380,6 +380,12 @@ func schema_pkg_apis_dashboard_v2alpha1_DashboardAdHocFilterWithLabels(ref commo
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"origin": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"condition": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "@deprecated",
|
||||
|
@ -11,6 +11,8 @@ import (
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
)
|
||||
|
||||
var ()
|
||||
|
||||
var appManifestData = app.ManifestData{
|
||||
AppName: "dashboard",
|
||||
Group: "dashboard.grafana.app",
|
||||
|
Reference in New Issue
Block a user