From db4056be32a033bfcbb76820abfb9ddff70b6a03 Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Wed, 3 Apr 2019 14:28:58 -0400 Subject: [PATCH] Bug 1541111 - Separate bugs on Triage Owners page by type --- extensions/BMO/lib/Reports/Triage.pm | 21 +++++--- .../en/default/pages/triage_owners.html.tmpl | 49 +++++++++++++------ extensions/BMO/web/styles/triage_reports.css | 43 +++++++++++----- 3 files changed, 81 insertions(+), 32 deletions(-) diff --git a/extensions/BMO/lib/Reports/Triage.pm b/extensions/BMO/lib/Reports/Triage.pm index 2d40aa25d..d19f459e8 100644 --- a/extensions/BMO/lib/Reports/Triage.pm +++ b/extensions/BMO/lib/Reports/Triage.pm @@ -302,7 +302,7 @@ sub owners { my $rows = $dbh->selectall_arrayref($sql); my $bug_count_sth = $dbh->prepare(" - SELECT COUNT(bugs.bug_id) + SELECT bugs.bug_type, COUNT(bugs.bug_id) FROM bugs INNER JOIN components AS map_component ON bugs.component_id = map_component.id INNER JOIN bug_status AS map_bug_status ON bugs.bug_status = map_bug_status.value INNER JOIN priority AS map_priority ON bugs.priority = map_priority.value @@ -316,7 +316,8 @@ sub owners { LEFT JOIN flags AS flags_1 ON bugs_1.bug_id = flags_1.bug_id AND (flags_1.attach_id = attachments_1.attach_id OR flags_1.attach_id IS NULL) LEFT JOIN flagtypes AS flagtypes_1 ON flags_1.type_id = flagtypes_1.id WHERE bugs_1.bug_id = bugs.bug_id AND CONCAT(flagtypes_1.name, flags_1.status) = 'needinfo?'))) - AND bugs.component_id = ?"); + AND bugs.component_id = ? + GROUP BY bugs.bug_type"); my @results; foreach my $row (@$rows) { @@ -326,9 +327,10 @@ sub owners { ? Bugzilla::User->new({id => $triage_owner_id, cache => 1}) : ""; my $data = { - product => $product_name, - component => $component_name, - owner => $triage_owner, + product => $product_name, + component => $component_name, + owner => $triage_owner, + bug_counts => {defect => 0, enhancement => 0, task => 0}, }; $data->{buglist_url} = 'priority=--&resolution=---&f1=creation_ts&o1=greaterthaneq&v1=2016-06-01' @@ -338,7 +340,14 @@ sub owners { .= '&f3=triage_owner&o3=equals&v3=' . url_quote($triage_owner->login); } $bug_count_sth->execute($component_id); - ($data->{bug_count}) = $bug_count_sth->fetchrow_array(); + + my $total = 0; + while (my ($type, $count) = $bug_count_sth->fetchrow_array()) { + $data->{bug_counts}->{$type} = $count; + $total += $count; + } + $data->{bug_counts}->{total} = $total; + push @results, $data; } $vars->{results} = \@results; diff --git a/extensions/BMO/template/en/default/pages/triage_owners.html.tmpl b/extensions/BMO/template/en/default/pages/triage_owners.html.tmpl index e6944f7bc..f8a3504b5 100644 --- a/extensions/BMO/template/en/default/pages/triage_owners.html.tmpl +++ b/extensions/BMO/template/en/default/pages/triage_owners.html.tmpl @@ -93,15 +93,30 @@ Each triage owner links to a buglist of all open [% terms.bugs %], since 2016-06-01, without a pending needinfo, where the priority is '--'.

[% current_product = "" %] - - +
[% FOREACH r = results %] [% count = loop.count() %] [% IF current_product != r.product %] [% current_product = r.product %] - - - + + + + + [% FOREACH c IN r.bug_counts %] + + [% END %] + + + [% END %] - + [% FOREACH c IN r.bug_counts %] + + [% END %] [% END %] +
[% r.product FILTER html %]
[% r.product FILTER html %]Owner + [% IF c.key == "total"%] + Total + [% ELSE %] + + + + [% END %] +
@@ -114,17 +129,23 @@ None [% END %] - [% IF r.buglist_url %] - - [% r.bug_count FILTER html +%] [%+ terms.bugs %] found. - - [% ELSE %] - None - [% END %] - + [% IF c.value %] + + [% END %] + [%~ c.value FILTER html ~%] + [% IF c.value %] + + [% END %] +

Found [% results.size %] component[% 's' IF results.size != 1 %]: diff --git a/extensions/BMO/web/styles/triage_reports.css b/extensions/BMO/web/styles/triage_reports.css index 8eb2c6e87..099dd9429 100644 --- a/extensions/BMO/web/styles/triage_reports.css +++ b/extensions/BMO/web/styles/triage_reports.css @@ -17,27 +17,46 @@ width: 20em; } -#report tr.bugitem:hover { - background: #ccccff; +#triage_owners_form th { + text-align: right; + vertical-align: top; } -#report th, #report td { - padding: 1px 10px 1px 10px; +#report { + position: relative; + width: 100%; + border-collapse: collapse; } -#report-header { +#report thead { + position: sticky; + top: 0; + left: 0; background: #dddddd; } -tr.product_header { - background: #dddddd; +#report tr.bugitem:hover { + background: #ccccff; } -#triage_owners_form th { - text-align: right; - vertical-align: top; +#report th, +#report td { + padding: 4px 8px; + text-align: left; } -#report th, #report td { - text-align: left; +#report th.count, +#report td.count { + width: 1em; + text-align: center; + white-space: nowrap; +} + +#report td.count { + color: #CCC; +} + +#report td.count a { + display: block; + width: 100%; } -- 2.47.3