From e08f14c4501f315b46c2a45b2f63b572ab650691 Mon Sep 17 00:00:00 2001
From: M Somerville
Date: Mon, 2 Nov 2020 09:25:08 +0000
Subject: [Highways England] Expand across non-DBFO roads.
---
perllib/FixMyStreet/SendReport/Email/Highways.pm | 8 +++-----
t/app/sendreport/email/highways.t | 2 +-
templates/web/highwaysengland/report/new/roads_message.html | 7 +++----
web/cobrands/highwaysengland/assets.js | 6 +++---
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/perllib/FixMyStreet/SendReport/Email/Highways.pm b/perllib/FixMyStreet/SendReport/Email/Highways.pm
index 2bcd120d3..918ac896d 100644
--- a/perllib/FixMyStreet/SendReport/Email/Highways.pm
+++ b/perllib/FixMyStreet/SendReport/Email/Highways.pm
@@ -12,11 +12,9 @@ sub build_recipient_list {
my $contact = $self->fetch_category($body, $row) or return;
my $email = $contact->email;
my $area_name = $row->get_extra_field_value('area_name') || '';
- if ($area_name eq 'Area 7') {
- my $a7email = FixMyStreet->config('COBRAND_FEATURES') || {};
- $a7email = $a7email->{open311_email}->{highwaysengland}->{area_seven};
- $email = $a7email if $a7email;
- }
+ my $area_email = FixMyStreet->config('COBRAND_FEATURES') || {};
+ $area_email = $area_email->{open311_email}->{highwaysengland}->{$area_name};
+ $email = $area_email if $area_email;
@{$self->to} = map { [ $_, $body->name ] } split /,/, $email;
return 1;
diff --git a/t/app/sendreport/email/highways.t b/t/app/sendreport/email/highways.t
index b9a71f23f..22913a7e6 100644
--- a/t/app/sendreport/email/highways.t
+++ b/t/app/sendreport/email/highways.t
@@ -34,7 +34,7 @@ is $e->build_recipient_list($row), 1, 'correct recipient list count';
is_deeply $e->to, [ [ 'highways@example.com', 'Highways England' ] ], 'correct To line';
FixMyStreet::override_config {
- COBRAND_FEATURES => { open311_email => { highwaysengland => { area_seven => 'a7@example.com' } } }
+ COBRAND_FEATURES => { open311_email => { highwaysengland => { 'Area 7' => 'a7@example.com' } } }
}, sub {
$row->set_extra_fields( { name => 'area_name', value => 'Area 7' } );
is $e->build_recipient_list($row), 1, 'correct recipient list count';
diff --git a/templates/web/highwaysengland/report/new/roads_message.html b/templates/web/highwaysengland/report/new/roads_message.html
index e75a0a01b..d09845daf 100644
--- a/templates/web/highwaysengland/report/new/roads_message.html
+++ b/templates/web/highwaysengland/report/new/roads_message.html
@@ -7,10 +7,9 @@
-
-
This site is currently only for reports in the East Midlands
-
- Please follow this link to
+
+ Whilst this site is being used to report on roads directly maintained
+ by Highways England, please follow this link to
FixMyStreet to continue reporting your issue.
diff --git a/web/cobrands/highwaysengland/assets.js b/web/cobrands/highwaysengland/assets.js
index 8e50ed396..5943cdffd 100644
--- a/web/cobrands/highwaysengland/assets.js
+++ b/web/cobrands/highwaysengland/assets.js
@@ -61,9 +61,9 @@ fixmystreet.assets.add(defaults, {
no_asset_msg_id: '#js-not-he-road',
actions: {
found: function(layer, feature) {
- // If the road isn't in area 7 then we want to show the not found message.
+ // If the road is a DBFO road then we want to show the not found message.
fixmystreet.message_controller.road_found(layer, feature, function(feature) {
- if (feature.attributes.area_name === 'Area 7') {
+ if (feature.attributes.area_name.indexOf('DBFO') === -1) {
$('#js-top-message').show();
$('#form_category_row').show();
return true;
@@ -72,7 +72,7 @@ fixmystreet.assets.add(defaults, {
$('#form_category_row').hide();
return false;
}
- }, '#js-not-area7-road');
+ }, '#js-dbfo-road');
},
not_found: function(layer) {
fixmystreet.message_controller.road_not_found(layer);
--
cgit v1.2.3