aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--t/app/controller/around.t10
-rw-r--r--templates/web/base/reports/_list-filters.html9
3 files changed, 14 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7a6784c63..82cca72b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@
- Inspectors can unset priority. #2171
- Defect type is recorded if category change made. #2172
- [UK] Store body ID on council/ward alerts. #2175
+ - Show all fixed issues when staff user uses map page filter #2176
- Admin improvements:
- Mandatory defect type selection if defect raised.
- Send login email button on user edit page #2041
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index 8eaba6450..02abefe7e 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -152,7 +152,7 @@ subtest 'check category, status and extra filtering works on /around' => sub {
# Create one open and one fixed report in each category
foreach my $category ( @$categories ) {
$mech->create_contact_ok( category => $category, body_id => $body->id, email => "$category\@example.org" );
- foreach my $state ( 'confirmed', 'fixed' ) {
+ foreach my $state ( 'confirmed', 'fixed - user', 'fixed - council' ) {
my %report_params = (
%$params,
category => $category,
@@ -165,7 +165,7 @@ subtest 'check category, status and extra filtering works on /around' => sub {
my $json = $mech->get_ok_json( '/around?ajax=1&bbox=' . $bbox );
my $pins = $json->{pins};
- is scalar @$pins, 6, 'correct number of reports when no filters';
+ is scalar @$pins, 9, 'correct number of reports when no filters';
# Regression test for filter_category in /around URL
FixMyStreet::override_config {
@@ -177,7 +177,7 @@ subtest 'check category, status and extra filtering works on /around' => sub {
$json = $mech->get_ok_json( '/around?ajax=1&filter_category=Pothole&bbox=' . $bbox );
$pins = $json->{pins};
- is scalar @$pins, 2, 'correct number of Pothole reports';
+ is scalar @$pins, 3, 'correct number of Pothole reports';
$json = $mech->get_ok_json( '/around?ajax=1&status=open&bbox=' . $bbox );
$pins = $json->{pins};
@@ -185,10 +185,10 @@ subtest 'check category, status and extra filtering works on /around' => sub {
$json = $mech->get_ok_json( '/around?ajax=1&status=fixed&filter_category=Vegetation&bbox=' . $bbox );
$pins = $json->{pins};
- is scalar @$pins, 1, 'correct number of fixed Vegetation reports';
+ is scalar @$pins, 2, 'correct number of fixed Vegetation reports';
my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::Default');
- $cobrand->mock('display_location_extra_params', sub { { external_body => "Pothole-fixed" } });
+ $cobrand->mock('display_location_extra_params', sub { { external_body => "Pothole-confirmed" } });
$json = $mech->get_ok_json( '/around?ajax=1&bbox=' . $bbox );
$pins = $json->{pins};
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index 928d54452..61cff8de0 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -3,7 +3,13 @@
<select class="form-control js-multiple" name="status" id="statuses" multiple
data-all="[% loc('All') %]"
[% IF show_all_states %]
- [% options = []; FOR group IN filter_states; FOR state IN group.1; NEXT IF state == 'hidden'; options.push(state); END; END %]
+ [% options = [];
+ FOR group IN filter_states; FOR state IN group.1;
+ NEXT IF state == 'hidden';
+ SET state = 'fixed' IF state == 'fixed - council';
+ options.push(state);
+ END; END
+ %]
data-all-options='["[% options.join('", "') %]"]'
[%~ ELSE ~%]
[%~ IF has_fixed_state ~%]
@@ -22,6 +28,7 @@
[% FOR group IN filter_states %]
[% FOR state IN group.1 %]
[% NEXT IF state == 'hidden' %]
+ [% SET state = 'fixed' IF state == 'fixed - council' ~%]
<option value="[% state %]"[% ' selected' IF filter_status.$state %]>[% prettify_state(state, 1) %]</option>
[% END %]
[% END %]