Skip to content

Commit a21e084

Browse files
committed
Add user.geo fields to feedback tags display and alphabetize tags
1 parent b3cc664 commit a21e084

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

static/app/components/feedback/feedbackItem/tagsSection.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type {ReactNode} from 'react';
22
import styled from '@emotion/styled';
3+
import orderBy from 'lodash/orderBy';
34

45
import Collapsible from 'sentry/components/collapsible';
56
import {Button} from 'sentry/components/core/button';
@@ -14,7 +15,7 @@ interface Props {
1415
}
1516

1617
export default function TagsSection({tags}: Props) {
17-
const entries = Object.entries(tags);
18+
const orderedEntries = orderBy(Object.entries(tags), ['key'], ['asc']);
1819

1920
return (
2021
<KeyValueTable noMargin>
@@ -31,7 +32,7 @@ export default function TagsSection({tags}: Props) {
3132
</StyledButton>
3233
)}
3334
>
34-
{entries.map(([key, value]) => (
35+
{orderedEntries.map(([key, value]) => (
3536
<KeyValueTableRow
3637
key={key}
3738
keyName={key}

static/app/components/feedback/hydrateFeedbackTags.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export default function hydrateFeedbackTags(
5050
...(context.device?.name ? {'device.name': context.device?.name} : {}),
5151
...(context.os?.name ? {'os.name': context.os?.name} : {}),
5252
...(context.os?.version ? {'os.version': context.os?.version} : {}),
53-
...(eventTags.some(e => e.key === 'environment')
54-
? {environment: eventTags.find(e => e.key === 'environment')?.value}
55-
: {}),
56-
...(eventTags.some(e => e.key === 'transaction')
57-
? {transaction: eventTags.find(e => e.key === 'transaction')?.value}
58-
: {}),
5953
...(eventData.platform
6054
? {platform: issueData?.project?.platform ?? eventData.platform}
6155
: {}),
@@ -64,6 +58,14 @@ export default function hydrateFeedbackTags(
6458
...(eventData?.contexts?.feedback?.replay_id
6559
? {replay_id: eventData?.contexts?.feedback?.replay_id}
6660
: {}),
61+
...(eventData.user?.geo?.city ? {'geo.city': eventData.user?.geo?.city} : {}),
62+
...(eventData.user?.geo?.country_code
63+
? {'geo.country_code': eventData.user?.geo?.country_code}
64+
: {}),
65+
...(eventData.user?.geo?.region ? {'geo.region': eventData.user?.geo?.region} : {}),
66+
...(eventData.user?.geo?.subdivision
67+
? {'geo.subdivision': eventData.user?.geo?.subdivision}
68+
: {}),
6769
};
6870

6971
// Sort the tags by key

static/app/types/event.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ export type EventTag = {key: string; value: string};
677677
type EventUser = {
678678
data?: string | null;
679679
email?: string;
680+
geo?: {
681+
city?: string;
682+
country_code?: string;
683+
region?: string;
684+
subdivision?: string;
685+
};
680686
id?: string;
681687
ip_address?: string;
682688
name?: string | null;

0 commit comments

Comments
 (0)