File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
src/sentry/static/sentry/app/views/organizationEventsV2 Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -100,15 +100,15 @@ type RenderFunctionBaggage = {
100
100
location : ReactRouterLocation ;
101
101
} ;
102
102
103
- type RenderFunction = (
103
+ type FieldFormatterRenderFunction = (
104
104
field : string ,
105
105
data : EventData ,
106
106
baggage : RenderFunctionBaggage
107
107
) => React . ReactNode ;
108
108
109
109
type FieldFormatter = {
110
110
sortField : boolean ;
111
- renderFunc : RenderFunction ;
111
+ renderFunc : FieldFormatterRenderFunction ;
112
112
} ;
113
113
114
114
type FieldFormatters = {
@@ -185,12 +185,32 @@ export const FIELD_FORMATTERS: FieldFormatters = {
185
185
} ,
186
186
} ;
187
187
188
+ type SpecialFieldRenderFunc = (
189
+ data : EventData ,
190
+ baggage : RenderFunctionBaggage
191
+ ) => React . ReactNode ;
192
+
193
+ type SpecialField = {
194
+ sortField : boolean ;
195
+ renderFunc : SpecialFieldRenderFunc ;
196
+ } ;
197
+
198
+ type SpecialFields = {
199
+ transaction : SpecialField ;
200
+ title : SpecialField ;
201
+ type : SpecialField ;
202
+ project : SpecialField ;
203
+ user : SpecialField ;
204
+ issue_title : SpecialField ;
205
+ last_seen : SpecialField ;
206
+ } ;
207
+
188
208
/**
189
209
* "Special fields" do not map 1:1 to an single column in the event database,
190
210
* they are a UI concept that combines the results of multiple fields and
191
211
* displays with a custom render function.
192
212
*/
193
- export const SPECIAL_FIELDS = {
213
+ export const SPECIAL_FIELDS : SpecialFields = {
194
214
transaction : {
195
215
sortField : 'transaction' ,
196
216
renderFunc : ( data , { location} ) => {
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ export default class Table extends React.Component<Props> {
74
74
75
75
let sortKey : string | null = field ;
76
76
if ( SPECIAL_FIELDS . hasOwnProperty ( field ) ) {
77
- sortKey = SPECIAL_FIELDS [ field ] . sortField || null ;
77
+ sortKey =
78
+ SPECIAL_FIELDS [ field as keyof typeof SPECIAL_FIELDS ] . sortField || null ;
78
79
} else if ( FIELD_FORMATTERS . hasOwnProperty ( field ) ) {
79
80
sortKey = FIELD_FORMATTERS [ field as keyof typeof FIELD_FORMATTERS ] . sortField
80
81
? field
You can’t perform that action at this time.
0 commit comments