-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(coding-conventions): Make activity section icon component static #120047
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,12 +44,12 @@ import {GroupActivityType} from 'sentry/types/group'; | |
| interface IconWithDefaultProps { | ||
| Component: React.ComponentType<SVGIconProps> | null; | ||
| defaultProps: {locked?: boolean; type?: string}; | ||
| componentFunction?: (props: { | ||
| propsFunction?: (data: GroupActivity['data']) => Record<string, unknown>; | ||
| renderIcon?: (props: { | ||
| data: GroupActivity['data']; | ||
| sentry_app: GroupActivity['sentry_app']; | ||
| user: GroupActivity['user']; | ||
| }) => React.ComponentType<SVGIconProps>; | ||
| propsFunction?: (data: GroupActivity['data']) => Record<string, unknown>; | ||
| }) => React.ReactNode; | ||
| } | ||
|
|
||
| export const groupActivityTypeIconMapping: Record< | ||
|
|
@@ -59,13 +59,11 @@ export const groupActivityTypeIconMapping: Record< | |
| [GroupActivityType.NOTE]: { | ||
| Component: IconChat, | ||
| defaultProps: {}, | ||
| componentFunction: ({user, sentry_app}) => { | ||
| renderIcon: ({user, sentry_app}) => { | ||
| if (sentry_app) { | ||
| return function () { | ||
| return <SentryAppAvatar sentryApp={sentry_app} />; | ||
| }; | ||
| return <SentryAppAvatar sentryApp={sentry_app} />; | ||
| } | ||
| return user ? () => <StyledUserAvatar user={user} /> : IconChat; | ||
| return user ? <StyledUserAvatar user={user} /> : <IconChat size="xs" />; | ||
| }, | ||
| }, | ||
| [GroupActivityType.SET_RESOLVED]: {Component: IconCheckmark, defaultProps: {}}, | ||
|
Comment on lines
59
to
69
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The progress tooltip was not updated to use the new Suggested FixUpdate Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
|
|
@@ -109,21 +107,21 @@ export const groupActivityTypeIconMapping: Record< | |
| [GroupActivityType.SET_REGRESSION]: {Component: IconFire, defaultProps: {}}, | ||
| [GroupActivityType.CREATE_ISSUE]: { | ||
| Component: IconAdd, | ||
| componentFunction: ({data}) => { | ||
| renderIcon: ({data}) => { | ||
| const provider = (data as GroupActivityCreateIssue['data']).provider; | ||
| switch (provider) { | ||
| case 'GitHub': | ||
| return IconGithub; | ||
| return <IconGithub size="xs" />; | ||
| case 'GitLab': | ||
| return IconGitlab; | ||
| return <IconGitlab size="xs" />; | ||
| case 'Bitbucket': | ||
| return IconBitbucket; | ||
| return <IconBitbucket size="xs" />; | ||
| case 'Jira': | ||
| return IconJira; | ||
| return <IconJira size="xs" />; | ||
| case 'Asana': | ||
| return IconAsana; | ||
| return <IconAsana size="xs" />; | ||
| default: | ||
| return IconAdd; | ||
| return <IconAdd size="xs" />; | ||
| } | ||
| }, | ||
| defaultProps: {}, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed icon mapping consumer update
High Severity
componentFunctionwas renamed torenderIconand now returns aReact.ReactNodeinstead of a component type, butprogressActivityTooltip.tsxstill readscomponentFunctionand treats the result as a component. That shared consumer needs the same ReactNode-based update asindex.tsx, or typecheck fails and a naive rename would render a node as a component.Reviewed by Cursor Bugbot for commit fe6c622. Configure here.