aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cypress/cypress.json2
-rw-r--r--.cypress/cypress/fixtures/roads.xml47
-rw-r--r--.cypress/cypress/fixtures/trees.json2
-rw-r--r--.cypress/cypress/integration/buckinghamshire.js33
-rw-r--r--.cypress/cypress/integration/northamptonshire.js21
-rw-r--r--.cypress/cypress/integration/regressions.js17
-rw-r--r--CHANGELOG.md1
-rwxr-xr-xbin/browser-tests6
-rwxr-xr-xbin/fixmystreet.com/fixture46
-rw-r--r--perllib/FixMyStreet/Cobrand/Lincolnshire.pm2
-rw-r--r--perllib/FixMyStreet/Map/Buckinghamshire.pm5
-rw-r--r--perllib/FixMyStreet/Map/Lincolnshire.pm21
-rw-r--r--t/Mock/MapIt.pm7
-rw-r--r--t/map/tests.t2
-rw-r--r--templates/web/buckinghamshire/footer_extra_js.html11
-rw-r--r--templates/web/lincolnshire/footer_extra_js.html11
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js10
17 files changed, 194 insertions, 50 deletions
diff --git a/.cypress/cypress.json b/.cypress/cypress.json
index 9b424ef69..8d25b96b6 100644
--- a/.cypress/cypress.json
+++ b/.cypress/cypress.json
@@ -1,7 +1,7 @@
{
"baseUrl": "http://fixmystreet.localhost:3001",
"projectId": "y8vvs1",
- "blacklistHosts": ["gaze.mysociety.org", "*.openstreetmap.org"],
+ "blacklistHosts": ["gaze.mysociety.org", "*.openstreetmap.org", "portal.roadworks.org", "tilma.mysociety.org"],
"env": {
"postcode": "BS10 5EE"
},
diff --git a/.cypress/cypress/fixtures/roads.xml b/.cypress/cypress/fixtures/roads.xml
new file mode 100644
index 000000000..fc3bce1bf
--- /dev/null
+++ b/.cypress/cypress/fixtures/roads.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding="UTF-8" ?>
+<wfs:FeatureCollection
+ xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
+ xmlns:gml="http://www.opengis.net/gml"
+ xmlns:wfs="http://www.opengis.net/wfs"
+ xmlns:ogc="http://www.opengis.net/ogc"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver https://tilma.mysociety.org:80/mapserver/bucks?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=Whole_Street&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
+ <gml:boundedBy>
+ <gml:Envelope srsName="EPSG:27700">
+ <gml:lowerCorner>499000.030000 189992.860000</gml:lowerCorner>
+ <gml:upperCorner>501833.770000 193639.230000</gml:upperCorner>
+ </gml:Envelope>
+ </gml:boundedBy>
+ <gml:featureMember>
+ <ms:Whole_Street gml:id="Whole_Street.HWSA7300268">
+ <gml:boundedBy>
+ <gml:Envelope srsName="EPSG:27700">
+ <gml:lowerCorner>499991.980000 191715.960000</gml:lowerCorner>
+ <gml:upperCorner>500040.010000 191858.080000</gml:upperCorner>
+ </gml:Envelope>
+ </gml:boundedBy>
+ <ms:msGeometry>
+ <gml:MultiCurve srsName="EPSG:27700">
+ <gml:curveMember>
+ <gml:LineString>
+ <gml:posList srsDimension="2">499991.980000 191715.960000 500000.000000 191720.020000 500004.960000 191721.000000 500008.960000 191721.970000 500019.990000 191724.970000 500028.010000 191729.030000 500032.990000 191733.020000 500035.030000 191734.950000 500039.020000 191743.030000 500039.990000 191746.950000 500040.000000 191749.950000 500040.010000 191755.960000 500035.180000 191772.660000 </gml:posList>
+ </gml:LineString>
+ </gml:curveMember>
+ <gml:curveMember>
+ <gml:LineString>
+ <gml:posList srsDimension="2">500035.180000 191772.660000 500025.070000 191769.020000 </gml:posList>
+ </gml:LineString>
+ </gml:curveMember>
+ <gml:curveMember>
+ <gml:LineString>
+ <gml:posList srsDimension="2">500035.180000 191772.660000 500027.000000 191800.990000 500019.980000 191819.980000 500008.590000 191849.680000 500005.380000 191858.080000 </gml:posList>
+ </gml:LineString>
+ </gml:curveMember>
+ </gml:MultiCurve>
+ </ms:msGeometry>
+ <ms:site_code>7300268</ms:site_code>
+ <ms:feature_ty>4B</ms:feature_ty>
+ </ms:Whole_Street>
+ </gml:featureMember>
+</wfs:FeatureCollection>
+
diff --git a/.cypress/cypress/fixtures/trees.json b/.cypress/cypress/fixtures/trees.json
index c965614f7..f3808c912 100644
--- a/.cypress/cypress/fixtures/trees.json
+++ b/.cypress/cypress/fixtures/trees.json
@@ -7,7 +7,7 @@
"geometry": {
"type": "Point",
"coordinates": [
- 99073,
+ -99073,
6843328
]
},
diff --git a/.cypress/cypress/integration/buckinghamshire.js b/.cypress/cypress/integration/buckinghamshire.js
new file mode 100644
index 000000000..92426e0d4
--- /dev/null
+++ b/.cypress/cypress/integration/buckinghamshire.js
@@ -0,0 +1,33 @@
+describe('flytipping', function() {
+
+ beforeEach(function() {
+ cy.server();
+ cy.fixture('roads.xml');
+ cy.route('**mapserver/bucks*Whole_Street*', 'fixture:roads.xml').as('roads-layer');
+ cy.route('/report/new/ajax*').as('report-ajax');
+ cy.visit('http://buckinghamshire.localhost:3001/');
+ cy.contains('Buckinghamshire');
+ cy.get('[name=pc]').type('SL9 0NX');
+ cy.get('[name=pc]').parents('form').submit();
+ });
+
+ it('handles flytipping on a road correctly', function() {
+ cy.get('.olMapViewport #fms_pan_zoom_zoomin').click();
+ cy.wait('@roads-layer');
+ cy.get('#map_box').click(290, 307);
+ cy.wait('@report-ajax');
+ cy.get('select:eq(4)').select('Flytipping');
+ cy.get('#form_road-placement').select('off-road');
+ cy.contains('sent to Chiltern District Council and also');
+ cy.get('#form_road-placement').select('road');
+ cy.contains('sent to Buckinghamshire County Council and also');
+ });
+
+ it('handles flytipping off a road correctly', function() {
+ cy.get('#map_box').click(200, 307);
+ cy.wait('@report-ajax');
+ cy.get('select:eq(4)').select('Flytipping');
+ cy.contains('sent to Chiltern District Council and also');
+ });
+
+});
diff --git a/.cypress/cypress/integration/northamptonshire.js b/.cypress/cypress/integration/northamptonshire.js
index 082f03de1..dc683e4e6 100644
--- a/.cypress/cypress/integration/northamptonshire.js
+++ b/.cypress/cypress/integration/northamptonshire.js
@@ -8,7 +8,7 @@ it('prevents clicking unless asset selected', function() {
cy.fixture('trees.json');
cy.fixture('trees_none.json');
cy.route('**/render-layer/**', 'fixture:trees_none.json').as('empty-trees-layer');
- cy.route('**/16463/10787**', 'fixture:trees.json').as('trees-layer');
+ cy.route('**/16301/10787**', 'fixture:trees.json').as('trees-layer');
cy.route('/report/new/ajax*').as('report-ajax');
cy.visit('http://northamptonshire.localhost:3001/');
cy.get('[name=pc]').type('NN1 1NS');
@@ -30,7 +30,7 @@ it('selecting an asset allows a report', function() {
cy.fixture('trees.json');
cy.fixture('trees_none.json');
cy.route('**/render-layer/**', 'fixture:trees_none.json').as('empty-trees-layer');
- cy.route('**/16463/10787**', 'fixture:trees.json').as('trees-layer');
+ cy.route('**/16301/10787**', 'fixture:trees.json').as('trees-layer');
cy.route('/report/new/ajax*').as('report-ajax');
cy.visit('http://northamptonshire.localhost:3001/');
cy.get('[name=pc]').type('NN1 2NS');
@@ -52,8 +52,8 @@ it('detects multiple assets at same location', function() {
cy.fixture('trees.json');
cy.fixture('trees_none.json');
cy.route('**/render-layer/**', 'fixture:trees_none.json').as('empty-trees-layer');
- cy.route('**/16463/10787**', 'fixture:trees.json').as('trees-layer');
- cy.route('**/16463/10788**', 'fixture:trees.json').as('trees-layer2');
+ cy.route('**/16301/10787**', 'fixture:trees.json').as('trees-layer');
+ cy.route('**/16301/10788**', 'fixture:trees.json').as('trees-layer2');
cy.route('/report/new/ajax*').as('report-ajax');
cy.visit('http://northamptonshire.localhost:3001/');
cy.get('[name=pc]').type('NN1 2NS');
@@ -70,3 +70,16 @@ it('detects multiple assets at same location', function() {
cy.contains('more than one tree at this location');
});
+
+it('shows the emergency message', function() {
+ cy.server();
+ cy.route('/report/new/ajax*').as('report-ajax');
+ cy.visit('http://northamptonshire.localhost:3001/');
+ cy.get('[name=pc]').type('NN1 2NS');
+ cy.get('[name=pc]').parents('form').submit();
+ cy.get('#map_box').click();
+ cy.wait('@report-ajax');
+ cy.get('[id=category_group]').select('Very Urgent');
+ cy.contains('Please call us instead, it is very urgent.');
+ cy.get('#form_title').should('not.be.visible');
+});
diff --git a/.cypress/cypress/integration/regressions.js b/.cypress/cypress/integration/regressions.js
index af6a1d73d..7bdd8f6fe 100644
--- a/.cypress/cypress/integration/regressions.js
+++ b/.cypress/cypress/integration/regressions.js
@@ -54,4 +54,21 @@ describe('Regression tests', function() {
cy.get('.content').should('not.contain', 'toddler');
});
+ it.only('has the correct send-to text at all times', function() {
+ cy.server();
+ cy.route('/report/new/ajax*').as('report-ajax');
+ cy.visit('/');
+ cy.get('[name=pc]').type('NN1 1NS');
+ cy.get('[name=pc]').parents('form').submit();
+
+ cy.get('#map_box').click();
+ cy.wait('@report-ajax');
+ cy.get('[id=category_group]').select('Graffiti');
+ cy.contains(/These will be sent to Northampton Borough Council and also/);
+
+ cy.get('#map_box').click(200, 200);
+ cy.wait('@report-ajax');
+ cy.contains(/These will be sent to Northampton Borough Council and also/);
+ });
+
});
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eb6e86381..b18762648 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@
- Prevent creation of two templates with same title.
- Fix bug going between report/new pages client side
- Don't include private reports when searching by ref from front page.
+ - Set fixmystreet.bodies sooner client-side, for two-tier locations.
- Development improvements:
- Upgrade the underlying framework and a number of other packages.
- Add feature cobrand helper function.
diff --git a/bin/browser-tests b/bin/browser-tests
index fd3fc19d7..37f542c92 100755
--- a/bin/browser-tests
+++ b/bin/browser-tests
@@ -14,7 +14,7 @@ use Getopt::Long ':config' => qw(pass_through auto_help);
my ($run_server, $run_cypress, $vagrant);
my $config_file = 'conf/general.yml-example';
-my $cobrand = [ 'fixmystreet', 'northamptonshire', 'bathnes' ];
+my $cobrand = [ 'fixmystreet', 'northamptonshire', 'bathnes', 'buckinghamshire' ];
my $coords = '51.532851,-2.284277';
my $area_id = 2608;
my $name = 'Borsetshire';
@@ -91,7 +91,7 @@ sub run {
if (($run_cypress && !$run_server) || $pid) {
# Parent, run the test runner (then kill the child)
- my $exit = system("cypress", $cmd, '--config', 'pluginsFile=false,supportFile=false,blacklistHosts=[gaze.mysociety.org,*.openstreetmap.org]', '--project', '.cypress', @ARGV);
+ my $exit = system("cypress", $cmd, '--config', 'pluginsFile=false,supportFile=false', '--project', '.cypress', @ARGV);
kill 'TERM', $pid if $pid;
exit $exit >> 8;
} else {
@@ -129,7 +129,7 @@ browser-tests [running options] [fixture options] [cypress options]
--help this help message
Fixture option:
- --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes
+ --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes,buckinghamshire
--coords Default co-ordinates for created reports
--area_id Area ID to use for created body
--name Name to use for created body
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index 4a5bd3aed..3c3336811 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -92,12 +92,48 @@ for my $cat ('Dropped Kerbs', 'Skips') {
}
if ($opt->test_fixtures) {
- my $ncc = FixMyStreet::DB::Factory::Body->find_or_create({
- area_id => 2234,
- categories => [ 'Fallen Tree' ],
- name => 'Northamptonshire County Council',
+ my $bodies;
+ foreach (
+ { area_id => 2234, categories => ['Fallen Tree', 'Very Urgent'], name => 'Northamptonshire County Council' },
+ { area_id => 2217, categories => ['Flytipping', 'Roads'], name => 'Buckinghamshire County Council' },
+ { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' },
+ { area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' },
+ ) {
+ $bodies->{$_->{area_id}} = FixMyStreet::DB::Factory::Body->find_or_create($_);
+ my $cats = join(', ', @{$_->{categories}});
+ say "Created body $_->{name} for MapIt area ID $_->{area_id}, categories $cats";
+ }
+
+ my $child_cat = FixMyStreet::DB->resultset("Contact")->find({
+ body => $bodies->{2234},
+ category => 'Very Urgent',
+ });
+ $child_cat->set_extra_fields({
+ code => 'emergency',
+ datatype => 'string',
+ description => 'Please call us instead, it is very urgent.',
+ order => 1,
+ variable => 'false',
+ });
+ $child_cat->update;
+
+ $child_cat = FixMyStreet::DB->resultset("Contact")->find({
+ body => $bodies->{2217},
+ category => 'Flytipping',
});
- say "Created body " . $ncc->name . " for MapIt area ID 2234, categories Fallen Tree";
+ $child_cat->set_extra_fields({
+ code => 'road-placement',
+ datatype => 'singlevaluelist',
+ description => 'Is the fly-tip located on',
+ order => 100,
+ required => 'true',
+ variable => 'true',
+ values => [
+ { key => 'road', name => 'The road' },
+ { key => 'off-road', name => 'Off the road/on a verge' },
+ ],
+ });
+ $child_cat->update;
}
FixMyStreet::DB::Factory::ResponseTemplate->create({
diff --git a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
index 8d8ba3268..2506772b3 100644
--- a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
@@ -111,8 +111,6 @@ sub categories_restriction {
] } );
}
-sub map_type { 'Lincolnshire' }
-
sub pin_colour {
my ( $self, $p, $context ) = @_;
my $ext_status = $p->get_extra_metadata('external_status_code');
diff --git a/perllib/FixMyStreet/Map/Buckinghamshire.pm b/perllib/FixMyStreet/Map/Buckinghamshire.pm
index d24077f70..e811eac50 100644
--- a/perllib/FixMyStreet/Map/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Map/Buckinghamshire.pm
@@ -37,14 +37,9 @@ sub copyright {
sub map_javascript { [
'/vendor/OpenLayers/OpenLayers.wmts.js',
- '/vendor/OpenLayers.Projection.OrdnanceSurvey.js',
'/js/map-OpenLayers.js',
'/js/map-wmts-base.js',
'/js/map-wmts-buckinghamshire.js',
- '/cobrands/fixmystreet/assets.js',
- '/cobrands/fixmystreet-uk-councils/roadworks.js',
- '/cobrands/buckinghamshire/js.js',
- '/cobrands/buckinghamshire/assets.js',
] }
1;
diff --git a/perllib/FixMyStreet/Map/Lincolnshire.pm b/perllib/FixMyStreet/Map/Lincolnshire.pm
deleted file mode 100644
index 7dbfe5d8e..000000000
--- a/perllib/FixMyStreet/Map/Lincolnshire.pm
+++ /dev/null
@@ -1,21 +0,0 @@
-# FixMyStreet:Map::Lincolnshire
-# More JavaScript, for street assets
-
-package FixMyStreet::Map::Lincolnshire;
-use base 'FixMyStreet::Map::FMS';
-
-use strict;
-
-sub map_javascript { [
- '/vendor/OpenLayers/OpenLayers.wfs.js',
- '/vendor/OpenLayers.Projection.OrdnanceSurvey.js',
- '/js/map-OpenLayers.js',
- '/js/map-bing-ol.js',
- '/js/map-fms.js',
- '/cobrands/fixmystreet-uk-councils/roadworks.js',
- '/cobrands/fixmystreet/assets.js',
- '/cobrands/lincolnshire/roadworks.js',
- '/cobrands/lincolnshire/assets.js',
-] }
-
-1;
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm
index c255c916a..60ba30fe3 100644
--- a/t/Mock/MapIt.pm
+++ b/t/Mock/MapIt.pm
@@ -28,6 +28,8 @@ my @PLACES = (
[ 'BS10 5EE', 51.494885, -2.602237, 2561, 'Bristol City Council', 'UTA', 148646, 'Bedminster', 'UTW' ],
[ 'BS20 5EE', 51.496194, -2.603439, 2608, 'Borsetshire County Council', 'CTY', 148646, 'Bedminster', 'UTW' ],
[ 'SL9 0NX', 51.615559, -0.556903, 2217, 'Buckinghamshire County Council', 'CTY', 2257, 'Chiltern District Council', 'DIS' ],
+ [ '?', 51.615499, -0.556667, 2217, 'Buckinghamshire County Council', 'CTY', 2257, 'Chiltern District Council', 'DIS' ],
+ [ '?', 51.615439, -0.558362, 2217, 'Buckinghamshire County Council', 'CTY', 2257, 'Chiltern District Council', 'DIS' ],
[ 'SW1A 1AA', 51.501009, -0.141588, 2504, 'Westminster City Council', 'LBO' ],
[ 'GL50 2PR', 51.896268, -2.093063, 2226, 'Gloucestershire County Council', 'CTY', 2326, 'Cheltenham Borough Council', 'DIS', 4544, 'Lansdown', 'DIW', 143641, 'Lansdown and Park', 'CED' ],
[ 'OX20 1SZ', 51.754926, -1.256179, 2237, 'Oxfordshire County Council', 'CTY', 2421, 'Oxford City Council', 'DIS' ],
@@ -37,8 +39,9 @@ my @PLACES = (
[ 'LE15 0GJ', 52.670447, -0.727877, 2600, 'Rutland County Council', 'CTY'],
[ 'BR1 3UH', 51.4021, 0.01578, 2482, 'Bromley Council', 'LBO' ],
[ 'BR1 3UH', 51.402096, 0.015784, 2482, 'Bromley Council', 'LBO' ],
- [ 'NN1 1NS', 52.236251, 0.892052, 2234, 'Northamptonshire County Council', 'CTY', 2397, 'Northampton Borough Council', 'DIS' ],
- [ 'NN1 2NS', 52.238301, 0.889992, 2234, 'Northamptonshire County Council', 'CTY', 2397, 'Northampton Borough Council', 'DIS' ],
+ [ 'NN1 1NS', 52.236251, -0.892052, 2234, 'Northamptonshire County Council', 'CTY', 2397, 'Northampton Borough Council', 'DIS' ],
+ [ 'NN1 2NS', 52.238301, -0.889992, 2234, 'Northamptonshire County Council', 'CTY', 2397, 'Northampton Borough Council', 'DIS' ],
+ [ '?', 52.238827, -0.894970, 2234, 'Northamptonshire County Council', 'CTY', 2397, 'Northampton Borough Council', 'DIS' ],
[ 'TW7 5JN', 51.482286, -0.328163, 2483, 'Hounslow Borough Council', 'LBO' ],
[ '?', 50.78301, -0.646929 ],
[ 'TA1 1QP', 51.023569, -3.099055, 2239, 'Somerset County Council', 'CTY', 2429, 'Taunton Deane Borough Council', 'DIS' ],
diff --git a/t/map/tests.t b/t/map/tests.t
index 692cf6790..7e3b6f6bd 100644
--- a/t/map/tests.t
+++ b/t/map/tests.t
@@ -6,7 +6,7 @@ my $requires = {
'Bing' => 'map-bing-ol.js',
'Bristol' => 'bristol/assets.js',
'Bromley' => 'bromley/assets.js',
- 'Buckinghamshire' => 'buckinghamshire/assets.js',
+ 'Buckinghamshire' => 'map-wmts-buckinghamshire.js',
'Lincolnshire' => 'lincolnshire/assets.js',
'FMS' => 'map-fms.js',
'Google' => 'map-google.js',
diff --git a/templates/web/buckinghamshire/footer_extra_js.html b/templates/web/buckinghamshire/footer_extra_js.html
index 8113befc9..6080f5e4f 100644
--- a/templates/web/buckinghamshire/footer_extra_js.html
+++ b/templates/web/buckinghamshire/footer_extra_js.html
@@ -1,3 +1,14 @@
[% scripts.push(
version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'),
) %]
+[%~
+IF bodyclass.match('mappage');
+ scripts.push(
+ version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'),
+ version('/cobrands/fixmystreet/assets.js'),
+ version('/cobrands/fixmystreet-uk-councils/roadworks.js'),
+ version('/cobrands/buckinghamshire/js.js'),
+ version('/cobrands/buckinghamshire/assets.js'),
+ );
+END
+%]
diff --git a/templates/web/lincolnshire/footer_extra_js.html b/templates/web/lincolnshire/footer_extra_js.html
index 8113befc9..946bddfdc 100644
--- a/templates/web/lincolnshire/footer_extra_js.html
+++ b/templates/web/lincolnshire/footer_extra_js.html
@@ -1,3 +1,14 @@
[% scripts.push(
version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'),
) %]
+[%~
+IF bodyclass.match('mappage');
+ scripts.push(
+ version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'),
+ version('/cobrands/fixmystreet-uk-councils/roadworks.js'),
+ version('/cobrands/fixmystreet/assets.js'),
+ version('/cobrands/lincolnshire/roadworks.js'),
+ version('/cobrands/lincolnshire/assets.js'),
+ );
+END
+%]
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 11e9045ab..d71217ad0 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1196,6 +1196,11 @@ fixmystreet.fetch_reporting_data = function() {
fixmystreet.reporting_data = data;
+ fixmystreet.bodies = data.bodies || [];
+ if (fixmystreet.body_overrides) {
+ fixmystreet.body_overrides.clear();
+ }
+
fixmystreet.update_councils_text(data);
$('#js-top-message').html(data.top_message || '');
@@ -1218,11 +1223,6 @@ fixmystreet.fetch_reporting_data = function() {
lb.before(data.extra_name_info);
}
- fixmystreet.bodies = data.bodies || [];
- if (fixmystreet.body_overrides) {
- fixmystreet.body_overrides.clear();
- }
-
if (data.contribute_as) {
var $select = $('.js-contribute-as');
if (!$select.data('original')) {