Skip to content

Commit 6102be5

Browse files
committed
give up to two checkmarks for recommended packages
1 parent 8ccea51 commit 6102be5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/site/03-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ img.pylogo {
327327
continue versions_loop;
328328
}
329329
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));
331331
$('#dataTable tbody').append(`
332332
<tr${styling}>
333333
<td class="dataTable-name"><a href="https://pypi.org/project/${info.name}">${info.name}<a/></td>

docs/site/assets/js/check_compatibility_helpers.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class DBEntry {
1414
return !!this._notes.match(/^0+\.0+$/)
1515
}
1616

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+
1721
set notes(value) {
1822
this._notes = value;
1923
}
@@ -46,10 +50,10 @@ class DBEntry {
4650
get highlight() {
4751
if (this._highlight) {
4852
return this._highlight;
49-
} if (this.is_test_percentage() && this.test_status == 0) {
53+
} else if (this.has_good_test_results()) {
5054
return 1;
5155
} else if (!this.is_test_percentage() && this.test_status == 0) {
52-
return 1;
56+
return 0.1;
5357
} else {
5458
return 0;
5559
}
@@ -88,13 +92,13 @@ class DB {
8892
function merge_entries(entry, previous_entry) {
8993
if (previous_entry) {
9094
if (!notes_overlap(previous_entry.notes, entry.notes)) {
95+
previous_entry.highlight = entry.highlight + previous_entry.highlight;
9196
if (previous_entry.is_test_percentage() && previous_entry.has_no_test_results()) {
9297
previous_entry.notes = entry.notes;
9398
} else {
9499
previous_entry.notes = entry.notes + " " + previous_entry.notes;
95100
}
96101
}
97-
previous_entry.highlight = Math.min(entry.highlight + previous_entry.highlight, 2);
98102
return previous_entry;
99103
} else {
100104
return entry;

0 commit comments

Comments
 (0)