From 30eb9e43afc71b788d423a34e2e5df7e8abfd58d Mon Sep 17 00:00:00 2001 From: Dominik Buszowiecki Date: Wed, 29 Jan 2025 10:22:33 -0500 Subject: [PATCH 1/3] pass organization instead of orgslug --- .../app/components/discover/transactionsList.tsx | 2 +- .../events/contexts/knownContext/trace.tsx | 2 +- .../events/eventCustomPerformanceMetrics.tsx | 4 ++-- .../aggregateSpanDiff.tsx | 2 +- .../eventRegressionSummary.tsx | 2 +- .../regressionMessage.tsx | 2 +- .../events/eventTags/eventTagContent.tsx | 2 +- .../events/eventTags/eventTagsTreeRow.tsx | 4 ++-- .../performance/spanEvidenceKeyValueList.tsx | 4 ++-- .../spans/newTraceDetailsSpanDetails.tsx | 4 ++-- .../events/interfaces/spans/spanDetail.tsx | 4 ++-- .../components/metrics/metricSamplesTable.tsx | 2 +- static/app/components/performance/searchBar.tsx | 2 +- .../components/profiling/profileEventsTable.tsx | 2 +- static/app/utils/discover/eventView.spec.tsx | 2 +- static/app/utils/discover/eventView.tsx | 6 +++--- .../rules/metric/details/relatedTransactions.tsx | 2 +- .../app/views/discover/eventDetails/content.tsx | 2 +- static/app/views/discover/utils.tsx | 2 +- .../tables/tracesTable/fieldRenderers.tsx | 2 +- .../browser/webVitals/views/pageOverview.tsx | 2 +- .../components/sampleDrawerHeaderTransaction.tsx | 2 +- .../views/spanSummaryPage/sampleList/index.tsx | 2 +- .../common/components/spanSamplesPanel.tsx | 2 +- static/app/views/metrics/summaryTable.tsx | 2 +- .../teamInsights/teamMisery.tsx | 2 +- static/app/views/performance/breadcrumb.tsx | 2 +- .../widgets/widgets/lineChartListWidget.tsx | 2 +- .../widgets/stackedAreaChartListWidget.tsx | 2 +- .../landing/widgets/widgets/trendsWidget.tsx | 2 +- .../landing/widgets/widgets/vitalWidget.tsx | 2 +- .../details/span/sections/ancestry.tsx | 2 +- .../details/span/sections/description.tsx | 4 ++-- .../details/span/sections/generalInfo.tsx | 2 +- .../details/transaction/sections/generalInfo.tsx | 2 +- .../details/transaction/sections/highlights.tsx | 2 +- .../transaction/sections/measurements.tsx | 2 +- .../newTraceDetails/traceHeader/breadcrumbs.tsx | 6 +----- static/app/views/performance/table.tsx | 2 +- .../views/performance/traceDetails/styles.tsx | 3 +-- .../traceDetails/traceViewDetailPanel.tsx | 2 +- .../traceDetails/transactionDetail.tsx | 2 +- .../performance/transactionDetails/content.tsx | 2 +- .../aggregateSpanWaterfall/utils.tsx | 7 ++++--- .../performance/transactionSummary/header.tsx | 4 ++-- .../transactionSummary/pageLayout.tsx | 8 ++++---- .../transactionEvents/utils.tsx | 7 ++++--- .../transactionOverview/suspectSpans.tsx | 2 +- .../transactionOverview/tagExplorer.tsx | 4 ++-- .../transactionOverview/userStats.tsx | 2 +- .../transactionProfiles/utils.ts | 7 ++++--- .../transactionReplays/utils.ts | 7 ++++--- .../transactionSpans/spanDetails/utils.tsx | 13 +++++++------ .../transactionSpans/spanMetricsTable.tsx | 4 ++-- .../transactionSpans/suspectSpansTable.tsx | 2 +- .../transactionSpans/utils.tsx | 13 +++++++------ .../transactionTags/tagsHeatMap.tsx | 2 +- .../transactionSummary/transactionTags/utils.tsx | 12 ++++++------ .../transactionThresholdModal.tsx | 2 +- .../transactionVitals/utils.tsx | 15 ++++++++++----- .../transactionVitals/vitalCard.tsx | 2 +- .../performance/transactionSummary/utils.tsx | 16 ++++++++-------- .../performance/trends/changedTransactions.tsx | 2 +- .../app/views/performance/vitalDetail/table.tsx | 2 +- .../app/views/profiling/profileSummary/index.tsx | 2 +- .../app/views/releases/detail/overview/index.tsx | 2 +- static/app/views/traces/fieldRenderers.tsx | 2 +- 67 files changed, 126 insertions(+), 120 deletions(-) diff --git a/static/app/components/discover/transactionsList.tsx b/static/app/components/discover/transactionsList.tsx index 0c8cacd6787407..c09728eec9c917 100644 --- a/static/app/components/discover/transactionsList.tsx +++ b/static/app/components/discover/transactionsList.tsx @@ -318,7 +318,7 @@ class _TransactionsList extends Component { ({ target: spanDetailsRouteWithQuery({ - orgSlug: organization.slug, + organization, spanSlug: {op: dataRow.operation, group: dataRow.group}, transaction, projectID: project.id, diff --git a/static/app/components/events/eventStatisticalDetector/eventRegressionSummary.tsx b/static/app/components/events/eventStatisticalDetector/eventRegressionSummary.tsx index 4488020f2d38ba..8236ab70a6131c 100644 --- a/static/app/components/events/eventStatisticalDetector/eventRegressionSummary.tsx +++ b/static/app/components/events/eventStatisticalDetector/eventRegressionSummary.tsx @@ -58,7 +58,7 @@ export function getKeyValueListData( case IssueType.PERFORMANCE_DURATION_REGRESSION: case IssueType.PERFORMANCE_ENDPOINT_REGRESSION: { const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: evidenceData.transaction, query: {}, trendFunction: 'p95', diff --git a/static/app/components/events/eventStatisticalDetector/regressionMessage.tsx b/static/app/components/events/eventStatisticalDetector/regressionMessage.tsx index 76253d47541605..b7479e79c50ca6 100644 --- a/static/app/components/events/eventStatisticalDetector/regressionMessage.tsx +++ b/static/app/components/events/eventStatisticalDetector/regressionMessage.tsx @@ -70,7 +70,7 @@ function EventStatisticalDetectorRegressedPerformanceMessage({ }); const transactionSummaryLink = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, query: {}, trendFunction: 'p95', diff --git a/static/app/components/events/eventTags/eventTagContent.tsx b/static/app/components/events/eventTags/eventTagContent.tsx index b34187564c0056..6dcadf887a5eab 100644 --- a/static/app/components/events/eventTags/eventTagContent.tsx +++ b/static/app/components/events/eventTags/eventTagContent.tsx @@ -59,7 +59,7 @@ function EventTagsContent({ {content.value} diff --git a/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx b/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx index d132d304b5b06d..388a024011e67c 100644 --- a/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx +++ b/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx @@ -245,7 +245,7 @@ function MainThreadFunctionEvidence({ if (evidenceData.transactionName) { const transactionSummaryLocation = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, projectID: event.projectID, transaction: evidenceData.transactionName, query: {}, @@ -466,7 +466,7 @@ const makeTransactionNameRow = ( projectSlug?: string ) => { const transactionSummaryLocation = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, projectID: event.projectID, transaction: event.title, query: {}, diff --git a/static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx b/static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx index 44570178261750..6d5bd8b5e79b89 100644 --- a/static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx +++ b/static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx @@ -208,7 +208,7 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) { } const target = transactionSummaryRouteWithQuery({ - orgSlug: props.organization.slug, + organization: props.organization, transaction: transactionResult.transaction, query: omit(location.query, Object.values(PAGE_URL_PARAM)), projectID: String(childTransaction.value.project_id), @@ -267,7 +267,7 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) { (props: ProfileEventsCellProps if (defined(project)) { const linkToSummary = profilesRouteWithQuery({ query: props.baggage.location.query, - orgSlug: props.baggage.organization.slug, + organization: props.baggage.organization, projectID: project.id, transaction: props.dataRow.transaction, }); diff --git a/static/app/utils/discover/eventView.spec.tsx b/static/app/utils/discover/eventView.spec.tsx index 9d001cd1c47920..b8d3778b8db2fb 100644 --- a/static/app/utils/discover/eventView.spec.tsx +++ b/static/app/utils/discover/eventView.spec.tsx @@ -3140,7 +3140,7 @@ describe('EventView.getPerformanceTransactionEventsViewUrlTarget()', function () it('generates a URL with customer domain context', function () { const view = new EventView(state); - const result = view.getPerformanceTransactionEventsViewUrlTarget(organization.slug, { + const result = view.getPerformanceTransactionEventsViewUrlTarget(organization, { showTransactions, breakdown, webVital, diff --git a/static/app/utils/discover/eventView.tsx b/static/app/utils/discover/eventView.tsx index 82f4866be76e5a..fc46e282e79d7e 100644 --- a/static/app/utils/discover/eventView.tsx +++ b/static/app/utils/discover/eventView.tsx @@ -13,7 +13,7 @@ import {DEFAULT_PER_PAGE} from 'sentry/constants'; import {ALL_ACCESS_PROJECTS, URL_PARAM} from 'sentry/constants/pageFilters'; import {t} from 'sentry/locale'; import type {PageFilters, SelectValue} from 'sentry/types/core'; -import type {NewQuery, SavedQuery} from 'sentry/types/organization'; +import type {NewQuery, Organization, SavedQuery} from 'sentry/types/organization'; import type {Project} from 'sentry/types/project'; import type {User} from 'sentry/types/user'; import toArray from 'sentry/utils/array/toArray'; @@ -1265,7 +1265,7 @@ class EventView { } getPerformanceTransactionEventsViewUrlTarget( - slug: string, + organization: Organization, options: { breakdown?: SpanOperationBreakdownFilter; showTransactions?: EventsDisplayFilterName; @@ -1297,7 +1297,7 @@ class EventView { const query = cloneDeep(output as any); return { pathname: normalizeUrl( - `${getTransactionSummaryBaseUrl(slug, options.view)}/events/` + `${getTransactionSummaryBaseUrl(organization, options.view)}/events/` ), query, }; diff --git a/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx b/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx index 28228bee76df43..d2004b7e873115 100644 --- a/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx +++ b/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx @@ -65,7 +65,7 @@ function RelatedTransactions({ summaryView.query = summaryConditions; const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: String(dataRow.transaction) || '', query: summaryView.generateQueryStringObject(), projectID, diff --git a/static/app/views/discover/eventDetails/content.tsx b/static/app/views/discover/eventDetails/content.tsx index 3be1557ecb673b..bda987579c3ea4 100644 --- a/static/app/views/discover/eventDetails/content.tsx +++ b/static/app/views/discover/eventDetails/content.tsx @@ -114,7 +114,7 @@ function EventDetailsContent(props: Props) { const transactionSummaryTarget = event.type === 'transaction' && transactionName ? transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: event.projectID, query: location.query, diff --git a/static/app/views/discover/utils.tsx b/static/app/views/discover/utils.tsx index 50f7f69749e59b..97e8e636c1b354 100644 --- a/static/app/views/discover/utils.tsx +++ b/static/app/views/discover/utils.tsx @@ -794,7 +794,7 @@ export function getTargetForTransactionSummaryLink( } const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: String(dataRow.transaction), projectID, query: nextView?.getPageFiltersQuery() || {}, diff --git a/static/app/views/explore/tables/tracesTable/fieldRenderers.tsx b/static/app/views/explore/tables/tracesTable/fieldRenderers.tsx index 4543daff06773b..b09ac7dda95b8e 100644 --- a/static/app/views/explore/tables/tracesTable/fieldRenderers.tsx +++ b/static/app/views/explore/tables/tracesTable/fieldRenderers.tsx @@ -482,7 +482,7 @@ export function TransactionRenderer({ const {projects} = useProjects({slugs: [projectSlug]}); const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, query: { ...location.query, diff --git a/static/app/views/insights/browser/webVitals/views/pageOverview.tsx b/static/app/views/insights/browser/webVitals/views/pageOverview.tsx index b5b632ad129e5a..8b5621a36186cd 100644 --- a/static/app/views/insights/browser/webVitals/views/pageOverview.tsx +++ b/static/app/views/insights/browser/webVitals/views/pageOverview.tsx @@ -137,7 +137,7 @@ export function PageOverview() { !Array.isArray(location.query.project) && // Only render button to transaction summary when one project is selected. transaction && transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, query: {...location.query}, projectID: project.id, diff --git a/static/app/views/insights/common/components/sampleDrawerHeaderTransaction.tsx b/static/app/views/insights/common/components/sampleDrawerHeaderTransaction.tsx index 522f184de7a009..ada84c8150cbd7 100644 --- a/static/app/views/insights/common/components/sampleDrawerHeaderTransaction.tsx +++ b/static/app/views/insights/common/components/sampleDrawerHeaderTransaction.tsx @@ -50,7 +50,7 @@ export function SampleDrawerHeaderTransaction(props: SampleDrawerHeaderProps) { {project ? ( transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, projectID: selection.projects.map(p => String(p)), query: { diff --git a/static/app/views/organizationStats/teamInsights/teamMisery.tsx b/static/app/views/organizationStats/teamInsights/teamMisery.tsx index bc7e8a8ef89f2c..98baed48a401c0 100644 --- a/static/app/views/organizationStats/teamInsights/teamMisery.tsx +++ b/static/app/views/organizationStats/teamInsights/teamMisery.tsx @@ -132,7 +132,7 @@ function TeamMisery({ { location, }) : transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: String(dataRow.transaction) || '', query: summaryView.generateQueryStringObject(), projectID, diff --git a/static/app/views/performance/traceDetails/styles.tsx b/static/app/views/performance/traceDetails/styles.tsx index 1b52e66a0d8273..b31a9aa983b037 100644 --- a/static/app/views/performance/traceDetails/styles.tsx +++ b/static/app/views/performance/traceDetails/styles.tsx @@ -100,7 +100,6 @@ export function Tags({ return null; } - const orgSlug = organization.slug; const renderText = showingAll ? t('Show less') : t('Show more') + '...'; return ( @@ -114,7 +113,7 @@ export function Tags({ if (isTraceTransaction(event)) { const route = transactionSummaryRouteWithQuery({ - orgSlug, + organization, transaction: event.transaction, projectID: String(event.project_id), query: { diff --git a/static/app/views/performance/traceDetails/traceViewDetailPanel.tsx b/static/app/views/performance/traceDetails/traceViewDetailPanel.tsx index d90f4ff4181c33..e3585045b73b42 100644 --- a/static/app/views/performance/traceDetails/traceViewDetailPanel.tsx +++ b/static/app/views/performance/traceDetails/traceViewDetailPanel.tsx @@ -355,7 +355,7 @@ function EventDetails({detail, organization, location}: EventDetailProps) { { const {location, organization, transaction} = this.props; const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transaction.transaction, query: omit(location.query, Object.values(PAGE_URL_PARAM)), projectID: String(transaction.project_id), diff --git a/static/app/views/performance/transactionDetails/content.tsx b/static/app/views/performance/transactionDetails/content.tsx index 913b0ee5ed1376..262c8650952c6a 100644 --- a/static/app/views/performance/transactionDetails/content.tsx +++ b/static/app/views/performance/transactionDetails/content.tsx @@ -100,7 +100,7 @@ function EventDetailsContent(props: Props) { query: appendTagCondition(query, formatTagKey(tag.key), tag.value), }; return transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: event.title, projectID: event.projectID, query: newQuery, diff --git a/static/app/views/performance/transactionSummary/aggregateSpanWaterfall/utils.tsx b/static/app/views/performance/transactionSummary/aggregateSpanWaterfall/utils.tsx index d9cefb22717186..1f1aae4be426f4 100644 --- a/static/app/views/performance/transactionSummary/aggregateSpanWaterfall/utils.tsx +++ b/static/app/views/performance/transactionSummary/aggregateSpanWaterfall/utils.tsx @@ -1,24 +1,25 @@ import type {Query} from 'history'; +import type {Organization} from 'sentry/types/organization'; import {decodeScalar} from 'sentry/utils/queryString'; import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import type {DomainView} from 'sentry/views/insights/pages/useFilters'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; export function aggregateWaterfallRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { - const pathname = `${getTransactionSummaryBaseUrl(orgSlug, view)}/aggregateWaterfall/`; + const pathname = `${getTransactionSummaryBaseUrl(organization, view)}/aggregateWaterfall/`; const filter = decodeScalar(query.query); let httpMethod: string | undefined = undefined; diff --git a/static/app/views/performance/transactionSummary/header.tsx b/static/app/views/performance/transactionSummary/header.tsx index f98bb43d011bc2..0113f212e7016c 100644 --- a/static/app/views/performance/transactionSummary/header.tsx +++ b/static/app/views/performance/transactionSummary/header.tsx @@ -86,7 +86,7 @@ function TransactionHeader({ } const routeQuery = { - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: projectId, query: location.query, @@ -112,7 +112,7 @@ function TransactionHeader({ return transactionSummaryRouteWithQuery(routeQuery); } }, - [location.query, organization.slug, projectId, transactionName, view] + [location.query, organization, projectId, transactionName, view] ); const onTabChange = useCallback( diff --git a/static/app/views/performance/transactionSummary/pageLayout.tsx b/static/app/views/performance/transactionSummary/pageLayout.tsx index 6365c831439645..658c5d0d72410d 100644 --- a/static/app/views/performance/transactionSummary/pageLayout.tsx +++ b/static/app/views/performance/transactionSummary/pageLayout.tsx @@ -129,7 +129,7 @@ function PageLayout(props: Props) { } const routeQuery = { - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: projectId, query: location.query, @@ -151,7 +151,7 @@ function PageLayout(props: Props) { return aggregateWaterfallRouteWithQuery(routeQuery); case Tab.WEB_VITALS: return vitalsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: decodeScalar(location.query.project), query: location.query, @@ -161,7 +161,7 @@ function PageLayout(props: Props) { return transactionSummaryRouteWithQuery(routeQuery); } }, - [location.query, organization.slug, projectId, transactionName] + [location.query, organization, projectId, transactionName] ); const onTabChange = useCallback( @@ -237,7 +237,7 @@ function PageLayout(props: Props) { projects={selectableProjects} router={router} nextPath={{ - pathname: generateTransactionSummaryRoute({orgSlug: organization.slug}), + pathname: generateTransactionSummaryRoute({organization}), query: { project: projectId, transaction: transactionName, diff --git a/static/app/views/performance/transactionSummary/transactionEvents/utils.tsx b/static/app/views/performance/transactionSummary/transactionEvents/utils.tsx index 207846ec930428..068a5916b7f3ca 100644 --- a/static/app/views/performance/transactionSummary/transactionEvents/utils.tsx +++ b/static/app/views/performance/transactionSummary/transactionEvents/utils.tsx @@ -1,6 +1,7 @@ import type {Location, Query} from 'history'; import {t} from 'sentry/locale'; +import type {Organization} from 'sentry/types/organization'; import type {TableDataRow} from 'sentry/utils/discover/discoverQuery'; import type EventView from 'sentry/utils/discover/eventView'; import type {QueryFieldValue} from 'sentry/utils/discover/fields'; @@ -88,19 +89,19 @@ export function getEventsFilterOptions( } export function eventsRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { - const pathname = `${getTransactionSummaryBaseUrl(orgSlug, view)}/events/`; + const pathname = `${getTransactionSummaryBaseUrl(organization, view)}/events/`; return { pathname, query: { diff --git a/static/app/views/performance/transactionSummary/transactionOverview/suspectSpans.tsx b/static/app/views/performance/transactionSummary/transactionOverview/suspectSpans.tsx index 603bf9273bd039..4a8a8ad6806dfa 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/suspectSpans.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/suspectSpans.tsx @@ -99,7 +99,7 @@ function SuspectSpansHeader(props: HeaderProps) { const navigate = useNavigate(); const viewAllTarget = spansRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: projectId, query: location.query, diff --git a/static/app/views/performance/transactionSummary/transactionOverview/tagExplorer.tsx b/static/app/views/performance/transactionSummary/transactionOverview/tagExplorer.tsx index d4e3f4b1478ba7..8bc50c566a4fe4 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/tagExplorer.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/tagExplorer.tsx @@ -330,7 +330,7 @@ export class TagExplorer extends Component { if (column.key === 'key') { const target = tagsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: decodeScalar(location.query.project), query: {...location.query, tagKey: dataRow.tags_key}, @@ -501,7 +501,7 @@ function TagsHeader(props: HeaderProps) { }; const viewAllTarget = tagsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: decodeScalar(location.query.project), query: {...location.query}, diff --git a/static/app/views/performance/transactionSummary/transactionOverview/userStats.tsx b/static/app/views/performance/transactionSummary/transactionOverview/userStats.tsx index a1aded46e3cb83..b919c05a756abc 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/userStats.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/userStats.tsx @@ -78,7 +78,7 @@ function UserStats({ const orgSlug = organization.slug; let webVitalsTarget: LocationDescriptor = vitalsRouteWithQuery({ - orgSlug, + organization, transaction: transactionName, projectID: decodeScalar(location.query.project), query: location.query, diff --git a/static/app/views/performance/transactionSummary/transactionProfiles/utils.ts b/static/app/views/performance/transactionSummary/transactionProfiles/utils.ts index 84ad178971f75b..e007b86a04405a 100644 --- a/static/app/views/performance/transactionSummary/transactionProfiles/utils.ts +++ b/static/app/views/performance/transactionSummary/transactionProfiles/utils.ts @@ -1,22 +1,23 @@ import type {Query} from 'history'; +import type {Organization} from 'sentry/types/organization'; import type {DomainView} from 'sentry/views/insights/pages/useFilters'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; export function profilesRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { - const pathname = `${getTransactionSummaryBaseUrl(orgSlug, view)}/profiles/`; + const pathname = `${getTransactionSummaryBaseUrl(organization, view)}/profiles/`; return { pathname, diff --git a/static/app/views/performance/transactionSummary/transactionReplays/utils.ts b/static/app/views/performance/transactionSummary/transactionReplays/utils.ts index 6eb7c0365b70f1..a1e5d5f71bc2d0 100644 --- a/static/app/views/performance/transactionSummary/transactionReplays/utils.ts +++ b/static/app/views/performance/transactionSummary/transactionReplays/utils.ts @@ -1,22 +1,23 @@ import type {Query} from 'history'; +import type {Organization} from 'sentry/types/organization'; import type {DomainView} from 'sentry/views/insights/pages/useFilters'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; export function replaysRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { - const pathname = `${getTransactionSummaryBaseUrl(orgSlug, view)}/replays/`; + const pathname = `${getTransactionSummaryBaseUrl(organization, view)}/replays/`; return { pathname, diff --git a/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/utils.tsx b/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/utils.tsx index 80d20e909f4f52..4ede3353e4bcb7 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/utils.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/utils.tsx @@ -1,31 +1,32 @@ import type {Query} from 'history'; +import type {Organization} from 'sentry/types/organization'; import type {SpanSlug} from 'sentry/utils/performance/suspectSpans/types'; import type {DomainView} from 'sentry/views/insights/pages/useFilters'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; function generateSpanDetailsRoute({ - orgSlug, + organization, spanSlug, view, }: { - orgSlug: string; + organization: Organization; spanSlug: SpanSlug; view?: DomainView; }): string { const spanComponent = `${encodeURIComponent(spanSlug.op)}:${spanSlug.group}`; - return `${getTransactionSummaryBaseUrl(orgSlug, view)}/spans/${spanComponent}/`; + return `${getTransactionSummaryBaseUrl(organization, view)}/spans/${spanComponent}/`; } export function spanDetailsRouteWithQuery({ - orgSlug, + organization, transaction, query, spanSlug, projectID, view, }: { - orgSlug: string; + organization: Organization; query: Query; spanSlug: SpanSlug; transaction: string; @@ -33,7 +34,7 @@ export function spanDetailsRouteWithQuery({ view?: DomainView; }) { const pathname = generateSpanDetailsRoute({ - orgSlug, + organization, spanSlug, view, }); diff --git a/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx b/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx index b3ae86525a3897..56d3cb94ae51e6 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx @@ -196,7 +196,7 @@ function renderBodyCell( return function (column: Column, dataRow: DataRow): React.ReactNode { if (column.key === SpanMetricsField.SPAN_OP) { const target = spanDetailsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, query: location.query, spanSlug: {op: dataRow['span.op'], group: ''}, @@ -217,7 +217,7 @@ function renderBodyCell( } const target = spanDetailsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, query: location.query, spanSlug: {op: dataRow['span.op'], group: dataRow['span.group']}, diff --git a/static/app/views/performance/transactionSummary/transactionSpans/suspectSpansTable.tsx b/static/app/views/performance/transactionSummary/transactionSpans/suspectSpansTable.tsx index b5a7c443be6217..42b941facad324 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/suspectSpansTable.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/suspectSpansTable.tsx @@ -106,7 +106,7 @@ function renderBodyCellWithMeta( if (column.key === 'description') { const target = spanDetailsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, query: location.query, spanSlug: {op: dataRow.operation, group: dataRow.group}, diff --git a/static/app/views/performance/transactionSummary/transactionSpans/utils.tsx b/static/app/views/performance/transactionSummary/transactionSpans/utils.tsx index 9a667ec0a6bbc6..ac88aa0e68d5a9 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/utils.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/utils.tsx @@ -3,6 +3,7 @@ import pick from 'lodash/pick'; import {DEFAULT_RELATIVE_PERIODS} from 'sentry/constants'; import {t} from 'sentry/locale'; +import type {Organization} from 'sentry/types/organization'; import {defined} from 'sentry/utils'; import EventView from 'sentry/utils/discover/eventView'; import {isAggregateField} from 'sentry/utils/discover/fields'; @@ -16,30 +17,30 @@ import type {SpanSort, SpanSortOption} from './types'; import {SpanSortOthers, SpanSortPercentiles} from './types'; export function generateSpansRoute({ - orgSlug, + organization, view, }: { - orgSlug: string; + organization: Organization; view?: DomainView; }): string { - return `${getTransactionSummaryBaseUrl(orgSlug, view)}/spans/`; + return `${getTransactionSummaryBaseUrl(organization, view)}/spans/`; } export function spansRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { const pathname = generateSpansRoute({ - orgSlug, + organization, view, }); diff --git a/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx b/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx index 975682a1469cb2..2cc2e8534eca19 100644 --- a/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx +++ b/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx @@ -339,7 +339,7 @@ function TagsHeatMap( } const moreEventsTarget = eventsRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, projectID: decodeScalar(location.query.project), query: { diff --git a/static/app/views/performance/transactionSummary/transactionTags/utils.tsx b/static/app/views/performance/transactionSummary/transactionTags/utils.tsx index f34a2472840d79..f5a8b2c3e07ade 100644 --- a/static/app/views/performance/transactionSummary/transactionTags/utils.tsx +++ b/static/app/views/performance/transactionSummary/transactionTags/utils.tsx @@ -7,13 +7,13 @@ import type {DomainView} from 'sentry/views/insights/pages/useFilters'; import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transactionSummary/utils'; export function generateTagsRoute({ - orgSlug, + organization, view, }: { - orgSlug: string; + organization: Organization; view?: DomainView; }): string { - return `${getTransactionSummaryBaseUrl(orgSlug, view)}/tags/`; + return `${getTransactionSummaryBaseUrl(organization, view)}/tags/`; } export function decodeSelectedTagKey(location: Location): string | undefined { @@ -25,20 +25,20 @@ export function trackTagPageInteraction(organization: Organization) { } export function tagsRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; view?: DomainView; }) { const pathname = generateTagsRoute({ - orgSlug, + organization, view, }); diff --git a/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx b/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx index 285c6d6f11699a..45a90ca1dfd49d 100644 --- a/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx +++ b/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx @@ -237,7 +237,7 @@ class TransactionThresholdModal extends Component { const summaryView = eventView.clone(); summaryView.query = summaryView.getQueryWithAdditionalConditions(); const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transactionName, query: summaryView.generateQueryStringObject(), projectID: project?.id, diff --git a/static/app/views/performance/transactionSummary/transactionVitals/utils.tsx b/static/app/views/performance/transactionSummary/transactionVitals/utils.tsx index e2c852c0d6efb7..51292213e9b5a4 100644 --- a/static/app/views/performance/transactionSummary/transactionVitals/utils.tsx +++ b/static/app/views/performance/transactionSummary/transactionVitals/utils.tsx @@ -1,6 +1,7 @@ import type {ECharts} from 'echarts'; import type {Query} from 'history'; +import type {Organization} from 'sentry/types/organization'; import type {WebVital} from 'sentry/utils/fields'; import type {HistogramData} from 'sentry/utils/performance/histogram/types'; import {getBucketWidth} from 'sentry/utils/performance/histogram/utils'; @@ -9,23 +10,27 @@ import {getTransactionSummaryBaseUrl} from 'sentry/views/performance/transaction import type {Point, Rectangle} from './types'; -export function generateVitalsRoute({orgSlug}: {orgSlug: string}): string { - return `${getTransactionSummaryBaseUrl(orgSlug)}/vitals/`; +export function generateVitalsRoute({ + organization, +}: { + organization: Organization; +}): string { + return `${getTransactionSummaryBaseUrl(organization)}/vitals/`; } export function vitalsRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; projectID?: string | string[]; }) { const pathname = generateVitalsRoute({ - orgSlug, + organization, }); return { diff --git a/static/app/views/performance/transactionSummary/transactionVitals/vitalCard.tsx b/static/app/views/performance/transactionSummary/transactionVitals/vitalCard.tsx index fb4d07aeb02218..08ec67b58390f4 100644 --- a/static/app/views/performance/transactionSummary/transactionVitals/vitalCard.tsx +++ b/static/app/views/performance/transactionSummary/transactionVitals/vitalCard.tsx @@ -212,7 +212,7 @@ class VitalCard extends Component { to={newEventView .withColumns([{kind: 'field', field: column}]) .withSorts([{kind: 'desc', field: column}]) - .getPerformanceTransactionEventsViewUrlTarget(organization.slug, { + .getPerformanceTransactionEventsViewUrlTarget(organization, { showTransactions: dataFilter === 'all' ? EventsDisplayFilterName.P100 diff --git a/static/app/views/performance/transactionSummary/utils.tsx b/static/app/views/performance/transactionSummary/utils.tsx index c59a22c61d2b00..4914879bfdc03b 100644 --- a/static/app/views/performance/transactionSummary/utils.tsx +++ b/static/app/views/performance/transactionSummary/utils.tsx @@ -37,15 +37,15 @@ export enum TransactionFilterOptions { } export function generateTransactionSummaryRoute({ - orgSlug, + organization, subPath, view, }: { - orgSlug: string; + organization: Organization; subPath?: string; view?: DomainView; // TODO - this should be mantatory once we release domain view }): string { - return `${getTransactionSummaryBaseUrl(orgSlug, view)}/${subPath ? `${subPath}/` : ''}`; + return `${getTransactionSummaryBaseUrl(organization, view)}/${subPath ? `${subPath}/` : ''}`; } // normalizes search conditions by removing any redundant search conditions before presenting them in: @@ -73,7 +73,7 @@ export function normalizeSearchConditionsWithTransactionName( } export function transactionSummaryRouteWithQuery({ - orgSlug, + organization, transaction, projectID, query, @@ -86,7 +86,7 @@ export function transactionSummaryRouteWithQuery({ subPath, view, }: { - orgSlug: string; + organization: Organization; query: Query; transaction: string; additionalQuery?: Record; @@ -100,7 +100,7 @@ export function transactionSummaryRouteWithQuery({ view?: DomainView; }) { const pathname = generateTransactionSummaryRoute({ - orgSlug, + organization, subPath, view, }); @@ -266,11 +266,11 @@ export function generateReplayLink(routes: Array>) { } export function getTransactionSummaryBaseUrl( - orgSlug: string, + organization: Organization, view?: DomainView, bare: boolean = false ) { - return `${getPerformanceBaseUrl(orgSlug, view, bare)}/summary`; + return `${getPerformanceBaseUrl(organization.slug, view, bare)}/summary`; } export const SidebarSpacer = styled('div')` diff --git a/static/app/views/performance/trends/changedTransactions.tsx b/static/app/views/performance/trends/changedTransactions.tsx index 37598ec3b06d72..6f832e632fb952 100644 --- a/static/app/views/performance/trends/changedTransactions.tsx +++ b/static/app/views/performance/trends/changedTransactions.tsx @@ -577,7 +577,7 @@ function TransactionSummaryLink(props: TransactionSummaryLinkProps) { const summaryView = eventView.clone(); const projectID = getTrendProjectId(transaction, projects); const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: String(transaction.transaction), query: summaryView.generateQueryStringObject(), projectID, diff --git a/static/app/views/performance/vitalDetail/table.tsx b/static/app/views/performance/vitalDetail/table.tsx index c457549654e954..2bdce08da4ab95 100644 --- a/static/app/views/performance/vitalDetail/table.tsx +++ b/static/app/views/performance/vitalDetail/table.tsx @@ -163,7 +163,7 @@ class Table extends Component { const transaction = String(dataRow.transaction) || ''; const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, query: summaryView.generateQueryStringObject(), projectID, diff --git a/static/app/views/profiling/profileSummary/index.tsx b/static/app/views/profiling/profileSummary/index.tsx index 652cd1654846b9..1c24326bfd3d69 100644 --- a/static/app/views/profiling/profileSummary/index.tsx +++ b/static/app/views/profiling/profileSummary/index.tsx @@ -127,7 +127,7 @@ function ProfileSummaryHeader(props: ProfileSummaryHeaderProps) { props.project && props.transaction && transactionSummaryRouteWithQuery({ - orgSlug: props.organization.slug, + organization: props.organization, transaction: props.transaction, projectID: props.project.id, query: {query: props.query}, diff --git a/static/app/views/releases/detail/overview/index.tsx b/static/app/views/releases/detail/overview/index.tsx index d898bc33c92c44..72107d48346403 100644 --- a/static/app/views/releases/detail/overview/index.tsx +++ b/static/app/views/releases/detail/overview/index.tsx @@ -662,7 +662,7 @@ function generateTransactionLink( const {start, end, period} = datetime; return transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction: transaction! as string, query: { query: trendTransaction ? '' : `release:${version}`, diff --git a/static/app/views/traces/fieldRenderers.tsx b/static/app/views/traces/fieldRenderers.tsx index c1dbc84b3f8e75..e1d3831f66393d 100644 --- a/static/app/views/traces/fieldRenderers.tsx +++ b/static/app/views/traces/fieldRenderers.tsx @@ -493,7 +493,7 @@ export function TransactionRenderer({ const {projects} = useProjects({slugs: [projectSlug]}); const target = transactionSummaryRouteWithQuery({ - orgSlug: organization.slug, + organization, transaction, query: { ...location.query, From d5757c74920057cc2dab351d8d474008cb66990e Mon Sep 17 00:00:00 2001 From: Dominik Buszowiecki Date: Wed, 29 Jan 2025 10:49:47 -0500 Subject: [PATCH 2/3] fix test --- static/app/utils/discover/eventView.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/utils/discover/eventView.spec.tsx b/static/app/utils/discover/eventView.spec.tsx index b8d3778b8db2fb..09072be48caa31 100644 --- a/static/app/utils/discover/eventView.spec.tsx +++ b/static/app/utils/discover/eventView.spec.tsx @@ -3123,7 +3123,7 @@ describe('EventView.getPerformanceTransactionEventsViewUrlTarget()', function () it('generates a URL with non-customer domain context', function () { ConfigStore.set('customerDomain', null); const view = new EventView(state); - const result = view.getPerformanceTransactionEventsViewUrlTarget(organization.slug, { + const result = view.getPerformanceTransactionEventsViewUrlTarget(organization, { showTransactions, breakdown, webVital, From fa33d5ae28f31460f2aa14a3c3e44f7df9ad2196 Mon Sep 17 00:00:00 2001 From: Dominik Buszowiecki Date: Wed, 29 Jan 2025 10:52:32 -0500 Subject: [PATCH 3/3] fix tests --- .../transactionSpans/spanDetails/index.spec.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/index.spec.tsx b/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/index.spec.tsx index 3ca967c780a1c7..fd894c8fde1477 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/index.spec.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/spanDetails/index.spec.tsx @@ -1,3 +1,5 @@ +import {OrganizationFixture} from 'sentry-fixture/organization'; + import { generateSuspectSpansResponse, initializeData as _initializeData, @@ -648,8 +650,9 @@ describe('Performance > Transaction Spans > Span Summary', function () { describe('spanDetailsRouteWithQuery', function () { it('should encode slashes in span op', function () { + const organization = OrganizationFixture(); const target = spanDetailsRouteWithQuery({ - orgSlug: 'org-slug', + organization, transaction: 'transaction', query: {}, spanSlug: {op: 'o/p', group: 'aaaaaaaaaaaaaaaa'},