-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix: Fix tooltip if either release commits has no author, or if an author's name/email of a commit contains just whitespace. #13707
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
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 |
---|---|---|
|
@@ -117,12 +117,7 @@ class CommitAuthorStats extends React.Component { | |
return ( | ||
<PanelItem key={i} p={1} align="center"> | ||
<Flex> | ||
<Avatar | ||
user={author} | ||
size={20} | ||
hasTooltip | ||
tooltip={`${author.name} ${author.email}`} | ||
/> | ||
<Avatar user={author} size={20} hasTooltip /> | ||
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. @markstory I'm removing In addition, I removed it overall since the fallback tooltip that uses |
||
</Flex> | ||
<Flex flex="1" px={1}> | ||
<CommitBar | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,34 @@ describe('formatters', function() { | |
}) | ||
).toEqual('user (foo@bar.com)'); | ||
}); | ||
|
||
it('should show unknown author with email, if email is only provided', function() { | ||
expect( | ||
userDisplayName({ | ||
email: 'foo@bar.com', | ||
}) | ||
).toEqual('Unknown author (foo@bar.com)'); | ||
}); | ||
|
||
it('should show unknown author, if author or email is just whitespace', function() { | ||
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. I don't have a strong opinion on this. If an author name is intentionally whitespace, I can adjust the 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. I don't think explicit whitespace is a use case we need to afford. |
||
expect( | ||
userDisplayName({ | ||
// eslint-disable-next-line quotes | ||
name: `\t\n `, | ||
}) | ||
).toEqual('Unknown author'); | ||
|
||
expect( | ||
userDisplayName({ | ||
// eslint-disable-next-line quotes | ||
email: `\t\n `, | ||
}) | ||
).toEqual('Unknown author'); | ||
}); | ||
|
||
it('should show unknown author, if user object is either not an object or incomplete', function() { | ||
expect(userDisplayName()).toEqual('Unknown author'); | ||
expect(userDisplayName({})).toEqual('Unknown author'); | ||
}); | ||
}); | ||
}); |
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.
@markstory @billyvg The
tooltip
prop wasn't properly forwarded from heresentry/src/sentry/static/sentry/app/views/organizationReleases/detail/commitAuthorStats.jsx
Line 124 in f365c0b
So, I'm fixing that here in case this component was consumed with a
tooltip
prop.