Skip to content

Commit

Permalink
fixup! [Bristol] Add layers for allowed reports
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 3, 2025
1 parent 72ee4cf commit c0c2f69
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions web/cobrands/fixmystreet-uk-councils/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,36 @@ fixmystreet.assets.bristol.park_stylemap = new OpenLayers.StyleMap({
});


var bristol_owned_asset = false;
var bristol_owned_assets = {
road: false,
property: false
};

fixmystreet.assets.bristol.road_found = function(layer) {
bristol_owned_asset = true;
bristol_owned_assets.road = true;
fixmystreet.message_controller.road_found(layer);

Check warning on line 278 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L277-L278

Added lines #L277 - L278 were not covered by tests
};

fixmystreet.assets.bristol.property_found = function(layer) {
bristol_owned_assets.property = true;
fixmystreet.message_controller.road_found(layer);

Check warning on line 283 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L282-L283

Added lines #L282 - L283 were not covered by tests
};

fixmystreet.assets.bristol.road_not_found = function(layer) {
if (bristol_owned_asset) {
bristol_owned_asset = false;
return;
bristol_owned_assets.road = false;
if (!bristol_owned_assets.road && !bristol_owned_assets.property && !fixmystreet.staff_set_up) {
fixmystreet.message_controller.road_not_found(layer, function() {return true;});

Check warning on line 289 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L287-L289

Added lines #L287 - L289 were not covered by tests
} else {
fixmystreet.message_controller.road_found(layer);

Check warning on line 291 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L291

Added line #L291 was not covered by tests
}
};

fixmystreet.assets.bristol.property_not_found = function(layer) {
bristol_owned_assets.property = false;
if (!bristol_owned_assets.road && !bristol_owned_assets.property && !fixmystreet.staff_set_up) {
fixmystreet.message_controller.road_not_found(layer, function() {return true;});

Check warning on line 298 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L296-L298

Added lines #L296 - L298 were not covered by tests
} else {
fixmystreet.message_controller.road_found(layer);

Check warning on line 300 in web/cobrands/fixmystreet-uk-councils/assets.js

View check run for this annotation

Codecov / codecov/patch

web/cobrands/fixmystreet-uk-councils/assets.js#L300

Added line #L300 was not covered by tests
}
};

Expand Down

0 comments on commit c0c2f69

Please sign in to comment.