diff --git a/public/app/plugins/datasource/prometheus/querybuilder/components/LabelParamEditor.tsx b/public/app/plugins/datasource/prometheus/querybuilder/components/LabelParamEditor.tsx index 51a3bde9d59..e2be9939a7e 100644 --- a/public/app/plugins/datasource/prometheus/querybuilder/components/LabelParamEditor.tsx +++ b/public/app/plugins/datasource/prometheus/querybuilder/components/LabelParamEditor.tsx @@ -3,10 +3,18 @@ import { Select } from '@grafana/ui'; import React, { useState } from 'react'; import { PrometheusDatasource } from '../../datasource'; import { promQueryModeller } from '../PromQueryModeller'; +import { getOperationParamId } from '../shared/operationUtils'; import { QueryBuilderOperationParamEditorProps } from '../shared/types'; import { PromVisualQuery } from '../types'; -export function LabelParamEditor({ onChange, index, value, query, datasource }: QueryBuilderOperationParamEditorProps) { +export function LabelParamEditor({ + onChange, + index, + operationIndex, + value, + query, + datasource, +}: QueryBuilderOperationParamEditorProps) { const [state, setState] = useState<{ options?: Array>; isLoading?: boolean; @@ -14,6 +22,7 @@ export function LabelParamEditor({ onChange, index, value, query, datasource }: return ( { if (evt.key === 'Enter') { @@ -36,7 +38,13 @@ function SimpleInputParamEditor(props: QueryBuilderOperationParamEditorProps) { ); } -function SelectInputParamEditor({ paramDef, value, index, onChange }: QueryBuilderOperationParamEditorProps) { +function SelectInputParamEditor({ + paramDef, + value, + index, + operationIndex, + onChange, +}: QueryBuilderOperationParamEditorProps) { const selectOptions = paramDef.options!.map((option) => ({ label: option as string, value: option as string, @@ -44,6 +52,7 @@ function SelectInputParamEditor({ paramDef, value, index, onChange }: QueryBuild return (