Skip to content

Commit

Permalink
feat(issues): Display event details w/ tag drawer (#79943)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Oct 29, 2024
1 parent 5aa4a7c commit 6b87ddf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion static/app/views/issueDetails/groupTagValues.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from 'sentry-test/reactTestingLibrary';

import {browserHistory} from 'sentry/utils/browserHistory';
import GroupTagValues from 'sentry/views/issueDetails/groupTagValues';
import {GroupTagValues} from 'sentry/views/issueDetails/groupTagValues';

const group = GroupFixture();
const tags = TagsFixture();
Expand Down
19 changes: 17 additions & 2 deletions static/app/views/issueDetails/groupTagValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import {useLocation} from 'sentry/utils/useLocation';
import useOrganization from 'sentry/utils/useOrganization';
import {useParams} from 'sentry/utils/useParams';
import {hasDatasetSelector} from 'sentry/views/dashboards/utils';
import GroupEventDetails, {
type GroupEventDetailsProps,
} from 'sentry/views/issueDetails/groupEventDetails/groupEventDetails';
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';

type RouteParams = {
groupId: string;
Expand Down Expand Up @@ -97,7 +101,7 @@ function useTagQueries({
};
}

function GroupTagValues({baseUrl, project, group, environments}: Props) {
export function GroupTagValues({baseUrl, project, group, environments}: Props) {
const organization = useOrganization();
const location = useLocation();
const {orgId, tagKey = ''} = useParams<RouteParams>();
Expand Down Expand Up @@ -314,7 +318,16 @@ function GroupTagValues({baseUrl, project, group, environments}: Props) {
);
}

export default GroupTagValues;
function GroupTagValuesRoute(props: GroupEventDetailsProps & {baseUrl: string}) {
const hasStreamlinedUI = useHasStreamlinedUI();

// TODO(streamlined-ui): Point the router directly to group event details
if (hasStreamlinedUI) {
return <GroupEventDetails {...props} />;
}

return <GroupTagValues {...props} />;
}

const TitleWrapper = styled('div')`
display: flex;
Expand Down Expand Up @@ -390,3 +403,5 @@ const RightAlignColumn = styled(Column)`
const StyledPagination = styled(Pagination)`
margin: 0;
`;

export default GroupTagValuesRoute;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {TagsFixture} from 'sentry-fixture/tags';
import {initializeOrg} from 'sentry-test/initializeOrg';
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';

import GroupTagsTab from './groupTagsTab';
import {GroupTagsTab} from './groupTagsTab';

describe('GroupTagsTab', function () {
const {routerProps, router, organization} = initializeOrg();
Expand Down
23 changes: 20 additions & 3 deletions static/app/views/issueDetails/groupTags/groupTagsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {space} from 'sentry/styles/space';
import type {Group} from 'sentry/types/group';
import {percent} from 'sentry/utils';
import {useLocation} from 'sentry/utils/useLocation';
import GroupEventDetails, {
type GroupEventDetailsProps,
} from 'sentry/views/issueDetails/groupEventDetails/groupEventDetails';
import {useGroupTags} from 'sentry/views/issueDetails/groupTags/useGroupTags';
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';

type GroupTagsProps = {
baseUrl: string;
Expand All @@ -38,7 +42,7 @@ type SimpleTag = {
totalValues: number;
};

function GroupTagsTab({group, baseUrl, environments}: GroupTagsProps) {
export function GroupTagsTab({group, baseUrl, environments}: GroupTagsProps) {
const location = useLocation();

const {
Expand Down Expand Up @@ -132,6 +136,21 @@ function GroupTagsTab({group, baseUrl, environments}: GroupTagsProps) {
);
}

function GroupTagsRoute(
props: GroupEventDetailsProps & {baseUrl: string; environments: string[]}
) {
const hasStreamlinedUI = useHasStreamlinedUI();

// TODO(streamlined-ui): Point the router to group event details
if (hasStreamlinedUI) {
return <GroupEventDetails {...props} />;
}

return <GroupTagsTab {...props} />;
}

export default GroupTagsRoute;

const Container = styled('div')`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
Expand Down Expand Up @@ -205,5 +224,3 @@ const TagBarCount = styled('div')`
padding-right: ${space(1)};
font-variant-numeric: tabular-nums;
`;

export default GroupTagsTab;

0 comments on commit 6b87ddf

Please sign in to comment.