Tempo: Fix empty values in TraceQL filters (#76544)

Fix empty values in TraceQL filters
This commit is contained in:
Andre Pereira 2023-10-13 14:19:01 +01:00 committed by GitHub
parent 939b311b8e
commit 69b84fec8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,9 @@ const SearchField = ({
setError,
query,
]);
if (filter.value && options && !options.find((o) => o === filter.value)) {
// Add selected option if it doesn't exist in the current list of options
if (filter.value && !Array.isArray(filter.value) && options && !options.find((o) => o.value === filter.value)) {
options.push({ label: filter.value.toString(), value: filter.value.toString(), type: filter.valueType });
}