Skip to content

Commit

Permalink
fix(activity): Update activity message for linked issues (#82064)
Browse files Browse the repository at this point in the history
Use the `new` field added in
#73069 to update the message
shown for the CREATE_ISSUE activity. This should add the distinction of
whether an external issue was linked or created.

Fixes #77410

---------

Co-authored-by: Scott Cooper <[email protected]>
  • Loading branch information
snigdhas and scttcper authored Dec 13, 2024
1 parent 56caa2f commit 3ee8e59
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions static/app/types/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ export interface GroupActivityCreateIssue extends GroupActivityBase {
location: string;
provider: string;
title: string;
new?: boolean;
};
type: GroupActivityType.CREATE_ISSUE;
}
Expand Down
7 changes: 7 additions & 0 deletions static/app/views/issueDetails/groupActivityItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,13 @@ function GroupActivityItem({
}
case GroupActivityType.CREATE_ISSUE: {
const {data} = activity;
if (data.new === true) {
return tct('[author] linked this issue to [issue] on [provider]', {
author,
issue: <ExternalLink href={data.location}>{data.title}</ExternalLink>,
provider: data.provider,
});
}
return tct('[author] created an issue on [provider] titled [title]', {
author,
provider: data.provider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,13 @@ export default function getGroupActivityItem(
}
case GroupActivityType.CREATE_ISSUE: {
const {data} = activity;
let title = t('Created Issue');
if (data.new === true) {
title = t('Linked Issue');
}

return {
title: t('Created Issue'),
title: title,
message: tct('by [author] on [provider] titled [title]', {
author,
provider: data.provider,
Expand Down

0 comments on commit 3ee8e59

Please sign in to comment.