mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-02 21:10:43 +08:00

* fix: search filter validation on data source * fix: value search not working for in/nin * fix: unwanted key api while searching value & disabled tag * fix: unnecessary , at end of in/nin value * fix: added space after operator to get value * fix: custom value not being selected * fix: space after tag and value * fix: api call debounce duration * fix: suggested changes * fix: updated query params * fix: search filter data for logs and traces * fix: search filter value data type issue * fix: search filter value tag type * fix: chip & iscolumn issue * fix: null handled * fix: label in list of search filter component * fix: label in list of search filter component * fix: code level changes * fix: incorrect filter operators * fix: key selection dancing * fix: missing suggestion * fix: keys are not getting updated * fix: strange behaviour - removed duplicate options * fix: driver id exclusion not working * fix: loader when 0 options * fix: exists/not-exists tag value issue * fix: some weird behaviour about exists * fix: added duplicate option remove logic at hook level * fix: removed empty options from list * fix: closable chip handler on edit * fix: search filter validation on data source * fix: value search not working for in/nin * fix: unwanted key api while searching value & disabled tag * fix: unnecessary , at end of in/nin value * fix: added space after operator to get value * fix: custom value not being selected * fix: space after tag and value * fix: api call debounce duration * fix: suggested changes * fix: updated query params * fix: search filter data for logs and traces * fix: search filter value data type issue * fix: search filter value tag type * fix: chip & iscolumn issue * fix: null handled * fix: label in list of search filter component * fix: label in list of search filter component * fix: code level changes * fix: incorrect filter operators * fix: key selection dancing * fix: missing suggestion * fix: keys are not getting updated * fix: strange behaviour - removed duplicate options * fix: driver id exclusion not working * fix: loader when 0 options * fix: exists/not-exists tag value issue * fix: some weird behaviour about exists * fix: added duplicate option remove logic at hook level * fix: removed empty options from list * fix: closable chip handler on edit * fix: search filter validation on data source * fix: lint issues is fixed * fix: chip & iscolumn issue * fix: lint changes are updated * fix: undefined case handled * fix: undefined case handled * fix: removed settimeout * fix: delete chip getting value undefined * fix: payload correctness * fix: incorrect value selection * fix: key text typing doesn't change anything * fix: search value issue * fix: payload updated * fix: auto populate value issue * fix: payload updated & populate values * fix: split value for in/nin * fix: split value getting undefined * fix: new version of search filter using papaparse library * fix: removed unwanted space before operator * fix: added exact find method & removed includes logic * fix: issue when user create chip for exists not exists operator * fix: white space logic removed * fix: allow custom key in from list * fix: issue when user create chip for exists not exists operator * fix: removed unwanted includes * fix: removed unwanted utils function * fix: replaced join with papa unparse * fix: removed get count of space utils * fix: resolved build issue * fix: code level fixes * fix: space after key * fix: quote a value if comma present * fix: handle custom key object onchange * chore: coverted into string * Merge branch 'develop' into fix/issue-search-filter * chore: eslint rule disabling is removed * fix: serviceName contains sql * chore: less restrictive expression * fix: custom key selection issue * chore: papa parse version is made exact --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
23 lines
913 B
TypeScript
23 lines
913 B
TypeScript
import { QUERY_BUILDER_OPERATORS_BY_TYPES } from 'constants/queryBuilder';
|
|
import { getRemovePrefixFromKey } from 'container/QueryBuilder/filters/QueryBuilderSearch/utils';
|
|
import { useMemo } from 'react';
|
|
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
|
|
|
type IOperators =
|
|
| typeof QUERY_BUILDER_OPERATORS_BY_TYPES.universal
|
|
| typeof QUERY_BUILDER_OPERATORS_BY_TYPES.string
|
|
| typeof QUERY_BUILDER_OPERATORS_BY_TYPES.bool
|
|
| typeof QUERY_BUILDER_OPERATORS_BY_TYPES.int64
|
|
| typeof QUERY_BUILDER_OPERATORS_BY_TYPES.float64;
|
|
|
|
export const useOperators = (
|
|
key: string,
|
|
keys: BaseAutocompleteData[],
|
|
): IOperators =>
|
|
useMemo(() => {
|
|
const currentKey = keys?.find((el) => el.key === getRemovePrefixFromKey(key));
|
|
return currentKey?.dataType
|
|
? QUERY_BUILDER_OPERATORS_BY_TYPES[currentKey.dataType]
|
|
: QUERY_BUILDER_OPERATORS_BY_TYPES.universal;
|
|
}, [keys, key]);
|