Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(insights): pass in organization to getTransactionSummaryBaseUrl #84229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/app/components/discover/transactionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class _TransactionsList extends Component<Props> {
<LinkButton
onClick={handleOpenAllEventsClick}
to={this.generatePerformanceTransactionEventsView().getPerformanceTransactionEventsViewUrlTarget(
organization.slug,
organization,
{
showTransactions: mapShowTransactionToPercentile(showTransactions),
breakdown,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function getTraceContextData({
}

const link = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: transactionName,
projectID: event.projectID,
query: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function EventCustomPerformanceMetric({
switch (source) {
case EventDetailPageSource.PERFORMANCE:
return transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: event.title,
projectID: event.projectID,
query: {query},
Expand Down Expand Up @@ -231,7 +231,7 @@ export function TraceEventCustomPerformanceMetric({
switch (source) {
case EventDetailPageSource.PERFORMANCE:
return transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: event.title,
projectID: event.projectID,
query: {query},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function AggregateSpanDiff({event, project}: AggregateSpanDiffProps) {
defaultValue: t('(unnamed span)'),
link: (dataRow: any) => ({
target: spanDetailsRouteWithQuery({
orgSlug: organization.slug,
organization,
spanSlug: {op: dataRow.operation, group: dataRow.group},
transaction,
projectID: project.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function EventStatisticalDetectorRegressedPerformanceMessage({
});

const transactionSummaryLink = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction,
query: {},
trendFunction: 'p95',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function EventTagsContent({
<EventTagsValue
tag={tag}
meta={meta?.value?.['']}
streamPath={`${getTransactionSummaryBaseUrl(organization.slug)}/`}
streamPath={`${getTransactionSummaryBaseUrl(organization)}/`}
locationSearch={`?${qs.stringify({
project: projectId,
transaction: value,
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/events/eventTags/eventTagsTreeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function EventTagsTreeRowDropdown({
to:
originalTag.key === 'transaction'
? {
pathname: `${getTransactionSummaryBaseUrl(organization.slug)}/`,
pathname: `${getTransactionSummaryBaseUrl(organization)}/`,
query: {
project: event.projectID,
transaction: content.value,
Expand Down Expand Up @@ -297,7 +297,7 @@ function EventTagsTreeValue({
transaction: content.value,
referrer,
});
const transactionDestination = `${getTransactionSummaryBaseUrl(organization.slug)}/?${transactionQuery}`;
const transactionDestination = `${getTransactionSummaryBaseUrl(organization)}/?${transactionQuery}`;
tagValue = (
<TagLinkText>
<Link to={transactionDestination}>{content.value}</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function MainThreadFunctionEvidence({

if (evidenceData.transactionName) {
const transactionSummaryLocation = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
projectID: event.projectID,
transaction: evidenceData.transactionName,
query: {},
Expand Down Expand Up @@ -466,7 +466,7 @@ const makeTransactionNameRow = (
projectSlug?: string
) => {
const transactionSummaryLocation = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
projectID: event.projectID,
transaction: event.title,
query: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -267,7 +267,7 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) {
<LinkButton
size="xs"
to={spanDetailsRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: transactionName,
query: location.query,
spanSlug: {op: props.node.value.op, group: groupHash},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function SpanDetail(props: Props) {
}

const target = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: transactionResult.transaction,
query: omit(location.query, Object.values(PAGE_URL_PARAM)),
projectID: String(childTransaction.project_id),
Expand Down Expand Up @@ -276,7 +276,7 @@ function SpanDetail(props: Props) {
<LinkButton
size="xs"
to={spanDetailsRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: transactionName,
query: location.query,
spanSlug: {op: span.op, group: span.hash},
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/metrics/metricSamplesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ function SpanId({
}, [duration, selfTime, durationColor, selfTimeColor]);

const transactionSummaryTarget = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction,
query: {
...location.query,
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/performance/searchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function SearchBar(props: SearchBarProps) {
setSearchResults([]);

const next = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction,
projectID: String(project_id),
query,
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/profiling/profileEventsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function ProfileEventsCell<F extends FieldType>(props: ProfileEventsCellProps<F>
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,
});
Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/discover/eventView.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions static/app/utils/discover/eventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -1265,7 +1265,7 @@ class EventView {
}

getPerformanceTransactionEventsViewUrlTarget(
slug: string,
organization: Organization,
options: {
breakdown?: SpanOperationBreakdownFilter;
showTransactions?: EventsDisplayFilterName;
Expand Down Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function RelatedTransactions({
summaryView.query = summaryConditions;

const target = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: String(dataRow.transaction) || '',
query: summaryView.generateQueryStringObject(),
projectID,
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/discover/eventDetails/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/discover/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ export function getTargetForTransactionSummaryLink(
}

const target = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: String(dataRow.transaction),
projectID,
query: nextView?.getPageFiltersQuery() || {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ export function TransactionRenderer({
const {projects} = useProjects({slugs: [projectSlug]});

const target = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction,
query: {
...location.query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function SampleDrawerHeaderTransaction(props: SampleDrawerHeaderProps) {
{project ? (
<TruncatedLink
to={{
pathname: getTransactionSummaryBaseUrl(organization.slug, view),
pathname: getTransactionSummaryBaseUrl(organization, view),
search: qs.stringify({
project: project.slug,
transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function SampleList({groupId, moduleName, transactionRoute, referrer}: Pr
undefined
);

transactionRoute ??= `/${getTransactionSummaryBaseUrl(organization.slug, view, true)}`;
transactionRoute ??= `/${getTransactionSummaryBaseUrl(organization, view, true)}`;

// eslint-disable-next-line react-hooks/exhaustive-deps
const debounceSetHighlightedSpanId = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function SpanSamplesPanel({groupId, moduleName, transactionRoute}: Props)
...(deviceClass ? {[SpanMetricsField.DEVICE_CLASS]: deviceClass} : {}),
};

transactionRoute ??= getTransactionSummaryBaseUrl(organization.slug, view);
transactionRoute ??= getTransactionSummaryBaseUrl(organization, view);

const {primaryRelease, secondaryRelease} = useReleaseSelection();

Expand Down
2 changes: 1 addition & 1 deletion static/app/views/metrics/summaryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const SummaryTable = memo(function SummaryTable({

const transactionTo = (transaction: string) =>
transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction,
projectID: selection.projects.map(p => String(p)),
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function TeamMisery({
<TransactionWrapper>
<Link
to={transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: dataRow.transaction as string,
projectID: project?.id,
query: {query: 'transaction.duration:<15m'},
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/performance/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const getTabCrumbs = ({
}

const routeQuery = {
orgSlug: organization.slug,
organization,
transaction: transaction.name,
projectID: transaction.project,
query: location.query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export function LineChartListWidget(props: PerformanceWidgetProps) {
location,
})
: transactionSummaryRouteWithQuery({
orgSlug: props.organization.slug,
organization: props.organization,
projectID: listItem['project.id'] as string,
transaction,
query: props.eventView.getPageFiltersQuery(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export function StackedAreaChartListWidget(props: PerformanceWidgetProps) {
location,
})
: transactionSummaryRouteWithQuery({
orgSlug: props.organization.slug,
organization: props.organization,
projectID: listItem['project.id'] as string,
transaction,
query: props.eventView.generateQueryStringObject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function TrendsWidget(props: PerformanceWidgetProps) {
});

const transactionTarget = transactionSummaryRouteWithQuery({
orgSlug: props.organization.slug,
organization: props.organization,
projectID: getProjectID(listItem, projects),
transaction: listItem.transaction,
query: trendsTarget.query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export function VitalWidget(props: PerformanceWidgetProps) {

const isUnparameterizedRow = transaction === UNPARAMETERIZED_TRANSACTION;
const transactionTarget = transactionSummaryRouteWithQuery({
orgSlug: props.organization.slug,
organization: props.organization,
projectID: listItem['project.id'] as string,
transaction: listItem.transaction as string,
query: _eventView.generateQueryStringObject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function SpanChild({
}

const target = transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: transactionResult.transaction,
query: omit(location.query, Object.values(PAGE_URL_PARAM)),
projectID: String(childTransaction.value.project_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function SpanDescription({
<SpanSummaryLink event={node.event!} organization={organization} span={span} />
<Link
to={spanDetailsRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: node.event?.title ?? '',
query: location.query,
spanSlug: {op: span.op, group: groupHash},
Expand Down Expand Up @@ -387,7 +387,7 @@ function LegacySpanDescription({
<LinkButton
size="xs"
to={spanDetailsRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: node.event?.title ?? '',
query: location.query,
spanSlug: {op: span.op, group: groupHash},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function LegacyGeneralInfo(props: GeneralnfoProps) {
<TraceDrawerComponents.CopyableCardValueWithLink
value={span.description}
linkTarget={spanDetailsRouteWithQuery({
orgSlug: props.organization.slug,
organization: props.organization,
transaction: props.node.event?.title ?? '',
query: props.location.query,
spanSlug: {op: span.op, group: groupHash},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function LegacyGeneralInfo({
<TraceDrawerComponents.CopyableCardValueWithLink
value={node.value.transaction}
linkTarget={transactionSummaryRouteWithQuery({
orgSlug: organization.slug,
organization,
transaction: node.value.transaction,
// Omit the query from the target url, as we dont know where it may have came from
// and if its syntax is supported on the target page. In this example, txn search does
Expand Down
Loading
Loading