File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ img.pylogo {
327
327
continue versions_loop;
328
328
}
329
329
const styling = count++ < rowsPerPage ? ' ' : ' style="display: none;"' ;
330
- const highlight = ' <span class="highlight-package legend-item-1"></span>' .repeat (info .highlight );
330
+ const highlight = ' <span class="highlight-package legend-item-1"></span>' .repeat (Math . ceil ( info .highlight ) );
331
331
$ (' #dataTable tbody' ).append (`
332
332
<tr${ styling} >
333
333
<td class="dataTable-name"><a href="https://pypi.org/project/${ info .name } ">${ info .name } <a/></td>
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ class DBEntry {
14
14
return ! ! this . _notes . match ( / ^ 0 + \. 0 + $ / )
15
15
}
16
16
17
+ has_good_test_results ( ) {
18
+ return this . is_test_percentage ( ) && this . test_status == 0 && parseFloat ( this . _notes . match ( / ^ \d + \. \d + $ / ) [ 0 ] ) > 90 ;
19
+ }
20
+
17
21
set notes ( value ) {
18
22
this . _notes = value ;
19
23
}
@@ -46,10 +50,10 @@ class DBEntry {
46
50
get highlight ( ) {
47
51
if ( this . _highlight ) {
48
52
return this . _highlight ;
49
- } if ( this . is_test_percentage ( ) && this . test_status == 0 ) {
53
+ } else if ( this . has_good_test_results ( ) ) {
50
54
return 1 ;
51
55
} else if ( ! this . is_test_percentage ( ) && this . test_status == 0 ) {
52
- return 1 ;
56
+ return 0. 1;
53
57
} else {
54
58
return 0 ;
55
59
}
@@ -88,13 +92,13 @@ class DB {
88
92
function merge_entries ( entry , previous_entry ) {
89
93
if ( previous_entry ) {
90
94
if ( ! notes_overlap ( previous_entry . notes , entry . notes ) ) {
95
+ previous_entry . highlight = entry . highlight + previous_entry . highlight ;
91
96
if ( previous_entry . is_test_percentage ( ) && previous_entry . has_no_test_results ( ) ) {
92
97
previous_entry . notes = entry . notes ;
93
98
} else {
94
99
previous_entry . notes = entry . notes + " " + previous_entry . notes ;
95
100
}
96
101
}
97
- previous_entry . highlight = Math . min ( entry . highlight + previous_entry . highlight , 2 ) ;
98
102
return previous_entry ;
99
103
} else {
100
104
return entry ;
You can’t perform that action at this time.
0 commit comments