mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-08 17:29:02 +08:00
fix: suggestions not populating without space (#4257)
This commit is contained in:
parent
a6b6abf1a7
commit
c5cba68b53
@ -4,6 +4,7 @@ import {
|
||||
} from 'container/QueryBuilder/filters/QueryBuilderSearch/utils';
|
||||
import { Option } from 'container/QueryBuilder/type';
|
||||
import { transformStringWithPrefix } from 'lib/query/transformStringWithPrefix';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
|
||||
@ -83,9 +84,11 @@ export const useOptions = (
|
||||
const keyOperator = key.split(' ');
|
||||
const partialOperator = keyOperator?.[1];
|
||||
const partialKey = keyOperator?.[0];
|
||||
const filteredOperators = operators?.filter((operator) =>
|
||||
const filteredOperators = !isEmpty(partialOperator)
|
||||
? operators?.filter((operator) =>
|
||||
operator.startsWith(partialOperator?.toUpperCase()),
|
||||
);
|
||||
)
|
||||
: operators;
|
||||
const operatorsOptions = filteredOperators?.map((operator) => ({
|
||||
value: `${partialKey} ${operator} `,
|
||||
label: `${partialKey} ${operator} `,
|
||||
|
Loading…
x
Reference in New Issue
Block a user