[tools 2/2] winetest/build-patterns: Allow hiding groups of reports on the patterns pages.
Francois Gouget
fgouget at codeweavers.com
Fri Aug 6 06:09:46 CDT 2021
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
winetest/build-patterns | 22 +++++++++++++++++++---
winetest/patterns.js | 26 +++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/winetest/build-patterns b/winetest/build-patterns
index fc6f7edbe..a1691db3d 100755
--- a/winetest/build-patterns
+++ b/winetest/build-patterns
@@ -1465,8 +1465,22 @@ EOF
if (!$nolist)
{
my @table = ("<details><summary>Page cutomization</summary>
-<div class='detailsbox'><p>Uncheck the reports you do not want to see on this page.</p>
-<table width='100%'>");
+<div class='detailsbox'><p>This section lets you select the reports to show on this page.</p><p>");
+ if (!$subpage or $subpage eq "-tb-win")
+ {
+ push @table, "<label><input id='tbwin' class='groupcb' type='checkbox' checked> Show the TestBot Windows reports</label><br>";
+ }
+ if (!$subpage or $subpage eq "-tb-wine")
+ {
+ push @table, "<label><input id='tbwine' class='groupcb' type='checkbox' checked> Show the Testbot Wine reports</label><br>";
+ }
+ if (!$subpage)
+ {
+ push @table, "<label><input id='win' class='groupcb' type='checkbox' checked> Show the other Windows reports</label><br>
+<label><input id='wine' class='groupcb' type='checkbox' checked> Show the other Wine reports</label>";
+ }
+ push @table, "</p><p>Use the table below to hide specific reports.</p><table width='100%'>";
+
my @reportmap;
for (my $i = 0; $i < @sortedreports; $i++)
{
@@ -1482,7 +1496,9 @@ EOF
my $reportindex = $reportmap[$i + $c];
last if (!defined $reportindex);
my $reportdir = $sortedreports[$reportindex] || "";
- push @table, "<td><label><input class='reportcb' type='checkbox' id='$reportdir' checked> $reportdir</label></td>";
+ my $report = $reports{$reportdir};
+ my $group = " data-group='". ($report->{tag} =~ /^newtb-/ ? "tb" : "") . ($report->{is_wine} ? "wine" : "win") ."'";
+ push @table, "<td><label><input class='reportcb'$group type='checkbox' id='$reportdir' checked> $reportdir</label></td>";
}
push @table, "</tr>";
}
diff --git a/winetest/patterns.js b/winetest/patterns.js
index a70df079e..80ac4b868 100644
--- a/winetest/patterns.js
+++ b/winetest/patterns.js
@@ -50,6 +50,24 @@ function refreshPage(changes)
}
}
+function toggledGroupCB(e)
+{
+ const group = e.target.id;
+ const checked = e.target.checked;
+
+ const changes = {};
+ for (let key in cbs)
+ {
+ const cb = cbs[key];
+ if (cb.group == group)
+ {
+ cb.dom.checked = checked;
+ changes[key] = checked;
+ }
+ }
+ refreshPage(changes);
+}
+
function toggledReportCB(e)
{
const cb = e.target;
@@ -60,11 +78,17 @@ function toggledReportCB(e)
function init()
{
+ document.querySelectorAll("input.groupcb").forEach(domcb => {
+ domcb.addEventListener('click', toggledGroupCB);
+ });
+
const changes = {};
cbs = {};
document.querySelectorAll("input.reportcb").forEach(domcb => {
- cbs[domcb.id] = { checked: true, /* all reports are shown by default */
+ cbs[domcb.id] = { dom: domcb,
+ checked: true, /* all reports are shown by default */
display: domcb.style.display,
+ group: domcb.getAttribute("data-group"),
patlines: []
};
changes[domcb.id] = domcb.checked;
--
2.20.1
More information about the wine-devel
mailing list