File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
src/components/leaderboard Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,20 @@ const Leaderboard: React.FC<LeaderboardProps> = ({ benchmarkId }) => {
41
41
return 1 ;
42
42
}
43
43
return 0 ;
44
+ case 'duplicatedSubmissions' :
45
+ if (
46
+ row1 . duplicatedSubmissions ?. length ! <
47
+ row2 . duplicatedSubmissions ?. length !
48
+ ) {
49
+ return - 1 ;
50
+ }
51
+ if (
52
+ row1 . duplicatedSubmissions ?. length ! >
53
+ row2 . duplicatedSubmissions ?. length !
54
+ ) {
55
+ return 1 ;
56
+ }
57
+ return 0 ;
44
58
}
45
59
return 0 ;
46
60
}
@@ -226,6 +240,20 @@ const Leaderboard: React.FC<LeaderboardProps> = ({ benchmarkId }) => {
226
240
/>
227
241
</ div >
228
242
</ th >
243
+ < th
244
+ scope = "col"
245
+ className = "dark:text-gray-100 px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
246
+ onClick = { ( ) => setSortedField ( 'duplicatedSubmissions' ) }
247
+ >
248
+ < div className = "flex" >
249
+ Duplicated submissions
250
+ < img
251
+ className = "w-4 h-4 ml-2"
252
+ alt = "Sort by lint score"
253
+ src = "https://image.flaticon.com/icons/png/512/162/162735.png"
254
+ />
255
+ </ div >
256
+ </ th >
229
257
</ tr >
230
258
</ thead >
231
259
< tbody className = "bg-white dark:bg-gray-300 divide-y divide-gray-200 " >
@@ -285,6 +313,11 @@ const Leaderboard: React.FC<LeaderboardProps> = ({ benchmarkId }) => {
285
313
< td className = "px-6 py-4 whitespace-nowrap text-sm text-gray-500" >
286
314
{ row . execDuration }
287
315
</ td >
316
+ < td className = "px-6 py-4 whitespace-nowrap text-sm text-gray-500" >
317
+ { row . duplicatedSubmissions
318
+ ? row . duplicatedSubmissions . length
319
+ : 0 }
320
+ </ td >
288
321
</ tr >
289
322
) )
290
323
: '' }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export default class LeaderboardModel {
6
6
memUsage : number | undefined ;
7
7
execDuration : number | undefined ;
8
8
createdAt : string | undefined ;
9
+ duplicatedSubmissions : [ ] | undefined ;
9
10
user :
10
11
| {
11
12
id : string | undefined ;
You can’t perform that action at this time.
0 commit comments