Skip to content

Commit

Permalink
fix(issues): Remove highlights all tags link (#79247)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Oct 17, 2024
1 parent bca4b1d commit f4d7b1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 31 deletions.
41 changes: 13 additions & 28 deletions static/app/components/events/highlights/highlightsDataSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled from '@emotion/styled';

import {openModal} from 'sentry/actionCreators/modal';
import {hasEveryAccess} from 'sentry/components/acl/access';
import {Button, LinkButton} from 'sentry/components/button';
import {Button} from 'sentry/components/button';
import ButtonBar from 'sentry/components/buttonBar';
import ErrorBoundary from 'sentry/components/errorBoundary';
import {ContextCardContent} from 'sentry/components/events/contexts/contextCard';
Expand Down Expand Up @@ -37,8 +37,6 @@ 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 {Tab, TabPaths} from 'sentry/views/issueDetails/types';
import {useGroupDetailsRoute} from 'sentry/views/issueDetails/useGroupDetailsRoute';
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';

interface HighlightsDataSectionProps {
Expand Down Expand Up @@ -259,32 +257,19 @@ export default function HighlightsDataSection({
}: HighlightsDataSectionProps) {
const organization = useOrganization();
const hasStreamlinedUI = useHasStreamlinedUI();
const location = useLocation();
const {baseUrl} = useGroupDetailsRoute();

const viewAllButton = hasStreamlinedUI ? (
// Streamline details ui has "Jump to" feature, instead we'll show the drawer button
<LinkButton
to={{
pathname: `${baseUrl}${TabPaths[Tab.TAGS]}`,
query: location.query,
replace: true,
}}
size="xs"
>
{t('View All Issue Tags')}
</LinkButton>
) : viewAllRef ? (
<Button
onClick={() => {
trackAnalytics('highlights.issue_details.view_all_clicked', {organization});
viewAllRef?.current?.scrollIntoView({behavior: 'smooth'});
}}
size="xs"
>
{t('View All')}
</Button>
) : null;
const viewAllButton =
!hasStreamlinedUI && viewAllRef ? (
<Button
onClick={() => {
trackAnalytics('highlights.issue_details.view_all_clicked', {organization});
viewAllRef?.current?.scrollIntoView({behavior: 'smooth'});
}}
size="xs"
>
{t('View All')}
</Button>
) : null;

return (
<InterimSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ describe('EventNavigation', () => {
expect(screen.queryByText('Jump To:')).not.toBeInTheDocument();
expect(screen.queryByText('Replay')).not.toBeInTheDocument();
expect(screen.queryByText('Tags')).not.toBeInTheDocument();
expect(screen.queryByText('Event Highlights')).not.toBeInTheDocument();
expect(screen.queryByText('Highlights')).not.toBeInTheDocument();
});

it('does show jump to sections when the sections render', () => {
render(<EventNavigation {...defaultProps} />);
expect(screen.getByText('Jump to:')).toBeInTheDocument();
expect(screen.getByText('Event Highlights')).toBeInTheDocument();
expect(screen.getByText('Highlights')).toBeInTheDocument();
expect(screen.getByText('Replay')).toBeInTheDocument();
expect(screen.getByText('Tags')).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const EventNavOrder = [
];

const sectionLabels = {
[SectionKey.HIGHLIGHTS]: t('Event Highlights'),
[SectionKey.HIGHLIGHTS]: t('Highlights'),
[SectionKey.STACKTRACE]: t('Stack Trace'),
[SectionKey.TRACE]: t('Trace'),
[SectionKey.EXCEPTION]: t('Stack Trace'),
Expand Down

0 comments on commit f4d7b1d

Please sign in to comment.