GroupByVariable: Add support for default values in schema (#105518)
* update schema * update schema * refactor property to singular naming * bump scenes * leave scenes to caret version * add defaultValue to groupBy model * typo
This commit is contained in:
@@ -874,6 +874,7 @@ CustomVariableKind: {
|
|||||||
GroupByVariableSpec: {
|
GroupByVariableSpec: {
|
||||||
name: string | *""
|
name: string | *""
|
||||||
datasource?: DataSourceRef
|
datasource?: DataSourceRef
|
||||||
|
defaultValue?: VariableOption
|
||||||
current: VariableOption | *{
|
current: VariableOption | *{
|
||||||
text: ""
|
text: ""
|
||||||
value: ""
|
value: ""
|
||||||
|
|||||||
@@ -878,6 +878,7 @@ CustomVariableKind: {
|
|||||||
GroupByVariableSpec: {
|
GroupByVariableSpec: {
|
||||||
name: string | *""
|
name: string | *""
|
||||||
datasource?: DataSourceRef
|
datasource?: DataSourceRef
|
||||||
|
defaultValue?: VariableOption
|
||||||
current: VariableOption | *{
|
current: VariableOption | *{
|
||||||
text: ""
|
text: ""
|
||||||
value: ""
|
value: ""
|
||||||
|
|||||||
@@ -1601,15 +1601,16 @@ func NewDashboardGroupByVariableKind() *DashboardGroupByVariableKind {
|
|||||||
// GroupBy variable specification
|
// GroupBy variable specification
|
||||||
// +k8s:openapi-gen=true
|
// +k8s:openapi-gen=true
|
||||||
type DashboardGroupByVariableSpec struct {
|
type DashboardGroupByVariableSpec struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Datasource *DashboardDataSourceRef `json:"datasource,omitempty"`
|
Datasource *DashboardDataSourceRef `json:"datasource,omitempty"`
|
||||||
Current DashboardVariableOption `json:"current"`
|
DefaultValue *DashboardVariableOption `json:"defaultValue,omitempty"`
|
||||||
Options []DashboardVariableOption `json:"options"`
|
Current DashboardVariableOption `json:"current"`
|
||||||
Multi bool `json:"multi"`
|
Options []DashboardVariableOption `json:"options"`
|
||||||
Label *string `json:"label,omitempty"`
|
Multi bool `json:"multi"`
|
||||||
Hide DashboardVariableHide `json:"hide"`
|
Label *string `json:"label,omitempty"`
|
||||||
SkipUrlSync bool `json:"skipUrlSync"`
|
Hide DashboardVariableHide `json:"hide"`
|
||||||
Description *string `json:"description,omitempty"`
|
SkipUrlSync bool `json:"skipUrlSync"`
|
||||||
|
Description *string `json:"description,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDashboardGroupByVariableSpec creates a new DashboardGroupByVariableSpec object.
|
// NewDashboardGroupByVariableSpec creates a new DashboardGroupByVariableSpec object.
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export interface GroupByVariableModel extends VariableWithOptions {
|
|||||||
datasource: DataSourceRef | null;
|
datasource: DataSourceRef | null;
|
||||||
multi: true;
|
multi: true;
|
||||||
allowCustomValue?: boolean;
|
allowCustomValue?: boolean;
|
||||||
|
defaultValue?: VariableOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VariableOption {
|
export interface VariableOption {
|
||||||
|
|||||||
@@ -1290,6 +1290,7 @@ export const defaultGroupByVariableKind = (): GroupByVariableKind => ({
|
|||||||
export interface GroupByVariableSpec {
|
export interface GroupByVariableSpec {
|
||||||
name: string;
|
name: string;
|
||||||
datasource?: DataSourceRef;
|
datasource?: DataSourceRef;
|
||||||
|
defaultValue?: VariableOption;
|
||||||
current: VariableOption;
|
current: VariableOption;
|
||||||
options: VariableOption[];
|
options: VariableOption[];
|
||||||
multi: boolean;
|
multi: boolean;
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode
|
|||||||
hide: variable.hide,
|
hide: variable.hide,
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
defaultOptions: variable.options,
|
defaultOptions: variable.options,
|
||||||
|
defaultValue: variable.defaultValue,
|
||||||
allowCustomValue: variable.allowCustomValue,
|
allowCustomValue: variable.allowCustomValue,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3490,10 +3490,10 @@ __metadata:
|
|||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@grafana/scenes-react@npm:^6.12.0":
|
"@grafana/scenes-react@npm:^6.12.0":
|
||||||
version: 6.12.0
|
version: 6.13.0
|
||||||
resolution: "@grafana/scenes-react@npm:6.12.0"
|
resolution: "@grafana/scenes-react@npm:6.13.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@grafana/scenes": "npm:6.12.0"
|
"@grafana/scenes": "npm:6.13.0"
|
||||||
lru-cache: "npm:^10.2.2"
|
lru-cache: "npm:^10.2.2"
|
||||||
react-use: "npm:^17.4.0"
|
react-use: "npm:^17.4.0"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -3505,13 +3505,13 @@ __metadata:
|
|||||||
react: ^18.0.0
|
react: ^18.0.0
|
||||||
react-dom: ^18.0.0
|
react-dom: ^18.0.0
|
||||||
react-router-dom: ^6.28.0
|
react-router-dom: ^6.28.0
|
||||||
checksum: 10/56113394d169c96537a46ca5dc4c62eda54c6addd348c9e3321a122a6d01c19a14c57b04945ee3d836638f3dc1c1941f7647fa649495226432664e0ff8bd0af0
|
checksum: 10/8bbb098770d3b24fd60f4caa88579cd2e2327131061c7f54c25aa86688b4f4b7326d112515fe8ff3d62134af37af757d12d023c76dfaa68836f034e38f02da6d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@grafana/scenes@npm:6.12.0, @grafana/scenes@npm:^6.12.0":
|
"@grafana/scenes@npm:6.13.0, @grafana/scenes@npm:^6.12.0":
|
||||||
version: 6.12.0
|
version: 6.13.0
|
||||||
resolution: "@grafana/scenes@npm:6.12.0"
|
resolution: "@grafana/scenes@npm:6.13.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@floating-ui/react": "npm:^0.26.16"
|
"@floating-ui/react": "npm:^0.26.16"
|
||||||
"@leeoniya/ufuzzy": "npm:^1.0.16"
|
"@leeoniya/ufuzzy": "npm:^1.0.16"
|
||||||
@@ -3529,7 +3529,7 @@ __metadata:
|
|||||||
react: ^18.0.0
|
react: ^18.0.0
|
||||||
react-dom: ^18.0.0
|
react-dom: ^18.0.0
|
||||||
react-router-dom: ^6.28.0
|
react-router-dom: ^6.28.0
|
||||||
checksum: 10/1bcddada8bf626d552aaa29ae4f916a50968bb36761285b0517500f50d8f52314148a8ed73419f381f8e5b901308cdf2450f0b82754691af512a2cff9f52b6bb
|
checksum: 10/62247045c095ac951c83059816214407e2fcf3736a61b536323616cdce08cd77a99b6a3532a1dbbe4f50ca26c94094a82e1713df84c37b0a7c0bebcf164b0b26
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user