Skip to content
Open
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
9 changes: 6 additions & 3 deletions static/app/components/events/groupingInfo/groupingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ export default function GroupingInfo({

const variants = groupInfo
? Object.values(groupInfo).sort((a, b) => {
// Sort variants with hashes before those without
if (a.hash && !b.hash) {
// Sort contributing variants before non-contributing ones
if (a.contributes && !b.contributes) {
return -1;
}
if (b.contributes && !a.contributes) {
return 1;
}

// Sort by description alphabetically
const descA = a.description?.toLowerCase() ?? '';
Expand Down Expand Up @@ -101,7 +104,7 @@ export default function GroupingInfo({
{isPending && !hasPerformanceGrouping ? <LoadingIndicator /> : null}
{hasPerformanceGrouping || isSuccess
? variants
.filter(variant => variant.hash !== null || showNonContributing)
.filter(variant => variant.contributes || showNonContributing)
.map((variant, index, filteredVariants) => (
<Fragment key={variant.key}>
<GroupingVariant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('EventGroupingInfo', () => {
url: `/projects/org-slug/project-slug/events/${event.id}/grouping-info/`,
body: {
app: {
contributes: true,
description: 'variant description',
hash: '123',
hashMismatch: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function GroupInfoSummary({
});
const groupedBy = groupInfo
? Object.values(groupInfo)
.filter(variant => variant.hash !== null && variant.description !== null)
.filter(variant => variant.contributes && variant.description !== null)
.map(variant => variant.description!)
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
.join(', ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('Grouping Variant', () => {
});
const performanceIssueVariant = {
type: EventGroupVariantType.PERFORMANCE_PROBLEM,
contributes: true,
description: 'performance issue',
hash: 'hash3',
hashMismatch: false,
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/events/groupingInfo/groupingVariant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function GroupingVariant({event, variant, showNonContributing}: GroupingVariantP
const data: VariantData = [];
let component: EventGroupComponent | undefined;

if (!showNonContributing && variant.hash === null) {
if (!showNonContributing && !variant.contributes) {
return [data, component];
}

Expand Down Expand Up @@ -156,7 +156,7 @@ function GroupingVariant({event, variant, showNonContributing}: GroupingVariantP
};

const renderTitle = () => {
const isContributing = variant.hash !== null;
const isContributing = variant.contributes;

const hint = variant.hint;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function generatePerformanceGroupInfo({
return group
? {
[group.issueType]: {
contributes: true,
description: t('performance problem'),
hash: event.occurrence?.fingerprint[0] || '',
hashMismatch: false,
Expand Down
1 change: 1 addition & 0 deletions static/app/types/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const enum EventGroupVariantType {
}

interface BaseVariant {
contributes: boolean;
description: string | null;
hash: string | null;
hashMismatch: boolean;
Expand Down
Loading