mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-08 14:39:04 +08:00
fix: [GH-3585]: operator suggestion should work on the substring typed in by the user (#4246)
* fix: [GH-3585]: operator suggestion logic * fix: [GH-3585]: address review comments * fix: [GH-3585]: address review comments
This commit is contained in:
parent
2baa6028b5
commit
ce8fdd509b
@ -80,9 +80,15 @@ export const useOptions = (
|
||||
|
||||
const getKeyOperatorOptions = useCallback(
|
||||
(key: string) => {
|
||||
const operatorsOptions = operators?.map((operator) => ({
|
||||
value: `${key} ${operator} `,
|
||||
label: `${key} ${operator} `,
|
||||
const keyOperator = key.split(' ');
|
||||
const partialOperator = keyOperator?.[1];
|
||||
const partialKey = keyOperator?.[0];
|
||||
const filteredOperators = operators?.filter((operator) =>
|
||||
operator.startsWith(partialOperator?.toUpperCase()),
|
||||
);
|
||||
const operatorsOptions = filteredOperators?.map((operator) => ({
|
||||
value: `${partialKey} ${operator} `,
|
||||
label: `${partialKey} ${operator} `,
|
||||
}));
|
||||
if (whereClauseConfig) {
|
||||
return [
|
||||
|
Loading…
x
Reference in New Issue
Block a user