Browse Source

fix(issue-details): Tab should say All Events for Errors (#57051)

Fixes an issue where we accidentally replaced the "All Events" tab
in error issues with "Sampled Events". This is confusing because
we don't sample error events but we do for Performance and other
issues.
Nar Saynorath 1 year ago
parent
commit
e3cd00f44a

+ 1 - 1
static/app/views/issueDetails/header.spec.tsx

@@ -65,7 +65,7 @@ describe('groupDetails', () => {
       await userEvent.click(screen.getByRole('tab', {name: /tags/i}));
       expect(browserHistory.push).toHaveBeenCalledWith('BASE_URL/tags/');
 
-      await userEvent.click(screen.getByRole('tab', {name: /sampled events/i}));
+      await userEvent.click(screen.getByRole('tab', {name: /all events/i}));
       expect(browserHistory.push).toHaveBeenCalledWith({
         pathname: 'BASE_URL/events/',
         query: {},

+ 11 - 2
static/app/views/issueDetails/header.tsx

@@ -21,7 +21,14 @@ import {TabList} from 'sentry/components/tabs';
 import {IconChat} from 'sentry/icons';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
-import {Event, Group, IssueType, Organization, Project} from 'sentry/types';
+import {
+  Event,
+  Group,
+  IssueCategory,
+  IssueType,
+  Organization,
+  Project,
+} from 'sentry/types';
 import {getMessage} from 'sentry/utils/events';
 import {getConfigForIssueType} from 'sentry/utils/issueTypeConfig';
 import {projectCanLinkToReplay} from 'sentry/utils/replays/projectSupportsReplay';
@@ -127,7 +134,9 @@ function GroupHeaderTabs({
         disabled={disabledTabs.includes(Tab.EVENTS)}
         to={eventRoute}
       >
-        {t('Sampled Events')}
+        {group.issueCategory === IssueCategory.ERROR
+          ? t('All Events')
+          : t('Sampled Events')}
       </TabList.Item>
       <TabList.Item
         key={Tab.MERGED}