Skip to content

Commit 593f280

Browse files
authored
feat(issue-taxonomy): Update taxonomy labels (#90797)
1 parent d924ee6 commit 593f280

File tree

6 files changed

+73
-46
lines changed

6 files changed

+73
-46
lines changed

static/app/routes.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {ModuleName} from 'sentry/views/insights/types';
2929
import {GroupEventDetailsLoading} from 'sentry/views/issueDetails/groupEventDetails/groupEventDetailsLoading';
3030
import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
3131
import {OverviewWrapper} from 'sentry/views/issueList/overviewWrapper';
32+
import {IssueTaxonomy} from 'sentry/views/issueList/taxonomies';
3233
import OrganizationContainer from 'sentry/views/organizationContainer';
3334
import OrganizationLayout from 'sentry/views/organizationLayout';
3435
import {OrganizationStatsWrapper} from 'sentry/views/organizationStats/organizationStatsWrapper';
@@ -2212,16 +2213,16 @@ function buildRoutes() {
22122213
<Route path="/issues/" withOrgPath>
22132214
<IndexRoute component={errorHandler(OverviewWrapper)} />
22142215
<Route
2215-
path="errors-outages/"
2216+
path={`${IssueTaxonomy.ERRORS_AND_OUTAGES}/`}
22162217
component={make(() => import('sentry/views/issueList/pages/errorsOutages'))}
22172218
/>
22182219
<Route
2219-
path="metrics/"
2220-
component={make(() => import('sentry/views/issueList/pages/metrics'))}
2220+
path={`${IssueTaxonomy.REGRESSIONS}/`}
2221+
component={make(() => import('sentry/views/issueList/pages/regressions'))}
22212222
/>
22222223
<Route
2223-
path="best-practices/"
2224-
component={make(() => import('sentry/views/issueList/pages/bestPractices'))}
2224+
path={`${IssueTaxonomy.WARNINGS}/`}
2225+
component={make(() => import('sentry/views/issueList/pages/warnings'))}
22252226
/>
22262227
<Route
22272228
path="views/"

static/app/views/issueList/pages/errorsOutages.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import NoProjectMessage from 'sentry/components/noProjectMessage';
22
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
33
import Redirect from 'sentry/components/redirect';
4-
import {t} from 'sentry/locale';
54
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
65
import useOrganization from 'sentry/utils/useOrganization';
76
import IssueListContainer from 'sentry/views/issueList';
87
import IssueListOverview from 'sentry/views/issueList/overview';
8+
import {ISSUE_TAXONOMY_CONFIG, IssueTaxonomy} from 'sentry/views/issueList/taxonomies';
99

1010
type Props = RouteComponentProps;
1111

12-
const TITLE = t('Errors & Outages');
13-
const QUERY = 'is:unresolved issue.category:[error,outage]';
12+
const CONFIG = ISSUE_TAXONOMY_CONFIG[IssueTaxonomy.ERRORS_AND_OUTAGES];
13+
const QUERY = `is:unresolved issue.category:[${CONFIG.categories.join(',')}]`;
1414

1515
export default function ErrorsOutagesPage(props: Props) {
1616
const organization = useOrganization();
@@ -21,10 +21,10 @@ export default function ErrorsOutagesPage(props: Props) {
2121
}
2222

2323
return (
24-
<IssueListContainer title={TITLE}>
24+
<IssueListContainer title={CONFIG.label}>
2525
<PageFiltersContainer>
2626
<NoProjectMessage organization={organization}>
27-
<IssueListOverview {...props} initialQuery={QUERY} title={TITLE} />
27+
<IssueListOverview {...props} initialQuery={QUERY} title={CONFIG.label} />
2828
</NoProjectMessage>
2929
</PageFiltersContainer>
3030
</IssueListContainer>

static/app/views/issueList/pages/metrics.tsx renamed to static/app/views/issueList/pages/regressions.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import NoProjectMessage from 'sentry/components/noProjectMessage';
22
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
33
import Redirect from 'sentry/components/redirect';
4-
import {t} from 'sentry/locale';
54
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
65
import useOrganization from 'sentry/utils/useOrganization';
76
import IssueListContainer from 'sentry/views/issueList';
87
import IssueListOverview from 'sentry/views/issueList/overview';
8+
import {ISSUE_TAXONOMY_CONFIG, IssueTaxonomy} from 'sentry/views/issueList/taxonomies';
99

1010
type Props = RouteComponentProps;
1111

12-
const TITLE = t('Metrics');
13-
const QUERY = 'is:unresolved issue.category:performance_regression';
12+
const CONFIG = ISSUE_TAXONOMY_CONFIG[IssueTaxonomy.REGRESSIONS];
13+
const QUERY = `is:unresolved issue.category:[${CONFIG.categories.join(',')}]`;
1414

15-
export default function ErrorsOutagesPage(props: Props) {
15+
export default function RegressionsPage(props: Props) {
1616
const organization = useOrganization();
1717
const hasIssueTaxonomy = organization.features.includes('issue-taxonomy');
1818
if (!hasIssueTaxonomy) {
1919
return <Redirect to={`/organizations/${organization.slug}/issues/`} />;
2020
}
2121

2222
return (
23-
<IssueListContainer title={TITLE}>
23+
<IssueListContainer title={CONFIG.label}>
2424
<PageFiltersContainer>
2525
<NoProjectMessage organization={organization}>
26-
<IssueListOverview {...props} initialQuery={QUERY} title={TITLE} />
26+
<IssueListOverview {...props} initialQuery={QUERY} title={CONFIG.label} />
2727
</NoProjectMessage>
2828
</PageFiltersContainer>
2929
</IssueListContainer>

static/app/views/issueList/pages/bestPractices.tsx renamed to static/app/views/issueList/pages/warnings.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
import NoProjectMessage from 'sentry/components/noProjectMessage';
22
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
33
import Redirect from 'sentry/components/redirect';
4-
import {t} from 'sentry/locale';
54
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
65
import useOrganization from 'sentry/utils/useOrganization';
76
import IssueListContainer from 'sentry/views/issueList';
87
import IssueListOverview from 'sentry/views/issueList/overview';
8+
import {ISSUE_TAXONOMY_CONFIG, IssueTaxonomy} from 'sentry/views/issueList/taxonomies';
99

1010
type Props = RouteComponentProps;
1111

12-
const TITLE = t('Best Practices');
13-
const QUERY =
14-
'is:unresolved issue.category:[user_experience,responsiveness,performance_best_practice]';
12+
const CONFIG = ISSUE_TAXONOMY_CONFIG[IssueTaxonomy.WARNINGS];
13+
const QUERY = `is:unresolved issue.category:[${CONFIG.categories.join(',')}]`;
1514

16-
export default function ErrorsOutagesPage(props: Props) {
15+
export default function WarningsPage(props: Props) {
1716
const organization = useOrganization();
1817
const hasIssueTaxonomy = organization.features.includes('issue-taxonomy');
1918
if (!hasIssueTaxonomy) {
2019
return <Redirect to={`/organizations/${organization.slug}/issues/`} />;
2120
}
2221

2322
return (
24-
<IssueListContainer title={TITLE}>
23+
<IssueListContainer title={CONFIG.label}>
2524
<PageFiltersContainer>
2625
<NoProjectMessage organization={organization}>
27-
<IssueListOverview {...props} initialQuery={QUERY} title={TITLE} />
26+
<IssueListOverview {...props} initialQuery={QUERY} title={CONFIG.label} />
2827
</NoProjectMessage>
2928
</PageFiltersContainer>
3029
</IssueListContainer>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import {t} from 'sentry/locale';
2+
import {IssueCategory} from 'sentry/types/group';
3+
4+
export enum IssueTaxonomy {
5+
ERRORS_AND_OUTAGES = 'errors-outages',
6+
REGRESSIONS = 'regressions',
7+
WARNINGS = 'warnings',
8+
}
9+
10+
export const ISSUE_TAXONOMY_CONFIG: Record<
11+
IssueTaxonomy,
12+
{
13+
categories: IssueCategory[];
14+
key: string;
15+
label: string;
16+
}
17+
> = {
18+
[IssueTaxonomy.ERRORS_AND_OUTAGES]: {
19+
categories: [IssueCategory.ERROR, IssueCategory.OUTAGE],
20+
label: t('Errors & Outages'),
21+
key: 'errors-outages',
22+
},
23+
[IssueTaxonomy.REGRESSIONS]: {
24+
categories: [IssueCategory.PERFORMANCE_REGRESSION],
25+
label: t('Regressions'),
26+
key: 'regressions',
27+
},
28+
[IssueTaxonomy.WARNINGS]: {
29+
categories: [
30+
IssueCategory.RESPONSIVENESS,
31+
IssueCategory.USER_EXPERIENCE,
32+
IssueCategory.PERFORMANCE_BEST_PRACTICE,
33+
],
34+
label: t('Warnings'),
35+
key: 'warnings',
36+
},
37+
};

static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {FeatureBadge} from 'sentry/components/core/badge/featureBadge';
44
import {useWorkflowEngineFeatureGate} from 'sentry/components/workflowEngine/useWorkflowEngineFeatureGate';
55
import {t} from 'sentry/locale';
66
import useOrganization from 'sentry/utils/useOrganization';
7+
import {ISSUE_TAXONOMY_CONFIG} from 'sentry/views/issueList/taxonomies';
78
import {PRIMARY_NAV_GROUP_CONFIG} from 'sentry/views/nav/primary/config';
89
import {SecondaryNav} from 'sentry/views/nav/secondary/secondary';
910
import {IssueViewNavItems} from 'sentry/views/nav/secondary/sections/issues/issueViews/issueViewNavItems';
@@ -31,7 +32,7 @@ export function IssuesSecondaryNav() {
3132
to={`${baseUrl}/feedback/`}
3233
analyticsItemName="issues_feedback"
3334
>
34-
{t('Feedback')}
35+
{t('User Feedback')}
3536
</SecondaryNav.Item>
3637
</SecondaryNav.Section>
3738
)}
@@ -43,32 +44,21 @@ export function IssuesSecondaryNav() {
4344
</SecondaryNav.Item>
4445
</SecondaryNav.Section>
4546
<SecondaryNav.Section>
46-
<SecondaryNav.Item
47-
to={`${baseUrl}/errors-outages/`}
48-
end
49-
analyticsItemName="issues_types_errors_outages"
50-
>
51-
{t('Errors & Outages')}
52-
</SecondaryNav.Item>
53-
<SecondaryNav.Item
54-
to={`${baseUrl}/metrics/`}
55-
end
56-
analyticsItemName="issues_types_metrics"
57-
>
58-
{t('Metrics')}
59-
</SecondaryNav.Item>
60-
<SecondaryNav.Item
61-
to={`${baseUrl}/best-practices/`}
62-
end
63-
analyticsItemName="issues_types_best_practices"
64-
>
65-
{t('Best Practices')}
66-
</SecondaryNav.Item>
47+
{Object.values(ISSUE_TAXONOMY_CONFIG).map(({key, label}) => (
48+
<SecondaryNav.Item
49+
key={key}
50+
to={`${baseUrl}/${key}/`}
51+
end
52+
analyticsItemName={`issues_types_${key}`}
53+
>
54+
{label}
55+
</SecondaryNav.Item>
56+
))}
6757
<SecondaryNav.Item
6858
to={`${baseUrl}/feedback/`}
6959
analyticsItemName="issues_feedback"
7060
>
71-
{t('Feedback')}
61+
{t('User Feedback')}
7262
</SecondaryNav.Item>
7363
</SecondaryNav.Section>
7464
</Fragment>

0 commit comments

Comments
 (0)