Skip to content

feat(issues): add feature flags to issue stream search suggestions #83968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions static/app/views/issueList/utils/getIssueTagValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ export function makeGetIssueTagValues(
tagValueLoader: (key: string, search: string) => Promise<TagValue[]>
) {
return async (tag: Tag, query: string): Promise<string[]> => {
// Strip leading and trailing quotes (double, single, backtick), which may be used to escape special characters in the search bar.
const charsToStrip = '"`\'';
const key = tag.key.replace(
new RegExp(`^[${charsToStrip}]+|[${charsToStrip}]+$`, 'g'),
''
);

// device.class is stored as "numbers" in snuba, but we want to suggest high, medium,
// and low search filter values because discover maps device.class to these values.
if (isDeviceClass(tag.key)) {
if (isDeviceClass(key)) {
return DEVICE_CLASS_TAG_VALUES;
}
const values = await tagValueLoader(tag.key, query);
const values = await tagValueLoader(key, query);
return values.map(({value}) => {
// Truncate results to 5000 characters to avoid exceeding the max url query length
// The message attribute for example can be 8192 characters.
Expand Down
Loading