diff --git a/public/app/plugins/datasource/cloud-monitoring/components/LabelFilter.tsx b/public/app/plugins/datasource/cloud-monitoring/components/LabelFilter.tsx index 1dd0b441721..b2b56b1ccf8 100644 --- a/public/app/plugins/datasource/cloud-monitoring/components/LabelFilter.tsx +++ b/public/app/plugins/datasource/cloud-monitoring/components/LabelFilter.tsx @@ -75,57 +75,78 @@ export const LabelFilter: FunctionComponent = ({ noFillEnd={filters.length > 1} > - {filters.map(({ key, operator, value, condition }, index) => ( - - - onChange(filtersToStringArray(filters.map((f, i) => (i === index ? { ...f, operator } : f)))) - } - menuPlacement="bottom" - renderControl={OperatorButton} - /> - `Use label key: ${v}`} + value={key} + options={options} + onChange={({ value: key = '' }) => { + onChange( + filtersToStringArray( + filters.map((f, i) => (i === index ? { key, operator, condition, value: '' } : f)) + ) + ); + }} + /> + `Use label value: ${v}`} + allowCustomValue + value={value} + placeholder="add filter value" + options={valueOptions} + onChange={({ value = '' }) => + onChange(filtersToStringArray(filters.map((f, i) => (i === index ? { ...f, value } : f)))) + } + /> + + {index + 1 === filters.length && Object.values(filters).every(({ value }) => value) && } + + ); + })} {!filters.length && }