@@ -25,7 +25,7 @@ function resourceTable(
25
25
columns . push ( msg ( "Good During Analysis" ) , msg ( "Bad During Analysis" ) ) ;
26
26
}
27
27
28
- let rows = [
28
+ const rows = [
29
29
[
30
30
html `< span class ="font-semibold capitalize "
31
31
> ${ msg ( "All Resources" ) } </ span
@@ -37,6 +37,46 @@ function resourceTable(
37
37
> ${ localize . number ( crawlResources [ TOTAL ] . bad ) } </ span
38
38
> ` ,
39
39
] ,
40
+ ...Object . keys ( qaResources || crawlResources )
41
+ . filter ( ( key ) => key !== TOTAL )
42
+ . map ( ( key ) => [
43
+ html `< span
44
+ class =${ [ "json" , "html" ] . includes ( key )
45
+ ? tw `uppercase`
46
+ : tw `capitalize ` }
47
+ > ${ key } </ span
48
+ > ` ,
49
+ html `${ Object . prototype . hasOwnProperty . call ( crawlResources , key )
50
+ ? localize . number ( crawlResources [ key ] . good )
51
+ : 0 } `,
52
+ html `${ Object . prototype . hasOwnProperty . call ( crawlResources , key )
53
+ ? localize . number ( crawlResources [ key ] . bad )
54
+ : 0 } `,
55
+ ...( qaResources
56
+ ? [
57
+ html `< span
58
+ class =${ Object . prototype . hasOwnProperty . call (
59
+ crawlResources ,
60
+ key ,
61
+ ) && crawlResources [ key ] . good === qaResources [ key ] . good
62
+ ? tw `text-neutral-400`
63
+ : tw `text-danger ` }
64
+ >
65
+ ${ localize . number ( qaResources [ key ] . good ) }
66
+ </ span > ` ,
67
+ html `< span
68
+ class =${ Object . prototype . hasOwnProperty . call (
69
+ crawlResources ,
70
+ key ,
71
+ ) && crawlResources [ key ] . bad === qaResources [ key ] . bad
72
+ ? tw `text-neutral-400`
73
+ : tw `font-semibold text-danger ` }
74
+ >
75
+ ${ localize . number ( qaResources [ key ] . bad ) }
76
+ </ span > ` ,
77
+ ]
78
+ : [ ] ) ,
79
+ ] ) ,
40
80
] ;
41
81
42
82
if ( qaResources ) {
@@ -62,36 +102,6 @@ function resourceTable(
62
102
${ localize . number ( qaResources [ TOTAL ] . bad ) }
63
103
</ span > ` ,
64
104
) ;
65
- rows = [
66
- ...rows ,
67
- ...Object . keys ( qaResources )
68
- . filter ( ( key ) => key !== TOTAL )
69
- . map ( ( key ) => [
70
- html `< span class ="capitalize "> ${ key } </ span > ` ,
71
- html `${ Object . prototype . hasOwnProperty . call ( crawlResources , key )
72
- ? localize . number ( crawlResources [ key ] . good )
73
- : 0 } `,
74
- html `${ Object . prototype . hasOwnProperty . call ( crawlResources , key )
75
- ? localize . number ( crawlResources [ key ] . bad )
76
- : 0 } `,
77
- html `< span
78
- class =${ Object . prototype . hasOwnProperty . call ( crawlResources , key ) &&
79
- crawlResources [ key ] . good === qaResources [ key ] . good
80
- ? tw `text-neutral-400`
81
- : tw `text-danger ` }
82
- >
83
- ${ localize . number ( qaResources [ key ] . good ) }
84
- </ span > ` ,
85
- html `< span
86
- class =${ Object . prototype . hasOwnProperty . call ( crawlResources , key ) &&
87
- crawlResources [ key ] . bad === qaResources [ key ] . bad
88
- ? tw `text-neutral-400`
89
- : tw `font-semibold text-danger ` }
90
- >
91
- ${ localize . number ( qaResources [ key ] . bad ) }
92
- </ span > ` ,
93
- ] ) ,
94
- ] ;
95
105
}
96
106
97
107
return html `
0 commit comments