Skip to content

Commit 77e4b2b

Browse files
committed
ui: flakes: split the result filtering from the matrix construction
Minor refactoring, split the loop that constructs the result matrix into two, first which checks whether result is filtered, and second which actually constructs the array ignoring filtered. This will make it easy to add a step in between. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f7862b5 commit 77e4b2b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

ui/flakes.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ function load_result_table(data_raw)
3737
branch_pfx_set.add(br_pfx);
3838
}
3939

40-
// Build the result map
40+
// Annotate which results will be visible
4141
var pw_n = document.getElementById("pw-n").checked;
4242
var pw_y = document.getElementById("pw-y").checked;
4343
let needle = document.getElementById("tn-needle").value;
4444

45-
var test_row = {};
46-
let tn_urls = {};
47-
4845
$.each(data_raw, function(i, v) {
4946
$.each(v.results, function(j, r) {
47+
r.visible = false;
48+
5049
if (pw_y == false && nipa_pw_reported(v, r) == true)
5150
return 1;
5251
if (pw_n == false && nipa_pw_reported(v, r) == false)
@@ -56,6 +55,20 @@ function load_result_table(data_raw)
5655
if (needle && !tn.includes(needle))
5756
return 1;
5857

58+
r.visible = true;
59+
});
60+
});
61+
62+
// Build the result map
63+
var test_row = {};
64+
let tn_urls = {};
65+
66+
$.each(data_raw, function(i, v) {
67+
$.each(v.results, function(j, r) {
68+
if (!r.visible)
69+
return 1;
70+
71+
const tn = v.remote + '/' + r.group + '/' + r.test;
5972
tn_urls[tn] = "executor=" + v.executor + "&test=" + r.test;
6073

6174
if (!(tn in test_row)) {

0 commit comments

Comments
 (0)