From 3db79c7924b08fab4edfc28eb15e5a56556e5622 Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Wed, 19 Feb 2025 16:58:56 -0800 Subject: [PATCH 1/2] feat(nav): Convert links from /releases/ to /explore/releases/ --- .../events/eventTags/eventTagsTreeRow.tsx | 6 +++++- .../group/suggestedOwnerHovercard.tsx | 8 +++++--- .../onboardingWizard/taskConfig.tsx | 11 +++++++++-- .../flamegraphDrawer/profileDetails.tsx | 8 +++++--- .../timeSeriesWidgetVisualization.tsx | 9 ++++----- static/app/views/discover/table/tableView.tsx | 8 +++++--- .../hooks/useReleaseMarkLineSeries.tsx | 12 +++++++----- .../teamInsights/teamReleases.tsx | 11 +++++++++-- .../projectDetail/projectLatestReleases.tsx | 6 +++++- .../releases/detail/header/releaseActions.tsx | 9 +++++++-- .../releases/detail/header/releaseHeader.tsx | 6 +++++- static/app/views/releases/detail/index.tsx | 6 +++++- .../detail/overview/sidebar/otherProjects.tsx | 8 +++++--- .../views/releases/list/releaseCard/index.tsx | 8 +++++--- .../releaseCard/releaseCardProjectRow.tsx | 13 +++++++++---- static/app/views/releases/utils/pathnames.tsx | 19 +++++++++++++++++++ .../settings/projectProguard/associations.tsx | 6 +++++- .../debugIdBundleDetails.tsx | 14 ++++++++++++-- 18 files changed, 126 insertions(+), 42 deletions(-) create mode 100644 static/app/views/releases/utils/pathnames.tsx diff --git a/static/app/components/events/eventTags/eventTagsTreeRow.tsx b/static/app/components/events/eventTags/eventTagsTreeRow.tsx index 622c6c530aa64c..3059da657f3114 100644 --- a/static/app/components/events/eventTags/eventTagsTreeRow.tsx +++ b/static/app/components/events/eventTags/eventTagsTreeRow.tsx @@ -31,6 +31,7 @@ import { } from 'sentry/views/performance/newTraceDetails/traceDrawer/details/utils'; import {useHasTraceNewUi} from 'sentry/views/performance/newTraceDetails/useHasTraceNewUi'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import {makeReplaysPathname} from 'sentry/views/replays/pathnames'; interface EventTagTreeRowConfig { @@ -233,7 +234,10 @@ function EventTagsTreeRowDropdown({ hidden: originalTag.key !== 'release', to: originalTag.key === 'release' - ? `/organizations/${organization.slug}/releases/${encodeURIComponent(content.value)}/` + ? makeReleasesPathname({ + organization, + path: `/${encodeURIComponent(content.value)}/`, + }) : undefined, }, { diff --git a/static/app/components/group/suggestedOwnerHovercard.tsx b/static/app/components/group/suggestedOwnerHovercard.tsx index 0017b739166b47..3faccbb2e2d50d 100644 --- a/static/app/components/group/suggestedOwnerHovercard.tsx +++ b/static/app/components/group/suggestedOwnerHovercard.tsx @@ -19,6 +19,7 @@ import type {Commit} from 'sentry/types/integrations'; import type {Organization} from 'sentry/types/organization'; import type {Release} from 'sentry/types/release'; import {defined} from 'sentry/utils'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; type Props = { /** @@ -143,9 +144,10 @@ function SuggestedOwnerHovercard(props: Props) { // Link to release commits diff --git a/static/app/components/onboardingWizard/taskConfig.tsx b/static/app/components/onboardingWizard/taskConfig.tsx index 5905812abf7ea4..c8fe7e21202003 100644 --- a/static/app/components/onboardingWizard/taskConfig.tsx +++ b/static/app/components/onboardingWizard/taskConfig.tsx @@ -24,6 +24,7 @@ import {isDemoModeEnabled} from 'sentry/utils/demoMode'; import {getDemoWalkthroughTasks} from 'sentry/utils/demoMode/guides'; import {makeAlertsPathname} from 'sentry/views/alerts/pathnames'; import {getPerformanceBaseUrl} from 'sentry/views/performance/utils'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import {makeReplaysPathname} from 'sentry/views/replays/pathnames'; function hasPlatformWithSourceMaps(projects: Project[] | undefined) { @@ -133,7 +134,10 @@ export function getOnboardingTasks({ ), skippable: false, actionType: 'app', - location: `/organizations/${organization.slug}/releases/`, + location: makeReleasesPathname({ + organization, + path: '/', + }), display: true, group: OnboardingTaskGroup.GETTING_STARTED, }, @@ -327,7 +331,10 @@ export function getOnboardingTasks({ ), skippable: true, actionType: 'app', - location: `/organizations/${organization.slug}/releases/`, + location: makeReleasesPathname({ + organization, + path: '/', + }), display: true, group: OnboardingTaskGroup.GETTING_STARTED, }, diff --git a/static/app/components/profiling/flamegraph/flamegraphDrawer/profileDetails.tsx b/static/app/components/profiling/flamegraph/flamegraphDrawer/profileDetails.tsx index 55fe1aa06841a1..cd862a42b81250 100644 --- a/static/app/components/profiling/flamegraph/flamegraphDrawer/profileDetails.tsx +++ b/static/app/components/profiling/flamegraph/flamegraphDrawer/profileDetails.tsx @@ -28,6 +28,7 @@ import {useResizableDrawer} from 'sentry/utils/useResizableDrawer'; import {formatVersion} from 'sentry/utils/versions/formatVersion'; import {QuickContextHoverWrapper} from 'sentry/views/discover/table/quickContext/quickContextWrapper'; import {ContextType} from 'sentry/views/discover/table/quickContext/utils'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import {ProfilingDetailsFrameTabs, ProfilingDetailsListItem} from './flamegraphDrawer'; @@ -456,9 +457,10 @@ function ProfileEventDetails({ {label}: { navigate( - normalizeUrl({ - pathname: `/organizations/${ - organization.slug - }/releases/${encodeURIComponent(release.version)}/`, + makeReleasesPathname({ + organization, + path: `/${encodeURIComponent(release.version)}/`, }) ); }; diff --git a/static/app/views/discover/table/tableView.tsx b/static/app/views/discover/table/tableView.tsx index c1bfbfc96978dd..e65809ab3129e5 100644 --- a/static/app/views/discover/table/tableView.tsx +++ b/static/app/views/discover/table/tableView.tsx @@ -56,6 +56,7 @@ import {appendQueryDatasetParam, hasDatasetSelector} from 'sentry/views/dashboar import {TraceViewSources} from 'sentry/views/performance/newTraceDetails/traceHeader/breadcrumbs'; import {getTraceDetailsUrl} from 'sentry/views/performance/traceDetails/utils'; import {generateReplayLink} from 'sentry/views/performance/transactionSummary/utils'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import { getExpandedResults, @@ -583,9 +584,10 @@ function TableView(props: TableViewProps) { browserHistory.push( normalizeUrl({ - pathname: `/organizations/${ - organization.slug - }/releases/${encodeURIComponent(value)}/`, + pathname: makeReleasesPathname({ + organization, + path: `/${encodeURIComponent(value)}/`, + }), query: { ...nextView.getPageFiltersQuery(), diff --git a/static/app/views/issueDetails/streamline/hooks/useReleaseMarkLineSeries.tsx b/static/app/views/issueDetails/streamline/hooks/useReleaseMarkLineSeries.tsx index db48353a518d18..93ec5b027f31e1 100644 --- a/static/app/views/issueDetails/streamline/hooks/useReleaseMarkLineSeries.tsx +++ b/static/app/views/issueDetails/streamline/hooks/useReleaseMarkLineSeries.tsx @@ -10,6 +10,7 @@ import {useNavigate} from 'sentry/utils/useNavigate'; import useOrganization from 'sentry/utils/useOrganization'; import {formatVersion} from 'sentry/utils/versions/formatVersion'; import {useIssueDetailsEventView} from 'sentry/views/issueDetails/streamline/hooks/useIssueDetailsDiscoverQuery'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; interface ReleaseStat { date: string; @@ -66,11 +67,12 @@ export function useReleaseMarkLineSeries({group}: {group: Group}) { name: formatVersion(release.version, true), value: formatVersion(release.version, true), onClick: () => { - navigate({ - pathname: `/organizations/${ - organization.slug - }/releases/${encodeURIComponent(release.version)}/`, - }); + navigate( + makeReleasesPathname({ + organization, + path: `/${encodeURIComponent(release.version)}/`, + }) + ); }, label: { formatter: () => formatVersion(release.version, true), diff --git a/static/app/views/organizationStats/teamInsights/teamReleases.tsx b/static/app/views/organizationStats/teamInsights/teamReleases.tsx index cfa0e68117c092..9ceacc7b76d9b1 100644 --- a/static/app/views/organizationStats/teamInsights/teamReleases.tsx +++ b/static/app/views/organizationStats/teamInsights/teamReleases.tsx @@ -21,6 +21,7 @@ import type {Project} from 'sentry/types/project'; import toArray from 'sentry/utils/array/toArray'; import {useApiQuery} from 'sentry/utils/queryClient'; import type {ColorOrAlias} from 'sentry/utils/theme'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import {ProjectBadge, ProjectBadgeContainer} from './styles'; import {barAxisLabel, groupByTrend, sortSeriesByDay} from './utils'; @@ -261,7 +262,10 @@ function TeamReleases({ avatarSize={18} project={project} to={{ - pathname: `/organizations/${organization.slug}/releases/`, + pathname: makeReleasesPathname({ + organization, + path: '/', + }), query: {project: project.id}, }} /> @@ -271,7 +275,10 @@ function TeamReleases({ diff --git a/static/app/views/projectDetail/projectLatestReleases.tsx b/static/app/views/projectDetail/projectLatestReleases.tsx index 28d5d412448780..3166e508949fbf 100644 --- a/static/app/views/projectDetail/projectLatestReleases.tsx +++ b/static/app/views/projectDetail/projectLatestReleases.tsx @@ -18,6 +18,7 @@ import {space} from 'sentry/styles/space'; import type {Organization} from 'sentry/types/organization'; import type {Project} from 'sentry/types/project'; import type {Release} from 'sentry/types/release'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import MissingReleasesButtons from './missingFeatureButtons/missingReleasesButtons'; import {SectionHeadingLink, SectionHeadingWrapper, SidebarSection} from './styles'; @@ -114,7 +115,10 @@ class ProjectLatestReleases extends DeprecatedAsyncComponent { // as this is a link to latest releases, we want to only preserve project and environment return { - pathname: `/organizations/${organization.slug}/releases/`, + pathname: makeReleasesPathname({ + organization, + path: '/', + }), query: { statsPeriod: undefined, start: undefined, diff --git a/static/app/views/releases/detail/header/releaseActions.tsx b/static/app/views/releases/detail/header/releaseActions.tsx index 82c00b667969a0..d0347a8538e388 100644 --- a/static/app/views/releases/detail/header/releaseActions.tsx +++ b/static/app/views/releases/detail/header/releaseActions.tsx @@ -18,8 +18,8 @@ import type {Organization} from 'sentry/types/organization'; import type {Release, ReleaseMeta} from 'sentry/types/release'; import {trackAnalytics} from 'sentry/utils/analytics'; import {browserHistory} from 'sentry/utils/browserHistory'; -import normalizeUrl from 'sentry/utils/url/normalizeUrl'; import {formatVersion} from 'sentry/utils/versions/formatVersion'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import {isReleaseArchived} from '../../utils'; @@ -47,7 +47,12 @@ function ReleaseActions({ projectSlug, releaseVersion: release.version, }); - browserHistory.push(normalizeUrl(`/organizations/${organization.slug}/releases/`)); + browserHistory.push( + makeReleasesPathname({ + organization, + path: '/', + }) + ); } catch { // do nothing, action creator is already displaying error message } diff --git a/static/app/views/releases/detail/header/releaseHeader.tsx b/static/app/views/releases/detail/header/releaseHeader.tsx index f89c17fcdd15e6..64047dd61b5034 100644 --- a/static/app/views/releases/detail/header/releaseHeader.tsx +++ b/static/app/views/releases/detail/header/releaseHeader.tsx @@ -19,6 +19,7 @@ import type {Organization} from 'sentry/types/organization'; import type {Release, ReleaseMeta, ReleaseProject} from 'sentry/types/release'; import {formatAbbreviatedNumber} from 'sentry/utils/formatters'; import normalizeUrl from 'sentry/utils/url/normalizeUrl'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import ReleaseActions from './releaseActions'; @@ -91,7 +92,10 @@ function ReleaseHeader({ ); } diff --git a/static/app/views/releases/detail/overview/sidebar/otherProjects.tsx b/static/app/views/releases/detail/overview/sidebar/otherProjects.tsx index 0d0e5a6fb21431..2ec6dd2b96db68 100644 --- a/static/app/views/releases/detail/overview/sidebar/otherProjects.tsx +++ b/static/app/views/releases/detail/overview/sidebar/otherProjects.tsx @@ -10,6 +10,7 @@ import {t, tn} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Organization} from 'sentry/types/organization'; import type {ReleaseProject} from 'sentry/types/release'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; type Props = { location: Location; @@ -46,9 +47,10 @@ function OtherProjects({projects, location, version, organization}: Props) { diff --git a/static/app/views/releases/list/releaseCard/releaseCardProjectRow.tsx b/static/app/views/releases/list/releaseCard/releaseCardProjectRow.tsx index d01566a3bca8eb..922851245d2bb8 100644 --- a/static/app/views/releases/list/releaseCard/releaseCardProjectRow.tsx +++ b/static/app/views/releases/list/releaseCard/releaseCardProjectRow.tsx @@ -23,6 +23,7 @@ import type {Organization} from 'sentry/types/organization'; import type {Release, ReleaseProject} from 'sentry/types/release'; import {defined} from 'sentry/utils'; import type {IconSize} from 'sentry/utils/theme'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; import { ADOPTION_STAGE_LABELS, @@ -123,7 +124,10 @@ function ReleaseCardProjectRow({ {release} diff --git a/static/app/views/settings/projectSourceMaps/debugIdBundleDetails.tsx b/static/app/views/settings/projectSourceMaps/debugIdBundleDetails.tsx index e2538c1cb103b0..e63f9a5c36294c 100644 --- a/static/app/views/settings/projectSourceMaps/debugIdBundleDetails.tsx +++ b/static/app/views/settings/projectSourceMaps/debugIdBundleDetails.tsx @@ -9,6 +9,7 @@ import {t} from 'sentry/locale'; import type {KeyValueListData} from 'sentry/types/group'; import type {DebugIdBundle, DebugIdBundleArtifact} from 'sentry/types/sourceMaps'; import useOrganization from 'sentry/utils/useOrganization'; +import {makeReleasesPathname} from 'sentry/views/releases/utils/pathnames'; const formatDist = (dist: string | string[] | null) => { if (Array.isArray(dist)) { @@ -50,7 +51,10 @@ export function DebugIdBundleDetails({ {visibleAssociations.map(association => ( {association.release} @@ -73,7 +77,13 @@ export function DebugIdBundleDetails({ ), }, ]; - }, [debugIdBundle, organization.slug, showAll]); + }, [ + debugIdBundle.associations, + debugIdBundle.date, + debugIdBundle.fileCount, + organization, + showAll, + ]); return ; } From 16d5a35d434e056c76bcfdd87a31f52672be2d6e Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Wed, 19 Feb 2025 17:06:47 -0800 Subject: [PATCH 2/2] Convert another link --- static/app/views/releases/detail/header/releaseHeader.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/app/views/releases/detail/header/releaseHeader.tsx b/static/app/views/releases/detail/header/releaseHeader.tsx index 64047dd61b5034..43469effcc4cd5 100644 --- a/static/app/views/releases/detail/header/releaseHeader.tsx +++ b/static/app/views/releases/detail/header/releaseHeader.tsx @@ -43,9 +43,10 @@ function ReleaseHeader({ const {version, url} = release; const {commitCount, commitFilesChanged} = releaseMeta; - const releasePath = `/organizations/${organization.slug}/releases/${encodeURIComponent( - version - )}/`; + const releasePath = makeReleasesPathname({ + organization, + path: `/${encodeURIComponent(version)}/`, + }); const tabs = [ {title: t('Overview'), to: ''},