@@ -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,14 +185,34 @@ 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
- sortField : 'transaction' ,
215
+ sortField : true ,
196
216
renderFunc : ( data , { location} ) => {
197
217
const target = {
198
218
pathname : location . pathname ,
@@ -211,7 +231,7 @@ export const SPECIAL_FIELDS = {
211
231
} ,
212
232
} ,
213
233
title : {
214
- sortField : 'title' ,
234
+ sortField : true ,
215
235
renderFunc : ( data , { location} ) => {
216
236
const target = {
217
237
pathname : location . pathname ,
@@ -227,7 +247,7 @@ export const SPECIAL_FIELDS = {
227
247
} ,
228
248
} ,
229
249
type : {
230
- sortField : 'event.type' ,
250
+ sortField : true ,
231
251
renderFunc : ( data , { location} ) => {
232
252
const target = {
233
253
pathname : location . pathname ,
@@ -256,7 +276,7 @@ export const SPECIAL_FIELDS = {
256
276
} ,
257
277
} ,
258
278
user : {
259
- sortField : 'user.id' ,
279
+ sortField : true ,
260
280
renderFunc : ( data , { location} ) => {
261
281
const userObj = {
262
282
id : data [ 'user.id' ] ,
@@ -286,7 +306,7 @@ export const SPECIAL_FIELDS = {
286
306
} ,
287
307
} ,
288
308
issue_title : {
289
- sortField : 'issue_title' ,
309
+ sortField : true ,
290
310
renderFunc : ( data , { location} ) => {
291
311
const target = {
292
312
pathname : location . pathname ,
@@ -305,7 +325,7 @@ export const SPECIAL_FIELDS = {
305
325
} ,
306
326
} ,
307
327
last_seen : {
308
- sortField : 'last_seen' ,
328
+ sortField : true ,
309
329
renderFunc : data => {
310
330
return (
311
331
< Container >
0 commit comments