+ >
+ {cascadeText}
+
{measurement && (
diff --git a/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx b/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx
index dbfe00a9417..7dd39f0d008 100644
--- a/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx
+++ b/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx
@@ -151,12 +151,12 @@ export class LokiQueryFieldForm extends React.PureComponent isVisible && onLabelsRefresh && onLabelsRefresh()}
- />
+ >
+ {chooserText}
+
{
expect(groupMetricsByPrefix(['foo_metric'])).toMatchObject([
{
value: 'foo',
- items: [
+ children: [
{
value: 'foo_metric',
},
@@ -22,7 +22,7 @@ describe('groupMetricsByPrefix()', () => {
expect(groupMetricsByPrefix(['foo_metric'], { foo_metric: [{ type: 'TYPE', help: 'my help' }] })).toMatchObject([
{
value: 'foo',
- items: [
+ children: [
{
value: 'foo_metric',
title: 'foo_metric\nTYPE\nmy help',
@@ -44,7 +44,7 @@ describe('groupMetricsByPrefix()', () => {
expect(groupMetricsByPrefix([':foo_metric:'])).toMatchObject([
{
value: RECORDING_RULES_GROUP,
- items: [
+ children: [
{
value: ':foo_metric:',
},
diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
index 4184bcc3cb6..4287a032bf6 100644
--- a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
+++ b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
@@ -52,7 +52,7 @@ export function groupMetricsByPrefix(metrics: string[], metadata?: PromMetricsMe
const rulesOption = {
label: 'Recording rules',
value: RECORDING_RULES_GROUP,
- items: ruleNames
+ children: ruleNames
.slice()
.sort()
.map(name => ({ label: name, value: name })),
@@ -69,7 +69,7 @@ export function groupMetricsByPrefix(metrics: string[], metadata?: PromMetricsMe
const prefixIsMetric = metricsForPrefix.length === 1 && metricsForPrefix[0] === prefix;
const children = prefixIsMetric ? [] : metricsForPrefix.sort().map(m => addMetricsMetadata(m, metadata));
return {
- items: children,
+ children,
label: prefix,
value: prefix,
};
@@ -198,7 +198,7 @@ class PromQueryField extends React.PureComponent {
let query;
if (selectedOptions.length === 1) {
- if (selectedOptions[0].items.length === 0) {
+ if (selectedOptions[0].children.length === 0) {
query = selectedOptions[0].value;
} else {
// Ignore click on group
@@ -254,7 +254,10 @@ class PromQueryField extends React.PureComponent ({ label: hm, value: hm }));
const metricsOptions =
histogramMetrics.length > 0
- ? [{ label: 'Histograms', value: HISTOGRAM_GROUP, items: histogramOptions, isLeaf: false }, ...metricsByPrefix]
+ ? [
+ { label: 'Histograms', value: HISTOGRAM_GROUP, children: histogramOptions, isLeaf: false },
+ ...metricsByPrefix,
+ ]
: metricsByPrefix;
// Hint for big disabled lookups
@@ -299,13 +302,9 @@ class PromQueryField extends React.PureComponent