Browse Source

feat(escalating-issues): Switch ignored issues tab to archived (#47367)

Scott Cooper 1 year ago
parent
commit
415f1bb53f
2 changed files with 44 additions and 10 deletions
  1. 22 0
      static/app/views/issueList/overview.spec.jsx
  2. 22 10
      static/app/views/issueList/utils.tsx

+ 22 - 0
static/app/views/issueList/overview.spec.jsx

@@ -304,6 +304,28 @@ describe('IssueList', function () {
       expect(screen.getByRole('button', {name: 'My Default Search'})).toBeInTheDocument();
     });
 
+    it('shows archived tab', async function () {
+      render(
+        <IssueListWithStores
+          {...routerProps}
+          {...defaultProps}
+          organization={{...organization, features: ['escalating-issues']}}
+        />,
+        {
+          context: routerContext,
+        }
+      );
+
+      await waitFor(() => {
+        expect(issuesRequest).toHaveBeenCalled();
+      });
+
+      expect(screen.getByRole('textbox')).toHaveValue('is:unresolved ');
+
+      // TODO(workflow): remove this test when we remove the feature flag
+      expect(screen.getByRole('tab', {name: 'Archived'})).toBeInTheDocument();
+    });
+
     it('loads with a saved query', async function () {
       savedSearchesRequest = MockApiClient.addMockResponse({
         url: '/organizations/org-slug/searches/',

+ 22 - 10
static/app/views/issueList/utils.tsx

@@ -7,6 +7,7 @@ export enum Query {
   FOR_REVIEW = 'is:unresolved is:for_review assigned_or_suggested:[me, none]',
   UNRESOLVED = 'is:unresolved',
   IGNORED = 'is:ignored',
+  ARCHIVED = 'is:archived',
   REPROCESSING = 'is:reprocessing',
 }
 
@@ -61,17 +62,28 @@ export function getTabs(organization: Organization) {
           Issues are automatically marked reviewed in 7 days.`),
       },
     ],
-    [
-      Query.IGNORED,
-      {
-        name: t('Ignored'),
-        analyticsName: 'ignored',
-        count: true,
-        enabled: true,
-        tooltipTitle: t(`Ignored issues don’t trigger alerts. When their ignore
+    organization.features.includes('escalating-issues')
+      ? [
+          Query.ARCHIVED,
+          {
+            name: t('Archived'),
+            analyticsName: 'archived',
+            count: true,
+            enabled: true,
+            tooltipTitle: t(`Archived issues don’t trigger alerts.`),
+          },
+        ]
+      : [
+          Query.IGNORED,
+          {
+            name: t('Ignored'),
+            analyticsName: 'ignored',
+            count: true,
+            enabled: true,
+            tooltipTitle: t(`Ignored issues don’t trigger alerts. When their ignore
         conditions are met they become Unresolved and are flagged for review.`),
-      },
-    ],
+          },
+        ],
     [
       Query.REPROCESSING,
       {