Skip to content

Commit

Permalink
navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Sep 19, 2024
1 parent 56ba1bf commit 091ee87
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions static/app/views/issueDetails/groupTags/groupTagsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled';

import Alert from 'sentry/components/alert';
import ProjectAvatar from 'sentry/components/avatar/projectAvatar';
import {LinkButton} from 'sentry/components/button';
import {Button, LinkButton} from 'sentry/components/button';
import ButtonBar from 'sentry/components/buttonBar';
import Count from 'sentry/components/count';
import DataExport, {ExportQueryType} from 'sentry/components/dataExport';
Expand Down Expand Up @@ -258,6 +258,7 @@ function GroupTagsDrawerTagDetails({groupId, project}: GroupTagsDrawerProps) {
export function GroupTagsDrawer({project, groupId}: GroupTagsDrawerProps) {
const location = useLocation();
const organization = useOrganization();
const navigate = useNavigate();
const tagDrawerKey = location.query.tagDrawerKey as string | undefined;

const {
Expand Down Expand Up @@ -359,17 +360,24 @@ export function GroupTagsDrawer({project, groupId}: GroupTagsDrawerProps) {
<StyledPanel>
<PanelBody withPadding>
<TagHeading>
<Link
to={{
pathname: location.pathname,
query: {
...location.query,
tagDrawerKey: tag.key,
},
<Button
priority="link"
size="zero"
onClick={() => {
navigate(
{
pathname: location.pathname,
query: {
...location.query,
tagDrawerKey: tag.key,
},
},
{replace: true}
);
}}
>
<span data-test-id="tag-title">{tag.key}</span>
</Link>
</Button>
</TagHeading>
<UnstyledUnorderedList>
{tag.topValues.map((tagValue, tagValueIdx) => (
Expand Down Expand Up @@ -432,7 +440,7 @@ export function useGroupTagsDrawer({
drawer.openDrawer(() => <GroupTagsDrawer project={project} groupId={groupId} />, {
ariaLabel: 'tags drawer',
onClose: () => {
if (location.query.attachmentFilter || location.query.cursor) {
if (location.query.tagDrawerSort || location.query.tagDrawerKey) {
// Remove drawer state from URL
navigate(
{
Expand Down

0 comments on commit 091ee87

Please sign in to comment.