Skip to content

Commit a8809a1

Browse files
authored
fix(issues): Revert to app external issue name (#81277)
1 parent 104352c commit a8809a1

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

static/app/components/group/externalIssuesList/hooks/useSentryAppExternalIssues.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,21 @@ export function useSentryAppExternalIssues({
5151
const externalIssue = externalIssues.find(
5252
i => i.serviceType === component.sentryApp.slug
5353
);
54-
const displayName = component.sentryApp.name;
54+
const appDisplayName = component.sentryApp.name;
5555
const displayIcon = (
5656
<SentryAppComponentIcon sentryAppComponent={component} size={14} />
5757
);
5858
if (externalIssue) {
5959
result.linkedIssues.push({
6060
key: externalIssue.id,
61-
displayName: `${displayName} Issue`,
61+
displayName: externalIssue.displayName,
6262
url: externalIssue.webUrl,
63-
title: externalIssue.displayName,
63+
// Some display names look like PROJ#1234
64+
// Others look like ClickUp: Title
65+
// Add the integration name if it's not already included
66+
title: externalIssue.displayName.includes(appDisplayName)
67+
? externalIssue.displayName
68+
: `${appDisplayName}: ${externalIssue.displayName}`,
6469
displayIcon,
6570
onUnlink: () => {
6671
deleteExternalIssue(api, group.id, externalIssue.id)
@@ -76,10 +81,10 @@ export function useSentryAppExternalIssues({
7681
} else {
7782
result.integrations.push({
7883
key: component.sentryApp.slug,
79-
displayName,
84+
displayName: appDisplayName,
8085
displayIcon,
8186
disabled: Boolean(component.error),
82-
disabledText: t('Unable to connect to %s', displayName),
87+
disabledText: t('Unable to connect to %s', appDisplayName),
8388
actions: [
8489
{
8590
id: component.sentryApp.slug,

static/app/components/group/externalIssuesList/streamlinedExternalIssueList.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ describe('StreamlinedExternalIssueList', () => {
126126
);
127127

128128
expect(
129-
await screen.findByRole('button', {name: 'Clickup Issue'})
129+
await screen.findByRole('button', {name: 'ClickUp: hello#1'})
130130
).toBeInTheDocument();
131-
await userEvent.hover(screen.getByRole('button', {name: 'Clickup Issue'}));
131+
await userEvent.hover(screen.getByRole('button', {name: 'ClickUp: hello#1'}));
132132
await userEvent.click(await screen.findByRole('button', {name: 'Unlink issue'}));
133133

134134
await waitFor(() => {
135135
expect(
136-
screen.queryByRole('button', {name: 'Clickup Issue'})
136+
screen.queryByRole('button', {name: 'ClickUp: hello#1'})
137137
).not.toBeInTheDocument();
138138
});
139139
expect(unlinkMock).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)