Skip to content

Commit cd9c5c8

Browse files
committed
add commitauthor type
1 parent 13160ab commit cd9c5c8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/sentry/static/sentry/app/types/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ export type User = {
5959
username: string;
6060
email: string;
6161
};
62+
63+
export type CommitAuthor = {
64+
email?: string;
65+
name?: string;
66+
};
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {get} from 'lodash';
22

33
import {t} from 'app/locale';
4-
import {User} from 'app/types';
4+
import {CommitAuthor, User} from 'app/types';
55

6-
export function userDisplayName(user: User): string {
6+
export function userDisplayName(user: User | CommitAuthor): string {
77
let displayName = String(get(user, 'name', t('Unknown author'))).trim();
88

99
if (displayName.length <= 0) {
@@ -13,7 +13,7 @@ export function userDisplayName(user: User): string {
1313
const email = String(get(user, 'email', '')).trim();
1414

1515
if (email.length > 0 && email !== displayName) {
16-
displayName += ' (' + user.email + ')';
16+
displayName += ' (' + email + ')';
1717
}
1818
return displayName;
1919
}

0 commit comments

Comments
 (0)