Skip to content

Commit 0a35771

Browse files
committed
ui: status: add notes to filters
Add ability to create short notes and link to things from filters. Most filters are temporary now, it's useful to track where things came from. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a602171 commit 0a35771

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

ui/status.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,12 @@ function branch_res_doit(data_raw)
882882
function add_one_test_filter_hdr(keys_present, key, hdr, row)
883883
{
884884
if (!keys_present.has(key))
885-
return ;
885+
return false;
886886

887887
let th = document.createElement("th");
888888
th.innerHTML = hdr;
889889
row.appendChild(th);
890+
return true;
890891
}
891892

892893
function add_one_test_filter(keys_present, key, v, i, row)
@@ -921,12 +922,17 @@ function filters_doit(data_raw)
921922
});
922923

923924
let cf_tests_hdr = document.getElementById("cf-tests-hdr");
925+
let has_notes = false;
924926
add_one_test_filter_hdr(keys_present, "remote", "Remote", cf_tests_hdr);
925927
add_one_test_filter_hdr(keys_present, "executor", "Executor", cf_tests_hdr);
926928
add_one_test_filter_hdr(keys_present, "branch", "Branch", cf_tests_hdr);
927929
add_one_test_filter_hdr(keys_present, "group", "Group", cf_tests_hdr);
928930
add_one_test_filter_hdr(keys_present, "test", "Test", cf_tests_hdr);
929931

932+
if (add_one_test_filter_hdr(keys_present, "link", "Notes", cf_tests_hdr) ||
933+
add_one_test_filter_hdr(keys_present, "comment", "Notes", cf_tests_hdr))
934+
has_notes = true;
935+
930936
$.each(data_raw["ignore-results"], function(_i, v) {
931937
let row = cf_tests.insertRow();
932938
let i = 0;
@@ -936,6 +942,15 @@ function filters_doit(data_raw)
936942
i += add_one_test_filter(keys_present, "branch", v, i, row);
937943
i += add_one_test_filter(keys_present, "group", v, i, row);
938944
i += add_one_test_filter(keys_present, "test", v, i, row);
945+
946+
// Must be last, we don't handle counting columns properly here.
947+
if (has_notes)
948+
cell = row.insertCell(i);
949+
if (v["comment"] || v["link"]) {
950+
let comment = v["comment"] || "link";
951+
comment = wrap_link(v, v, comment);
952+
cell.innerHTML = comment;
953+
}
939954
});
940955

941956
output = "<b>Crashes ignored:</b><br />";

0 commit comments

Comments
 (0)