File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
src/sentry/static/sentry/app Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,15 @@ export type EventsStats = {
52
52
data : EventsStatsData ;
53
53
totals ?: { count : number } ;
54
54
} ;
55
+
56
+ export type User = {
57
+ id : string ;
58
+ name : string ;
59
+ username : string ;
60
+ email : string ;
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 { CommitAuthor , User } from 'app/types' ;
4
5
5
- export function userDisplayName ( user ) {
6
+ export function userDisplayName ( user : User | CommitAuthor ) : string {
6
7
let displayName = String ( get ( user , 'name' , t ( 'Unknown author' ) ) ) . trim ( ) ;
7
8
8
9
if ( displayName . length <= 0 ) {
@@ -12,7 +13,7 @@ export function userDisplayName(user) {
12
13
const email = String ( get ( user , 'email' , '' ) ) . trim ( ) ;
13
14
14
15
if ( email . length > 0 && email !== displayName ) {
15
- displayName += ' (' + user . email + ')' ;
16
+ displayName += ' (' + email + ')' ;
16
17
}
17
18
return displayName ;
18
19
}
You can’t perform that action at this time.
0 commit comments