Skip to content

Commit a14a7dd

Browse files
committed
👔 Pass flag data through
1 parent 292a014 commit a14a7dd

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

static/app/components/searchQueryBuilder/tokens/useSortedFilterKeyItems.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,13 @@ export function useSortedFilterKeyItems({
143143
gaveSeerConsent,
144144
} = useSearchQueryBuilder();
145145

146-
const hasWildcardOperators = useOrganization().features.includes(
146+
const organization = useOrganization();
147+
const hasWildcardOperators = organization.features.includes(
147148
'search-query-builder-wildcard-operators'
148149
);
150+
const hasSentryConventions = organization.features.includes(
151+
'search-query-builder-use-conventions-field-defs'
152+
);
149153

150154
const flatKeys = useMemo(() => Object.values(filterKeys), [filterKeys]);
151155

@@ -178,7 +182,9 @@ export function useSortedFilterKeyItems({
178182
if (!filterValue || !search) {
179183
if (!filterKeySections.length) {
180184
return flatKeys
181-
.map(key => createItem(key, getFieldDefinition(key.key)))
185+
.map(key =>
186+
createItem(key, getFieldDefinition(key.key), undefined, hasSentryConventions)
187+
)
182188
.sort((a, b) => a.textValue.localeCompare(b.textValue));
183189
}
184190

@@ -189,7 +195,9 @@ export function useSortedFilterKeyItems({
189195
return filterSectionKeys
190196
.map(key => filterKeys[key])
191197
.filter(defined)
192-
.map(key => createItem(key, getFieldDefinition(key.key)));
198+
.map(key =>
199+
createItem(key, getFieldDefinition(key.key), undefined, hasSentryConventions)
200+
);
193201
}
194202

195203
const searched = search.search(filterValue);
@@ -198,7 +206,12 @@ export function useSortedFilterKeyItems({
198206
.map(({item}) => item)
199207
.filter(item => item.type === 'key' && filterKeys[item.item.key])
200208
.map(({item}) => {
201-
return createItem(filterKeys[item.key]!, getFieldDefinition(item.key));
209+
return createItem(
210+
filterKeys[item.key]!,
211+
getFieldDefinition(item.key),
212+
undefined,
213+
hasSentryConventions
214+
);
202215
});
203216

204217
const askSeerItem = [];
@@ -308,6 +321,7 @@ export function useSortedFilterKeyItems({
308321
flatKeys,
309322
gaveSeerConsent,
310323
getFieldDefinition,
324+
hasSentryConventions,
311325
hasWildcardOperators,
312326
includeSuggestions,
313327
inputValue,

0 commit comments

Comments
 (0)