Skip to content

fix(issues): Revert to app external issue name #81277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2024
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
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
Loading