File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/sentry/static/sentry/app Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -59,3 +59,8 @@ export type User = {
59
59
username : string ;
60
60
email : string ;
61
61
} ;
62
+
63
+ export type CommitAuthor = {
64
+ email ?: string ;
65
+ name ?: string ;
66
+ } ;
Original file line number Diff line number Diff line change 1
1
import { get } from 'lodash' ;
2
2
3
3
import { t } from 'app/locale' ;
4
- import { User } from 'app/types' ;
4
+ import { CommitAuthor , User } from 'app/types' ;
5
5
6
- export function userDisplayName ( user : User ) : string {
6
+ export function userDisplayName ( user : User | CommitAuthor ) : string {
7
7
let displayName = String ( get ( user , 'name' , t ( 'Unknown author' ) ) ) . trim ( ) ;
8
8
9
9
if ( displayName . length <= 0 ) {
@@ -13,7 +13,7 @@ export function userDisplayName(user: User): string {
13
13
const email = String ( get ( user , 'email' , '' ) ) . trim ( ) ;
14
14
15
15
if ( email . length > 0 && email !== displayName ) {
16
- displayName += ' (' + user . email + ')' ;
16
+ displayName += ' (' + email + ')' ;
17
17
}
18
18
return displayName ;
19
19
}
You can’t perform that action at this time.
0 commit comments