Browse Source

feat(search-suggestions): Add issue category to recommended (#52348)

Scott Cooper 1 year ago
parent
commit
1aab84a3a7
2 changed files with 12 additions and 8 deletions
  1. 5 1
      static/app/views/issueList/filters.tsx
  2. 7 7
      static/app/views/issueList/searchBar.tsx

+ 5 - 1
static/app/views/issueList/filters.tsx

@@ -5,6 +5,7 @@ import EnvironmentPageFilter from 'sentry/components/environmentPageFilter';
 import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
 import ProjectPageFilter from 'sentry/components/projectPageFilter';
 import {space} from 'sentry/styles/space';
+import useOrganization from 'sentry/utils/useOrganization';
 import IssueCategoryFilter from 'sentry/views/issueList/issueCategoryFilter';
 import {IssueSearchWithSavedSearches} from 'sentry/views/issueList/issueSearchWithSavedSearches';
 
@@ -14,13 +15,16 @@ interface Props {
 }
 
 function IssueListFilters({query, onSearch}: Props) {
+  const organization = useOrganization();
   return (
     <SearchContainer>
       <StyledPageFilterBar>
         <ProjectPageFilter />
         <EnvironmentPageFilter />
         <DatePageFilter />
-        <IssueCategoryFilter query={query} onSearch={onSearch} />
+        {organization.features.includes('issue-search-shortcuts') ? null : (
+          <IssueCategoryFilter query={query} onSearch={onSearch} />
+        )}
       </StyledPageFilterBar>
 
       <IssueSearchWithSavedSearches {...{query, onSearch}} />

+ 7 - 7
static/app/views/issueList/searchBar.tsx

@@ -99,6 +99,13 @@ function IssueListSearchBar({organization, tags, ...props}: Props) {
     icon: <IconStar size="xs" />,
     childrenWrapper: RecommendedWrapper,
     children: [
+      {
+        type: ItemType.RECOMMENDED,
+        kind: FieldKind.FIELD,
+        title: t('Issue Category'),
+        desc: t('Error or performance issues.'),
+        value: 'issue.category:',
+      },
       {
         type: ItemType.RECOMMENDED,
         kind: FieldKind.FIELD,
@@ -120,13 +127,6 @@ function IssueListSearchBar({organization, tags, ...props}: Props) {
         desc: t('Filter by fatal, error, etc.'),
         value: 'level:',
       },
-      {
-        type: ItemType.RECOMMENDED,
-        kind: FieldKind.FIELD,
-        title: t('Device'),
-        desc: t('Filter events by device.'),
-        value: 'device.',
-      },
       {
         type: ItemType.RECOMMENDED,
         kind: FieldKind.FIELD,