diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 2 | ||||
-rw-r--r-- | t/app/controller/dashboard.t | 20 | ||||
-rw-r--r-- | templates/web/default/dashboard/index.html | 9 |
3 files changed, 26 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index c9f8d5338..0fd6cbb98 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -185,7 +185,7 @@ sub updates_search : Private { for my $vars ( [ 'time_to_fix', 'fixed - council' ], - [ 'time_to_mark', 'in progress', 'planned', 'investigating' ], + [ 'time_to_mark', 'in progress', 'planned', 'investigating', 'closed' ], ) { my $col = shift @$vars; my $substmt = "select min(id) from comment where me.problem_id=comment.problem_id and problem_state in ('" diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index 356c06d93..b477c03bf 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -84,6 +84,7 @@ my $categories = scraper { process "tr[id=avg_marked] > td", 'avg_marked[]' => 'TEXT', process "tr[id=avg_fixed] > td", 'avg_fixed[]' => 'TEXT', process "tr[id=not_marked] > td", 'not_marked[]' => 'TEXT', + process "tr[id=closed] > td", 'closed[]' => 'TEXT', process "table[id=reports] > tr > td", 'report_lists[]' => scraper { process 'ul > li', 'reports[]' => 'TEXT' }, @@ -296,6 +297,25 @@ foreach my $test ( marked => [4,4,4,4] } }, + { + desc => 'marked as closed', + confirm_dt => DateTime->now->subtract( days => 1 ), + mark_dt => DateTime->now, + state => 'closed', + counts => { + totals => [6,6,9,10], + user => [1,1,1,2], + council => [2,2,3,3], + total_fixed => [3,3,4,5], + avg_fixed => [5,5,7,7], + avg_marked => [2,2,2,2], + investigating => [1,1,1,1], + in_progress => [1,1,1,1], + planned => [2,2,2,2], + closed => [1,1,1,1], + marked => [5,5,5,5] + } + }, ) { subtest $test->{desc} => sub { make_problem( diff --git a/templates/web/default/dashboard/index.html b/templates/web/default/dashboard/index.html index 1673c9566..be38234f2 100644 --- a/templates/web/default/dashboard/index.html +++ b/templates/web/default/dashboard/index.html @@ -68,6 +68,7 @@ '0' => [ "in progress", "Council has marked as in progress" ] '1' => [ "planned", "Council has marked as planned" ] '2' => [ "investigating", "Council has marked as investigating" ] + '3' => [ "closed", "Council has marked as closed" ] }; wtd = 0, week = 0, weeks = 0, ytd = 0; FOR row IN rows %] @@ -82,10 +83,10 @@ <tr class='subtotal' id="marked"> <th scope="row">Total marked</th> - <td>[% problems.wtd.${"in progress"} + problems.wtd.planned + problems.wtd.investigating %]</td> - <td>[% problems.week.${"in progress"} + problems.week.planned + problems.week.investigating %]</td> - <td>[% problems.weeks.${"in progress"} + problems.weeks.planned + problems.weeks.investigating %]</td> - <td>[% problems.ytd.${"in progress"} + problems.ytd.planned + problems.ytd.investigating %]</td> + <td>[% problems.wtd.${"in progress"} + problems.wtd.planned + problems.wtd.investigating + problems.wtd.closed %]</td> + <td>[% problems.week.${"in progress"} + problems.week.planned + problems.week.investigating + problems.wtd.closed %]</td> + <td>[% problems.weeks.${"in progress"} + problems.weeks.planned + problems.weeks.investigating + problems.wtd.closed %]</td> + <td>[% problems.ytd.${"in progress"} + problems.ytd.planned + problems.ytd.investigating + problems.wtd.closed %]</td> </tr> <tr id="avg_fixed"> |