+
+ There are some config options which allow you to customize which types of syntax
+ are considered valid. This should be used when the search backend does not
+ support certain operators like boolean logic or wildcards.
+
+
+ {configs.map(config => (
+
+ {config}
+
+ ))}
+
+
+
+ );
+ });
});
const MinHeightSizingWindow = styled(SizingWindow)`
diff --git a/static/app/components/searchQueryBuilder/index.tsx b/static/app/components/searchQueryBuilder/index.tsx
index 7083b9acf74126..0779b22011039c 100644
--- a/static/app/components/searchQueryBuilder/index.tsx
+++ b/static/app/components/searchQueryBuilder/index.tsx
@@ -44,6 +44,10 @@ export interface SearchQueryBuilderProps {
* When true, parens and logical operators (AND, OR) will be marked as invalid.
*/
disallowLogicalOperators?: boolean;
+ /**
+ * When true, the wildcard (*) in filter values or free text will be marked as invalid.
+ */
+ disallowWildcard?: boolean;
/**
* The lookup strategy for field definitions.
* Each SearchQueryBuilder instance can support a different list of fields and
@@ -92,6 +96,7 @@ function ActionButtons() {
export function SearchQueryBuilder({
className,
disallowLogicalOperators,
+ disallowWildcard,
label,
initialQuery,
fieldDefinitionGetter = getFieldDefinition,
@@ -113,9 +118,16 @@ export function SearchQueryBuilder({
() =>
parseQueryBuilderValue(state.query, fieldDefinitionGetter, {
disallowLogicalOperators,
+ disallowWildcard,
filterKeys,
}),
- [disallowLogicalOperators, fieldDefinitionGetter, filterKeys, state.query]
+ [
+ disallowLogicalOperators,
+ disallowWildcard,
+ fieldDefinitionGetter,
+ filterKeys,
+ state.query,
+ ]
);
useEffectAfterFirstRender(() => {
diff --git a/static/app/components/searchQueryBuilder/tokenizedQueryGrid.tsx b/static/app/components/searchQueryBuilder/tokenizedQueryGrid.tsx
index e04438f008ba63..c7f4c9393d0913 100644
--- a/static/app/components/searchQueryBuilder/tokenizedQueryGrid.tsx
+++ b/static/app/components/searchQueryBuilder/tokenizedQueryGrid.tsx
@@ -86,7 +86,6 @@ function Grid(props: GridProps) {
/>
);
case Token.FREE_TEXT:
- case Token.SPACES:
return (