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
5 changes: 3 additions & 2 deletions static/app/components/feedback/feedbackItem/tagsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {ReactNode} from 'react';
import styled from '@emotion/styled';
import orderBy from 'lodash/orderBy';

import Collapsible from 'sentry/components/collapsible';
import {Button} from 'sentry/components/core/button';
Expand All @@ -14,7 +15,7 @@ interface Props {
}

export default function TagsSection({tags}: Props) {
const entries = Object.entries(tags);
const orderedEntries = orderBy(Object.entries(tags), ['key'], ['asc']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously no guarantee on order (tags is unordered)


return (
<KeyValueTable noMargin>
Expand All @@ -31,7 +32,7 @@ export default function TagsSection({tags}: Props) {
</StyledButton>
)}
>
{entries.map(([key, value]) => (
{orderedEntries.map(([key, value]) => (
<KeyValueTableRow
key={key}
keyName={key}
Expand Down
14 changes: 8 additions & 6 deletions static/app/components/feedback/hydrateFeedbackTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ export default function hydrateFeedbackTags(
...(context.device?.name ? {'device.name': context.device?.name} : {}),
...(context.os?.name ? {'os.name': context.os?.name} : {}),
...(context.os?.version ? {'os.version': context.os?.version} : {}),
...(eventTags.some(e => e.key === 'environment')
? {environment: eventTags.find(e => e.key === 'environment')?.value}
: {}),
...(eventTags.some(e => e.key === 'transaction')
? {transaction: eventTags.find(e => e.key === 'transaction')?.value}
: {}),
Comment on lines -53 to -58
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by line 37-44

...(eventData.platform
? {platform: issueData?.project?.platform ?? eventData.platform}
: {}),
Expand All @@ -64,6 +58,14 @@ export default function hydrateFeedbackTags(
...(eventData?.contexts?.feedback?.replay_id
? {replay_id: eventData?.contexts?.feedback?.replay_id}
: {}),
...(eventData.user?.geo?.city ? {'geo.city': eventData.user?.geo?.city} : {}),
...(eventData.user?.geo?.country_code
? {'geo.country_code': eventData.user?.geo?.country_code}
: {}),
...(eventData.user?.geo?.region ? {'geo.region': eventData.user?.geo?.region} : {}),
...(eventData.user?.geo?.subdivision
? {'geo.subdivision': eventData.user?.geo?.subdivision}
: {}),
};

// Sort the tags by key
Expand Down
6 changes: 6 additions & 0 deletions static/app/types/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ export type EventTag = {key: string; value: string};
type EventUser = {
data?: string | null;
email?: string;
geo?: {
city?: string;
country_code?: string;
region?: string;
subdivision?: string;
};
id?: string;
ip_address?: string;
name?: string | null;
Expand Down
Loading