Skip to content

Commit

Permalink
feat(nav): Add pathname builder for alerts (#85252)
Browse files Browse the repository at this point in the history
  • Loading branch information
malwilley authored Feb 14, 2025
1 parent c9733a8 commit fb62884
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions static/app/views/alerts/pathnames.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type {Organization} from 'sentry/types/organization';
import normalizeUrl from 'sentry/utils/url/normalizeUrl';

const LEGACY_ALERTS_BASE_PATHNAME = 'alerts';
const ALERTS_BASE_PATHNAME = 'issues/alerts';

export function makeAlertsPathname({
path,
organization,
}: {
organization: Organization;
path: '/' | `/${string}/`;
}) {
return normalizeUrl(
organization.features.includes('navigation-sidebar-v2')
? `/organizations/${organization.slug}/${ALERTS_BASE_PATHNAME}${path}`
: `/organizations/${organization.slug}/${LEGACY_ALERTS_BASE_PATHNAME}${path}`
);
}

0 comments on commit fb62884

Please sign in to comment.