Commit d3c5b084 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '220392-custom-variable-syntax' into 'master'

Add schema for metrics dashboard custom templating variable

Closes #220392

See merge request gitlab-org/gitlab!34415
parents 13bb4008 bf1518f1
......@@ -13,6 +13,17 @@ templating:
options:
default_value: 'default'
text_variable_simple_syntax: 'default value'
custom_variable_simple_syntax: ['value1', 'value2', 'value3']
custom_variable_full_syntax:
label: 'Variable 2'
type: custom
options:
values:
- value: 'value option 1'
text: 'Option 1'
- value: 'value_option_2'
text: 'Option 2'
default: true
panel_groups:
- group: Group A
priority: 1
......
{
"type": "object",
"required": [
"type", "options"
],
"properties": {
"type": { "enum": ["custom"] },
"label": { "type": "string" },
"options": { "$ref": "custom_variable_options.json" }
},
"additionalProperties": false
}
{
"type": "object",
"required": ["values"],
"properties": {
"values": {
"type": "array",
"items": { "$ref": "custom_variable_values.json" }
}
},
"additionalProperties": false
}
{
"type": "object",
"required": ["value"],
"properties": {
"value": { "type": "string" },
"text": { "type": "string" },
"default": { "type": "boolean" }
},
"additionalProperties": false
}
......@@ -4,7 +4,7 @@
"type", "options"
],
"properties": {
"type": { "type": "string" },
"type": { "enum": ["text"] },
"label": { "type": "string" },
"options": { "$ref": "text_variable_options.json" }
},
......
......@@ -4,7 +4,12 @@
"^[a-zA-Z0-9_]*$": {
"anyOf": [
{ "$ref": "text_variable_full_syntax.json" },
{ "type": "string" }
{ "type": "string" },
{
"type": "array",
"items": { "type": "string" }
},
{ "$ref": "custom_variable_full_syntax.json" }
]
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment