-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(issue-details): Add streamlined sidebar and activity (#77958)
this pr adds in the dismissible sidebar and a first version of adding activity to the sidebar. the sidebar can now be dismissed, allowing for the rest of the issue details page to be displayed larger. the first version of activity in the sidebar will only show activities, the ability to comment is not added yet (will be done in a separate PR). Because of this, the tab will still be there until then. ![Screenshot 2024-09-23 at 10 03 30 AM](https://github.com/user-attachments/assets/1c092938-09ed-474c-a85f-e00fcf2f2108)
- Loading branch information
1 parent
583a084
commit 2446a87
Showing
7 changed files
with
936 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
static/app/views/issueDetails/streamline/activitySection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import {Fragment} from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
import Timeline from 'sentry/components/timeline'; | ||
import TimeSince from 'sentry/components/timeSince'; | ||
import type {Group} from 'sentry/types/group'; | ||
import useOrganization from 'sentry/utils/useOrganization'; | ||
import {groupActivityTypeIconMapping} from 'sentry/views/issueDetails/streamline/groupActivityIcons'; | ||
import getGroupActivityItem from 'sentry/views/issueDetails/streamline/groupActivityItem'; | ||
|
||
function StreamlinedActivitySection({group}: {group: Group}) { | ||
const organization = useOrganization(); | ||
|
||
return ( | ||
<Fragment> | ||
<Timeline.Container> | ||
{group.activity.map(item => { | ||
const authorName = item.user ? item.user.name : 'Sentry'; | ||
const {title, message} = getGroupActivityItem( | ||
item, | ||
organization, | ||
group.project.id, | ||
<Author>{authorName}</Author> | ||
); | ||
|
||
const Icon = groupActivityTypeIconMapping[item.type]?.Component ?? null; | ||
|
||
return ( | ||
<Timeline.Item | ||
title={title} | ||
timestamp={<TimeSince date={item.dateCreated} />} | ||
icon={ | ||
Icon && <Icon {...groupActivityTypeIconMapping[item.type].defaultProps} /> | ||
} | ||
key={item.id} | ||
> | ||
{message} | ||
</Timeline.Item> | ||
); | ||
})} | ||
</Timeline.Container> | ||
</Fragment> | ||
); | ||
} | ||
|
||
const Author = styled('span')` | ||
font-weight: ${p => p.theme.fontWeightBold}; | ||
`; | ||
|
||
export default StreamlinedActivitySection; |
67 changes: 67 additions & 0 deletions
67
static/app/views/issueDetails/streamline/groupActivityIcons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { | ||
IconAdd, | ||
IconCheckmark, | ||
IconClose, | ||
IconDelete, | ||
IconEdit, | ||
IconFile, | ||
IconFire, | ||
IconFlag, | ||
IconGraph, | ||
IconLock, | ||
IconMute, | ||
IconNext, | ||
IconPlay, | ||
IconPrevious, | ||
IconRefresh, | ||
IconUnsubscribed, | ||
IconUser, | ||
} from 'sentry/icons'; | ||
import {GroupActivityType} from 'sentry/types/group'; | ||
|
||
interface IconWithDefaultProps { | ||
Component: React.ComponentType<any> | null; | ||
defaultProps: {locked?: boolean; type?: string}; | ||
} | ||
|
||
export const groupActivityTypeIconMapping: Record< | ||
GroupActivityType, | ||
IconWithDefaultProps | ||
> = { | ||
[GroupActivityType.NOTE]: {Component: IconFile, defaultProps: {}}, | ||
[GroupActivityType.SET_RESOLVED]: {Component: IconCheckmark, defaultProps: {}}, | ||
[GroupActivityType.SET_RESOLVED_BY_AGE]: {Component: IconCheckmark, defaultProps: {}}, | ||
[GroupActivityType.SET_RESOLVED_IN_RELEASE]: { | ||
Component: IconCheckmark, | ||
defaultProps: {}, | ||
}, | ||
[GroupActivityType.SET_RESOLVED_IN_COMMIT]: { | ||
Component: IconCheckmark, | ||
defaultProps: {}, | ||
}, | ||
[GroupActivityType.SET_RESOLVED_IN_PULL_REQUEST]: { | ||
Component: IconCheckmark, | ||
defaultProps: {}, | ||
}, | ||
[GroupActivityType.SET_UNRESOLVED]: {Component: IconClose, defaultProps: {}}, | ||
[GroupActivityType.SET_IGNORED]: {Component: IconMute, defaultProps: {}}, | ||
[GroupActivityType.SET_PUBLIC]: {Component: IconLock, defaultProps: {}}, | ||
[GroupActivityType.SET_PRIVATE]: {Component: IconLock, defaultProps: {locked: true}}, | ||
[GroupActivityType.SET_REGRESSION]: {Component: IconFire, defaultProps: {}}, | ||
[GroupActivityType.CREATE_ISSUE]: {Component: IconAdd, defaultProps: {}}, | ||
[GroupActivityType.UNMERGE_SOURCE]: {Component: IconPrevious, defaultProps: {}}, | ||
[GroupActivityType.UNMERGE_DESTINATION]: {Component: IconPrevious, defaultProps: {}}, | ||
[GroupActivityType.FIRST_SEEN]: {Component: IconFlag, defaultProps: {}}, | ||
[GroupActivityType.ASSIGNED]: {Component: IconUser, defaultProps: {}}, | ||
[GroupActivityType.UNASSIGNED]: {Component: IconUnsubscribed, defaultProps: {}}, | ||
[GroupActivityType.MERGE]: {Component: IconNext, defaultProps: {}}, | ||
[GroupActivityType.REPROCESS]: {Component: IconRefresh, defaultProps: {}}, | ||
[GroupActivityType.MARK_REVIEWED]: {Component: IconCheckmark, defaultProps: {}}, | ||
[GroupActivityType.AUTO_SET_ONGOING]: {Component: IconPlay, defaultProps: {}}, | ||
[GroupActivityType.SET_ESCALATING]: { | ||
Component: IconGraph, | ||
defaultProps: {type: 'area'}, | ||
}, | ||
[GroupActivityType.SET_PRIORITY]: {Component: IconEdit, defaultProps: {}}, | ||
[GroupActivityType.DELETED_ATTACHMENT]: {Component: IconDelete, defaultProps: {}}, | ||
}; |
Oops, something went wrong.