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

fix(issues): Remove redundant trace link #86160

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ describe('EventTraceView', () => {
<EventTraceView group={perfGroup} event={perfEvent} organization={organization} />
);
expect(await screen.findByText('Trace Preview')).toBeInTheDocument();
expect(
await screen.findByRole('link', {name: 'View Full Trace'})
).toBeInTheDocument();
expect(
screen.getByText('One other issue appears in the same trace.')
).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type {LocationDescriptor} from 'history';

import {LinkButton} from 'sentry/components/button';
import ExternalLink from 'sentry/components/links/externalLink';
import Link from 'sentry/components/links/link';
import {generateTraceTarget} from 'sentry/components/quickTrace/utils';
import {t} from 'sentry/locale';
import type {Event} from 'sentry/types/event';
Expand All @@ -14,7 +13,6 @@ import {defined} from 'sentry/utils';
import {trackAnalytics} from 'sentry/utils/analytics';
import useRouteAnalyticsParams from 'sentry/utils/routeAnalytics/useRouteAnalyticsParams';
import {useLocation} from 'sentry/utils/useLocation';
import useOrganization from 'sentry/utils/useOrganization';
import {SectionKey} from 'sentry/views/issueDetails/streamline/context';
import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection';
import {TraceIssueEvent} from 'sentry/views/issueDetails/traceTimeline/traceIssue';
Expand Down Expand Up @@ -144,34 +142,16 @@ function getHrefFromTraceTarget(traceTarget: LocationDescriptor) {
}

function OneOtherIssueEvent({event}: {event: Event}) {
const location = useLocation();
const organization = useOrganization();
const {isLoading, oneOtherIssueEvent} = useTraceTimelineEvents({event});
useRouteAnalyticsParams(oneOtherIssueEvent ? {has_related_trace_issue: true} : {});

if (isLoading || !oneOtherIssueEvent) {
return null;
}

const traceTarget = generateTraceTarget(
event,
organization,
{
...location,
query: {
...location.query,
groupId: event.groupID,
},
},
TraceViewSources.ISSUE_DETAILS
);

return (
<Fragment>
<span>
{t('One other issue appears in the same trace. ')}
<Link to={traceTarget}>{t('View Full Trace')}</Link>
</span>
<span>{t('One other issue appears in the same trace.')}</span>
<TraceIssueEvent event={oneOtherIssueEvent} />
</Fragment>
);
Expand Down
Loading