Skip to content

Commit b0a5421

Browse files
authored
fix(nav): Fix more pathnames pointing to old route structure (#90180)
1 parent be2f2e3 commit b0a5421

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

static/app/components/charts/releaseSeries.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import type {Organization} from 'sentry/types/organization';
1717
import {escape} from 'sentry/utils';
1818
import {getFormattedDate, getUtcDateString} from 'sentry/utils/dates';
1919
import parseLinkHeader from 'sentry/utils/parseLinkHeader';
20-
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
2120
import {formatVersion} from 'sentry/utils/versions/formatVersion';
2221
import withApi from 'sentry/utils/withApi';
2322
import withOrganization from 'sentry/utils/withOrganization';
2423
// eslint-disable-next-line no-restricted-imports
2524
import withSentryRouter from 'sentry/utils/withSentryRouter';
25+
import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames';
2626

2727
type ReleaseMetaBasic = {
2828
date: string;
@@ -264,14 +264,13 @@ class ReleaseSeries extends Component<ReleaseSeriesProps, State> {
264264
value: formatVersion(release.version, true),
265265

266266
onClick: () => {
267-
router.push(
268-
normalizeUrl({
269-
pathname: `/organizations/${
270-
organization.slug
271-
}/releases/${encodeURIComponent(release.version)}/`,
272-
query,
273-
})
274-
);
267+
router.push({
268+
pathname: makeReleasesPathname({
269+
organization,
270+
path: `/${encodeURIComponent(release.version)}/`,
271+
}),
272+
query,
273+
});
275274
},
276275

277276
label: {

static/app/views/explore/components/breadcrumb.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import type {Crumb} from 'sentry/components/breadcrumbs';
22
import Breadcrumbs from 'sentry/components/breadcrumbs';
33
import {t} from 'sentry/locale';
44
import useOrganization from 'sentry/utils/useOrganization';
5+
import {makeTracesPathname} from 'sentry/views/traces/pathnames';
56

67
function ExploreBreadcrumb() {
78
const organization = useOrganization();
89
const crumbs: Crumb[] = [];
910
crumbs.push({
10-
to: `/organizations/${organization.slug}/traces/`,
11+
to: makeTracesPathname({organization, path: '/'}),
1112
label: t('Traces'),
1213
});
1314
crumbs.push({

static/app/views/explore/savedQueries/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
44
import {t} from 'sentry/locale';
55
import useOrganization from 'sentry/utils/useOrganization';
66
import {SavedQueriesLandingContent} from 'sentry/views/explore/savedQueries/savedQueriesLandingContent';
7+
import {makeTracesPathname} from 'sentry/views/traces/pathnames';
78

89
export default function SavedQueriesView() {
910
const organization = useOrganization();
@@ -17,7 +18,7 @@ export default function SavedQueriesView() {
1718
crumbs={[
1819
{
1920
label: t('Explore'),
20-
to: `/organizations/${organization.slug}/traces/`,
21+
to: makeTracesPathname({organization, path: '/'}),
2122
},
2223
{
2324
label: t('All Queries'),

static/gsApp/views/spikeProtection/spikeProtectionHistoryTable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {decodeScalar} from 'sentry/utils/queryString';
2222
import useApi from 'sentry/utils/useApi';
2323
import useOrganization from 'sentry/utils/useOrganization';
2424
import withOrganization from 'sentry/utils/withOrganization';
25+
import {makeDiscoverPathname} from 'sentry/views/discover/pathnames';
2526
import {
2627
formatUsageWithUnits,
2728
getFormatUsageOptions,
@@ -158,7 +159,10 @@ class SpikeProtectionHistoryTable extends Component<Props> {
158159
})
159160
}
160161
to={{
161-
pathname: `/organizations/${organization.slug}/discover/homepage/`,
162+
pathname: makeDiscoverPathname({
163+
organization,
164+
path: '/homepage/',
165+
}),
162166
query: {
163167
project: [project.id],
164168
start: decodeScalar(spike.start),

0 commit comments

Comments
 (0)