Skip to content

Commit

Permalink
feat(eap): Add has filters to eap search query builder (#83437)
Browse files Browse the repository at this point in the history
This adds the `has` filter back to eap search bar as it was missed
before.
  • Loading branch information
Zylphrex authored Jan 15, 2025
1 parent f439577 commit ee682ed
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions static/app/components/performance/spanSearchQueryBuilder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {useCallback, useMemo} from 'react';

import {fetchSpanFieldValues} from 'sentry/actionCreators/tags';
import {getHasTag} from 'sentry/components/events/searchBar';
import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilters/parse';
import {SearchQueryBuilder} from 'sentry/components/searchQueryBuilder';
import type {CallbackSearchState} from 'sentry/components/searchQueryBuilder/types';
Expand Down Expand Up @@ -179,8 +180,10 @@ export function EAPSpanSearchQueryBuilder({
return getFunctionTags(supportedAggregates);
}, [supportedAggregates]);

const tags = useMemo(() => {
return {...functionTags, ...numberTags, ...stringTags};
const filterTags: TagCollection = useMemo(() => {
const tags: TagCollection = {...functionTags, ...numberTags, ...stringTags};
tags.has = getHasTag({...stringTags}); // TODO: add number tags
return tags;
}, [numberTags, stringTags, functionTags]);

const filterKeySections = useMemo(() => {
Expand Down Expand Up @@ -231,9 +234,9 @@ export function EAPSpanSearchQueryBuilder({
return (
<SearchQueryBuilder
placeholder={placeholderText}
filterKeys={tags}
filterKeys={filterTags}
initialQuery={initialQuery}
fieldDefinitionGetter={getSpanFieldDefinitionFunction(tags)}
fieldDefinitionGetter={getSpanFieldDefinitionFunction(filterTags)}
onSearch={onSearch}
onBlur={onBlur}
getFilterTokenWarning={getFilterTokenWarning}
Expand Down

0 comments on commit ee682ed

Please sign in to comment.