diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Bing.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 2 | ||||
-rw-r--r-- | t/app/controller/report_inspect.t | 13 | ||||
-rw-r--r-- | templates/web/base/report/_item.html | 13 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 8 | ||||
-rw-r--r-- | web/js/map-fms.js | 8 |
8 files changed, 31 insertions, 19 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 115761edf..c3d229bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Redirect inspectors correctly on creation in two-tier. - Report status filter All option works for body users #1845 - Always allow reports to be removed from shortlist #1882 + - Remove shortlist form from inspect duplicate list. - Admin improvements: - Character length limit can be placed on report detailed information #1848 - Inspector panel shows nearest address if available #1850 diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index da5420500..ac52b217c 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -520,6 +520,9 @@ sub nearby_json : Private { my $p = $c->stash->{problem}; my $dist = 1; + # This is for the list template, this is a list on that page. + $c->stash->{page} = 'report'; + my $nearby = $c->model('DB::Nearby')->nearby( $c, $dist, [ $p->id ], 5, $p->latitude, $p->longitude, [ $p->category ], undef ); diff --git a/perllib/FixMyStreet/Map/Bing.pm b/perllib/FixMyStreet/Map/Bing.pm index 617823b45..e62406349 100644 --- a/perllib/FixMyStreet/Map/Bing.pm +++ b/perllib/FixMyStreet/Map/Bing.pm @@ -26,7 +26,7 @@ sub get_quadkey { } sub map_tile_base { - '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=3467"; + '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=5941"; } sub map_tiles { diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 50a21c125..c38f8baca 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -29,7 +29,7 @@ sub map_tiles { ]; } else { my $key = FixMyStreet->config('BING_MAPS_API_KEY'); - my $url = "g=3467"; + my $url = "g=5941"; $url .= "&productSet=mmOS&key=$key" if $z > 10 && !$ni; return [ "//ecn.t0.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y-1, $z) . ".png?$url", diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 74d99c0a9..239cc408b 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -124,7 +124,6 @@ FixMyStreet::override_config { $mech->content_contains('Invalid location'); $mech->submit_form_ok({ button => 'save', with_fields => { latitude => 51.754926, longitude => -1.256179, include_update => undef } }); $mech->content_lacks('Invalid location'); - $user->user_body_permissions->search({ body_id => $oxon->id, permission_type => 'planned_reports' })->delete; }; subtest "test duplicate reports are shown" => sub { @@ -203,6 +202,10 @@ FixMyStreet::override_config { is $report->get_extra_metadata('duplicate_of'), $report2->id; is_deeply $report2->get_extra_metadata('duplicates'), [ $report->id ]; + # Check that duplicate does not include shortlist add button (no form in form) + $mech->get_ok("/report/$report_id"); + $mech->content_lacks('item-list__item__shortlist-add'); + $report->set_extra_metadata('duplicate_of', undef); $report->update({ state => $old_state }); $report2->set_extra_metadata('duplicates', undef); @@ -241,6 +244,9 @@ FixMyStreet::override_config { my $old_state = $report->state; $report->comments->delete_all; + $mech->get_ok("/report/$report2_id/nearby.json"); + $mech->content_lacks('Add to shortlist'); + $mech->get_ok("/report/$report_id"); my $update_text = "This text was entered as an update by the user."; $mech->submit_form_ok({ button => 'save', with_fields => { @@ -253,6 +259,7 @@ FixMyStreet::override_config { is $report->state, 'duplicate', 'report marked as duplicate'; is $report->comments->search({ problem_state => 'duplicate' })->count, 1, 'update marked report as duplicate'; + $mech->get_ok("/report/$report_id"); # Get again as planned_reports permission means redirect to referer... $mech->content_contains($update_text); $mech->content_lacks("Thank you for your report. This problem has already been reported."); @@ -260,7 +267,6 @@ FixMyStreet::override_config { }; subtest "post-inspect redirect is to the right place if URL set" => sub { - $user->user_body_permissions->create({ body => $oxon, permission_type => 'planned_reports' }); $mech->get_ok("/report/$report_id"); my $update_text = "This text was entered as an update by the user."; $mech->submit_form_ok({ button => 'save', with_fields => { @@ -271,11 +277,9 @@ FixMyStreet::override_config { is $mech->res->code, 200, "got 200"; is $mech->res->previous->code, 302, "got 302 for redirect"; is $mech->uri->path, '/', 'redirected to front page'; - $user->user_body_permissions->search({ body_id => $oxon->id, permission_type => 'planned_reports' })->delete; }; subtest "post-inspect redirect is to the right place if URL not set" => sub { - $user->user_body_permissions->create({ body => $oxon, permission_type => 'planned_reports' }); $user->set_extra_metadata(categories => [ $contact->id ]); $user->update; $mech->get_ok("/report/$report_id"); @@ -292,7 +296,6 @@ FixMyStreet::override_config { is $params{lat}, $report->latitude, "latitude param is correct"; is $params{lon}, $report->longitude, "longitude param is correct"; is $params{filter_category}, $contact->category, "categories param is correct"; - $user->user_body_permissions->search({ body_id => $oxon->id, permission_type => 'planned_reports' })->delete; }; subtest "default response priorities display correctly" => sub { diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index 576f2b30f..8179139ca 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -121,13 +121,18 @@ </a> -[% IF item_action AND page != 'around' %] +[% IF item_action ~%] + [% IF page == 'report' ~%] + [%# We don't want to output shortlist on report page (in duplicate list) %] + [% ELSIF page == 'around' ~%] + [%# The around page list is already contained within the new report form %] + [% item_action.replace('("shortlist-[^"]*)', '$1-' _ problem.id) %] + [% ELSE ~%] <form method="post" action="/my/planned/change"> <input type="hidden" name="id" value="[% problem.id %]"> <input type="hidden" name="token" value="[% csrf_token %]"> [% item_action %] </form> -[% ELSIF item_action ~%] - [% item_action.replace('("shortlist-[^"]*)', '$1-' _ problem.id) %] -[% END ~%] + [% END ~%] +[% END %] </li> diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 3ad92b27e..6662bf91a 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -95,10 +95,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { get_urls: function(bounds, z) { return [ - "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3467", - "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3467", - "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3467", - "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=5941", + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=5941", + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=5941", + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=5941" ]; }, diff --git a/web/js/map-fms.js b/web/js/map-fms.js index 61206a90a..014bd58bb 100644 --- a/web/js/map-fms.js +++ b/web/js/map-fms.js @@ -61,10 +61,10 @@ OpenLayers.Layer.BingUK = OpenLayers.Class(OpenLayers.Layer.Bing, { type = '&productSet=mmOS&key=' + fixmystreet.key; } urls = [ - "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, - "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, - "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, - "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=5941" + type, + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=5941" + type, + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=5941" + type, + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=5941" + type ]; } return urls; |