Skip to content

Commit

Permalink
fix(issues): Revert to app external issue name (#81277)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Nov 26, 2024
1 parent 104352c commit a8809a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,21 @@ export function useSentryAppExternalIssues({
const externalIssue = externalIssues.find(
i => i.serviceType === component.sentryApp.slug
);
const displayName = component.sentryApp.name;
const appDisplayName = component.sentryApp.name;
const displayIcon = (
<SentryAppComponentIcon sentryAppComponent={component} size={14} />
);
if (externalIssue) {
result.linkedIssues.push({
key: externalIssue.id,
displayName: `${displayName} Issue`,
displayName: externalIssue.displayName,
url: externalIssue.webUrl,
title: externalIssue.displayName,
// Some display names look like PROJ#1234
// Others look like ClickUp: Title
// Add the integration name if it's not already included
title: externalIssue.displayName.includes(appDisplayName)
? externalIssue.displayName
: `${appDisplayName}: ${externalIssue.displayName}`,
displayIcon,
onUnlink: () => {
deleteExternalIssue(api, group.id, externalIssue.id)
Expand All @@ -76,10 +81,10 @@ export function useSentryAppExternalIssues({
} else {
result.integrations.push({
key: component.sentryApp.slug,
displayName,
displayName: appDisplayName,
displayIcon,
disabled: Boolean(component.error),
disabledText: t('Unable to connect to %s', displayName),
disabledText: t('Unable to connect to %s', appDisplayName),
actions: [
{
id: component.sentryApp.slug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ describe('StreamlinedExternalIssueList', () => {
);

expect(
await screen.findByRole('button', {name: 'Clickup Issue'})
await screen.findByRole('button', {name: 'ClickUp: hello#1'})
).toBeInTheDocument();
await userEvent.hover(screen.getByRole('button', {name: 'Clickup Issue'}));
await userEvent.hover(screen.getByRole('button', {name: 'ClickUp: hello#1'}));
await userEvent.click(await screen.findByRole('button', {name: 'Unlink issue'}));

await waitFor(() => {
expect(
screen.queryByRole('button', {name: 'Clickup Issue'})
screen.queryByRole('button', {name: 'ClickUp: hello#1'})
).not.toBeInTheDocument();
});
expect(unlinkMock).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit a8809a1

Please sign in to comment.