Skip to content

Commit

Permalink
feat(issues): Add tag drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Sep 19, 2024
1 parent 74c3f57 commit 56ba1bf
Show file tree
Hide file tree
Showing 5 changed files with 627 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ import theme from 'sentry/utils/theme';
import {useDetailedProject} from 'sentry/utils/useDetailedProject';
import {useLocation} from 'sentry/utils/useLocation';
import useOrganization from 'sentry/utils/useOrganization';
import {useGroupTagsDrawer} from 'sentry/views/issueDetails/groupTags/groupTagsDrawer';
import {SectionKey} from 'sentry/views/issueDetails/streamline/context';
import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection';
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';

interface HighlightsDataSectionProps {
event: Event;
groupId: string;
project: Project;
viewAllRef?: React.RefObject<HTMLElement>;
}
Expand Down Expand Up @@ -253,12 +255,20 @@ function HighlightsData({
export default function HighlightsDataSection({
viewAllRef,
event,
groupId,
project,
}: HighlightsDataSectionProps) {
const organization = useOrganization();
const hasStreamlinedUI = useHasStreamlinedUI();
const openButtonRef = useRef<HTMLButtonElement>(null);
const {openTagsDrawer} = useGroupTagsDrawer({groupId, openButtonRef, project});

const viewAllButton = viewAllRef ? (
const viewAllButton = hasStreamlinedUI ? (
// Streamline details ui has "Jump to" feature, instead we'll show the drawer button
<Button ref={openButtonRef} size="xs" onClick={openTagsDrawer}>
{t('View All Issue Tags')}
</Button>
) : viewAllRef ? (
<Button
onClick={() => {
trackAnalytics('highlights.issue_details.view_all_clicked', {organization});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ export function EventDetailsContent({
project={project}
/>
)}
<HighlightsDataSection event={event} project={project} viewAllRef={tagsRef} />
<HighlightsDataSection
groupId={group.id}
event={event}
project={project}
viewAllRef={tagsRef}
/>
{showPossibleSolutionsHigher && (
<ResourcesAndPossibleSolutionsIssueDetailsContent
event={event}
Expand Down
12 changes: 6 additions & 6 deletions static/app/views/issueDetails/groupTagValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ type Props = {

const DEFAULT_SORT = 'count';

function useTagQueries({
group,
export function useTagQueries({
groupId,
tagKey,
environments,
sort,
cursor,
}: {
group: Group;
groupId: string;
sort: string | string[];
tagKey: string;
cursor?: string;
Expand All @@ -70,15 +70,15 @@ function useTagQueries({
getResponseHeader,
} = useFetchIssueTagValues({
orgSlug: organization.slug,
groupId: group.id,
groupId,
tagKey,
environment: environments,
sort,
cursor,
});
const {data: tag, isError: tagIsError} = useFetchIssueTag({
orgSlug: organization.slug,
groupId: group.id,
groupId,
tagKey,
});

Expand Down Expand Up @@ -108,7 +108,7 @@ function GroupTagValues({baseUrl, project, group, environments}: Props) {
const sortArrow = <IconArrow color="gray300" size="xs" direction="down" />;

const {tagValueList, tag, isLoading, isError, pageLinks} = useTagQueries({
group,
groupId: group.id,
sort,
tagKey,
environments,
Expand Down
Loading

0 comments on commit 56ba1bf

Please sign in to comment.