Skip to content
Merged
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
61 changes: 0 additions & 61 deletions static/app/components/stream/supergroups/supergroupCheckbox.tsx

This file was deleted.

54 changes: 8 additions & 46 deletions static/app/components/stream/supergroups/supergroupRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useMemo, useState} from 'react';
import {useState} from 'react';
import styled from '@emotion/styled';

import InteractionStateLayer from '@sentry/scraps/interactionStateLayer';
Expand All @@ -11,33 +11,25 @@ import {Count} from 'sentry/components/count';
import {useDrawer} from 'sentry/components/globalDrawer';
import {PanelItem} from 'sentry/components/panels/panelItem';
import {Placeholder} from 'sentry/components/placeholder';
import {
CheckboxLabel,
SupergroupCheckbox,
} from 'sentry/components/stream/supergroups/supergroupCheckbox';
import {TimeSince} from 'sentry/components/timeSince';
import {IconStack} from 'sentry/icons';
import {t} from 'sentry/locale';
import {COLUMN_BREAKPOINTS} from 'sentry/views/issueList/actions/utils';
import {useOptionalIssueSelectionSummary} from 'sentry/views/issueList/issueSelectionContext';
import type {AggregatedSupergroupStats} from 'sentry/views/issueList/supergroups/aggregateSupergroupStats';
import {SupergroupDetailDrawer} from 'sentry/views/issueList/supergroups/supergroupDrawer';
import type {SupergroupDetail} from 'sentry/views/issueList/supergroups/types';

interface SupergroupRowProps {
matchedGroupIds: string[];
supergroup: SupergroupDetail;
aggregatedStats?: AggregatedSupergroupStats | null;
memberList?: IndexedMembersByProject;
}

export function SupergroupRow({
supergroup,
matchedGroupIds,
aggregatedStats,
memberList,
}: SupergroupRowProps) {
const matchedCount = matchedGroupIds.length;
const {openDrawer, isDrawerOpen} = useDrawer();
const [isActive, setIsActive] = useState(false);
const handleClick = () => {
Expand All @@ -58,31 +50,13 @@ export function SupergroupRow({
);
};

const summary = useOptionalIssueSelectionSummary();
const selectedCount = useMemo(() => {
if (!summary) {
return 0;
}
let count = 0;
for (const id of matchedGroupIds) {
if (summary.records.get(id)) {
count++;
}
}
return count;
}, [summary, matchedGroupIds]);

const highlighted = isActive && isDrawerOpen;

return (
<Wrapper onClick={handleClick} highlighted={highlighted}>
<InteractionStateLayer />
<IconArea>
<AccentIcon size="md" />
<SupergroupCheckbox
matchedGroupIds={matchedGroupIds}
selectedCount={selectedCount}
/>
</IconArea>
<Summary>
<Text size="md" bold ellipsis>
Expand All @@ -92,21 +66,15 @@ export function SupergroupRow({
{supergroup.error_type}
</Text>
<MetaRow>
<Text size="sm" variant="muted" ellipsis>
{supergroup.code_area}
</Text>
{supergroup.code_area && matchedCount > 0 ? <Dot /> : null}
{matchedCount > 0 ? (
<Text
size="sm"
variant={selectedCount > 0 ? 'primary' : 'muted'}
bold={selectedCount > 0}
>
{selectedCount > 0
? `${selectedCount} / ${supergroup.group_ids.length} ${t('issues selected')}`
: `${matchedCount} / ${supergroup.group_ids.length} ${t('issues matched')}`}
{supergroup.code_area ? (
<Text size="sm" variant="muted" ellipsis>
{supergroup.code_area}
</Text>
) : null}
{supergroup.code_area ? <Dot /> : null}
<Text size="sm" variant="muted">
{`${supergroup.group_ids.length} ${t('issues')}`}
</Text>
</MetaRow>
</Summary>

Expand Down Expand Up @@ -192,12 +160,6 @@ const Wrapper = styled(PanelItem)<{highlighted: boolean}>`
min-height: 82px;
background: ${p =>
p.highlighted ? p.theme.tokens.background.secondary : 'transparent'};

&:not(:hover):not(:has(input:checked)):not(:has(input:indeterminate)) {
${CheckboxLabel} {
${p => p.theme.visuallyHidden};
}
}
`;

const Summary = styled('div')`
Expand Down
1 change: 0 additions & 1 deletion static/app/views/issueList/groupListBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ function GroupList({
<SupergroupRow
key={`sg-${supergroup.id}`}
supergroup={supergroup}
matchedGroupIds={matchingIds}
aggregatedStats={stats}
memberList={memberList}
/>
Expand Down
Loading
Loading