Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bromley] Disable 'Street Cleansing' categories when selection is in park. #5283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions .cypress/cypress/fixtures/bromley-parks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?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/bromley_wfs?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=Parks_Open_Spaces&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:3857">
<gml:lowerCorner>544.157776 6692326.384066</gml:lowerCorner>
<gml:upperCorner>2064.918837 6693912.545851</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.667">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>1048.679923 6692639.172392</gml:lowerCorner>
<gml:upperCorner>1592.383013 6693257.392526</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">1295.991452 6693130.371171 1314.811637 6693120.947234 1334.326449 6693120.522808 1334.482385 6693126.215358 1339.386060 6693127.604981 1349.365955 6693138.435295 1351.063667 6693144.903867 1350.743168 6693148.394986 1350.833487 6693168.050692 1325.907678 6693163.761596 1324.891831 6693164.656103 1324.200917 6693169.232602 1319.642639 6693169.935689 1320.183647 6693174.494354 1319.661782 6693181.152390 1318.229020 6693185.524636 1307.346600 6693210.697695 1301.268397 6693227.201342 1302.951340 6693232.547064 1308.072620 6693237.204460 1324.872624 6693244.589691 1326.322860 6693242.608034 1325.283881 6693244.995619 1332.575822 6693248.261344 1332.829442 6693247.002649 1335.550349 6693247.585760 1335.966978 6693246.434915 1345.379386 6693248.230105 1345.077788 6693249.490121 1347.986664 6693249.923628 1353.559505 6693251.198570 1354.669314 6693246.722832 1359.662957 6693249.056802 1358.242755 6693257.392526 1359.890084 6693257.347208 1373.783461 6693200.701964 1377.531275 6693199.042239 1378.392812 6693197.189112 1382.843978 6693196.665461 1388.090771 6693194.804016 1393.754180 6693191.791728 1398.030117 6693188.962041 1404.993370 6693183.153803 1423.952346 6693186.387247 1441.208225 6693190.550134 1488.978667 6693202.602994 1518.828855 6693211.361709 1527.985830 6693182.240026 1541.533658 6693186.007306 1542.170293 6693209.226674 1536.366355 6693239.219014 1549.592928 6693238.854855 1550.059260 6693195.738113 1545.355923 6693144.451336 1537.644819 6693104.882041 1535.451923 6693085.027616 1536.917643 6693078.359707 1549.235163 6693044.850785 1568.104939 6693043.673291 1569.064373 6693023.796413 1570.077588 6693021.056531 1573.388141 6693020.965374 1573.070231 6693009.371986 1587.782465 6692978.576071 1590.839266 6692972.728402 1588.887136 6692971.578623 1592.383013 6692964.822796 1581.094255 6692958.795041 1579.885179 6692961.395873 1570.235296 6692956.767217 1571.446573 6692954.246563 1559.587103 6692947.833324 1563.223137 6692940.351552 1554.013564 6692935.068401 1531.269620 6692921.974823 1535.243111 6692915.125677 1527.286305 6692910.619682 1517.346445 6692904.990581 1512.239635 6692902.118977 1501.723200 6692895.598758 1504.494556 6692890.955661 1476.416291 6692871.177808 1487.158436 6692853.844002 1496.012897 6692840.262907 1497.645436 6692836.808491 1493.842665 6692834.121007 1524.691146 6692813.373750 1530.031421 6692811.429493 1540.182954 6692774.820089 1561.743838 6692726.471480 1585.494747 6692738.735080 1586.915079 6692730.415885 1407.452884 6692639.172392 1358.000232 6692705.216533 1256.988312 6692761.044842 1252.593385 6692764.198514 1261.640391 6692776.049005 1226.865473 6692812.404336 1197.068267 6692842.348516 1191.015036 6692849.238556 1168.754251 6692877.370906 1154.707690 6692895.119790 1144.671115 6692907.928332 1140.461745 6692913.772800 1121.091772 6692940.525981 1109.421720 6692950.378630 1094.396552 6692941.147180 1087.400150 6692963.291845 1083.781376 6692969.665698 1075.353467 6692980.440225 1048.679923 6693018.129695 1071.113567 6693029.629057 1095.121917 6692992.221305 1118.824918 6692955.945340 1132.863803 6692933.815748 1146.145981 6692913.279597 1149.393880 6692909.146487 1158.453625 6692897.488074 1172.811012 6692878.815959 1193.989608 6692852.077327 1200.500482 6692844.950046 1230.472976 6692815.562664 1260.874616 6692842.182961 1287.558749 6692862.791581 1319.884766 6692883.694310 1291.090732 6692919.292151 1264.460233 6692949.743623 1247.967932 6692975.198512 1225.840044 6693012.282138 1213.294718 6693037.516305 1200.749092 6693079.696521 1232.930354 6693090.028904 1258.371788 6693100.883495 1276.523895 6693112.066855 1295.991452 6693130.371171 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
<ms:site_name>Church House Gardens</ms:site_name>
<ms:site_code>CHHSGD</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.718">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>544.157776 6692938.958607</gml:lowerCorner>
<gml:upperCorner>1021.530745 6693251.359136</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">544.157776 6693102.180768 602.581475 6693147.485866 610.575818 6693154.215247 610.765847 6693161.174651 624.084377 6693172.973498 658.848240 6693239.789217 667.406129 6693236.088230 679.481467 6693234.007865 684.798055 6693238.210963 690.090996 6693241.548135 693.656202 6693244.916646 737.245208 6693222.875077 745.366128 6693234.816400 749.866419 6693240.774998 758.661306 6693245.749198 768.335410 6693250.683221 775.284269 6693251.359136 790.861965 6693250.931700 804.585924 6693245.339609 813.960069 6693239.882918 831.019810 6693229.850335 844.585260 6693219.047062 864.949799 6693202.857737 876.763761 6693191.219906 885.155787 6693181.457290 898.570920 6693164.576107 917.888975 6693142.317444 938.863163 6693117.413639 950.622292 6693103.193696 961.651526 6693095.059712 1014.945912 6693047.556258 1021.530745 6693034.345006 1000.525693 6693027.090878 878.206595 6692990.491894 786.480013 6692963.482501 723.522611 6692942.615393 709.561682 6692939.516123 698.294999 6692938.958607 688.810514 6692940.951821 680.205637 6692942.920902 668.209328 6692948.465199 658.883583 6692955.685383 650.452307 6692964.598076 544.157776 6693102.180768 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
<ms:site_name>Queens Mead Rec Ground</ms:site_name>
<ms:site_code>QUMERG</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.780">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>719.616869 6693034.375983</gml:lowerCorner>
<gml:upperCorner>1296.920042 6693529.094427</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:MultiSurface srsName="EPSG:3857">
<gml:surfaceMember>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">1283.582596 6693219.268501 1274.818429 6693227.577300 1274.644718 6693227.499431 1272.502024 6693226.539489 1269.543927 6693225.214098 1263.097373 6693221.782256 1262.427391 6693221.297425 1261.527985 6693220.816015 1260.001053 6693219.541455 1259.424966 6693219.124652 1259.312070 6693218.947221 1258.987528 6693218.639204 1258.572323 6693218.088955 1258.241477 6693217.696861 1257.906239 6693217.144413 1257.650969 6693216.589766 1257.393503 6693215.954941 1257.298167 6693215.395896 1257.120668 6693214.758872 1257.034114 6693214.520538 1256.850029 6693213.642981 1256.847894 6693213.623461 1256.743715 6693212.683048 1256.643988 6693211.963647 1256.717026 6693205.863551 1258.760694 6693198.666179 1259.143774 6693196.874364 1259.966441 6693193.016372 1260.018080 6693192.657734 1260.302603 6693190.680232 1260.513960 6693189.631328 1260.601762 6693188.746298 1260.767960 6693187.217210 1260.844160 6693186.492974 1260.886805 6693185.379224 1260.928865 6693185.027268 1260.906747 6693184.897570 1259.613482 6693177.327558 1259.022802 6693173.870310 1259.041862 6693173.864972 1260.182633 6693173.551809 1263.466404 6693172.649829 1272.943134 6693170.047098 1272.949963 6693170.045145 1288.342349 6693176.813236 1296.515009 6693180.406828 1296.648087 6693179.474497 1296.920042 6693173.625714 1295.008305 6693166.938329 1286.385901 6693152.491988 1276.062858 6693139.649033 1258.859747 6693128.054402 1233.389689 6693116.157481 1203.203713 6693105.048083 1172.468613 6693090.246739 1112.029557 6693066.729475 1066.494022 6693049.734823 1036.717744 6693038.372933 1024.492537 6693034.375983 1020.348341 6693041.438281 1016.180452 6693047.634680 1021.544460 6693053.569269 974.890077 6693090.459658 957.949640 6693104.837941 937.838740 6693129.702006 905.082022 6693167.975952 885.739762 6693189.352703 873.996393 6693203.572268 861.302770 6693215.234257 851.136485 6693223.328491 828.205027 6693240.470892 811.976697 6693248.715422 719.616869 6693294.706725 722.318893 6693298.114971 749.655974 6693283.451616 794.171999 6693263.117358 815.526400 6693252.100356 829.187014 6693244.776812 850.581420 6693234.641265 885.047946 6693258.890028 899.214677 6693270.665280 917.121688 6693291.035716 932.167731 6693302.770768 983.748850 6693342.966318 944.984375 6693399.203594 1003.468471 6693430.174889 1042.765282 6693472.970875 1040.281311 6693476.954855 1087.629157 6693529.094427 1130.719326 6693504.014539 1161.772798 6693483.614396 1207.960681 6693445.418055 1223.767896 6693405.425092 1228.102440 6693357.964500 1231.897767 6693353.944465 1230.970929 6693344.646133 1234.001596 6693328.482860 1241.360597 6693304.385333 1245.451160 6693295.366342 1253.899894 6693279.503519 1266.032578 6693256.141426 1275.356298 6693240.671834 1278.038267 6693235.157925 1280.611831 6693226.854711 1283.582596 6693219.268501 </gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList srsDimension="2">1259.398010 6693241.262314 1230.269044 6693255.295350 1217.705677 6693236.624264 1221.223725 6693218.971428 1238.010072 6693203.649825 1261.624014 6693233.089816 1261.033227 6693234.515045 1259.763012 6693234.859211 1259.055609 6693239.285189 1259.398010 6693241.262314 </gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:Polygon>
</gml:surfaceMember>
</gml:MultiSurface>
</ms:msGeometry>
<ms:site_name>Martins Hill Rec Ground</ms:site_name>
<ms:site_code>MAHRIG</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.826">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>1896.958063 6693026.124792</gml:lowerCorner>
<gml:upperCorner>2064.918837 6693262.979395</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">1904.872490 6693246.011772 1956.457625 6693255.886693 1965.777084 6693253.126201 1967.751394 6693256.826902 1995.346528 6693259.211041 1995.450055 6693262.979395 2045.408510 6693259.081566 2050.397284 6693258.318050 2051.576035 6693255.782085 2059.562792 6693250.538772 2062.021768 6693248.577292 2061.591238 6693232.910607 2064.554842 6693227.180058 2059.509785 6693134.452136 2053.015397 6693125.853387 2059.113641 6693120.036419 2062.630567 6693111.145388 2064.918837 6693103.556014 2062.148492 6693093.602845 2058.217806 6693087.436787 2052.433113 6693081.947737 2047.306528 6693077.692220 2023.402824 6693073.328926 2029.504435 6693044.917325 1937.630614 6693026.124792 1933.192907 6693046.948146 1935.080092 6693046.896101 1919.685880 6693124.508435 1918.422415 6693124.543277 1916.774918 6693132.740811 1918.072735 6693133.956722 1908.174948 6693184.426254 1906.320900 6693185.103235 1904.656647 6693192.691481 1905.921304 6693193.282463 1899.332823 6693226.714773 1898.691906 6693226.106588 1896.958063 6693231.161261 1904.872490 6693246.011772 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
<ms:site_name>Queens Gardens</ms:site_name>
<ms:site_code>QUEEGD</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.1083">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>1518.669955 6692326.384066</gml:lowerCorner>
<gml:upperCorner>1608.973987 6692374.121806</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">1518.669955 6692331.005327 1545.004141 6692351.911886 1545.636833 6692362.718326 1546.926372 6692371.737510 1560.449091 6692369.982098 1572.011550 6692372.800036 1574.822962 6692374.121806 1607.541981 6692372.191572 1608.973987 6692363.563902 1598.592686 6692358.188565 1600.556285 6692353.743789 1595.013768 6692349.924007 1597.184292 6692344.830273 1591.838711 6692340.586763 1590.573671 6692339.495841 1584.189028 6692334.798450 1574.088210 6692347.283516 1559.513771 6692335.815571 1549.746457 6692347.599864 1522.377168 6692326.384066 1518.669955 6692331.005327 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
<ms:site_name>Newbury Rd GIA (Playground)</ms:site_name>
<ms:site_code>NEWBRDPG</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
<gml:featureMember>
<ms:Parks_Open_Spaces gml:id="Parks_Open_Spaces.1137">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>1419.312828 6693715.691330</gml:lowerCorner>
<gml:upperCorner>1565.935351 6693912.545851</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">1419.534330 6693879.664165 1445.121230 6693886.968401 1445.081232 6693885.509050 1542.647485 6693912.545851 1565.935351 6693902.548050 1548.908778 6693863.022995 1543.399629 6693847.157922 1538.137786 6693821.046928 1538.653294 6693806.572781 1539.175287 6693772.486943 1531.767544 6693766.768933 1529.676113 6693770.469569 1519.520908 6693763.206276 1527.866897 6693750.602970 1525.270308 6693748.138772 1527.687505 6693744.060059 1524.727883 6693741.782392 1526.607591 6693737.365411 1489.022472 6693715.691330 1467.768212 6693747.892163 1463.947643 6693746.906014 1464.431673 6693744.710075 1461.682731 6693743.694429 1455.506765 6693763.058618 1449.668251 6693762.031709 1438.847002 6693797.042904 1437.739596 6693796.351187 1435.577831 6693803.327695 1436.488468 6693803.848291 1422.948763 6693845.386091 1427.879423 6693847.160213 1419.312828 6693871.581613 1421.530734 6693873.077320 1419.534330 6693879.664165 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
<ms:site_name>College Green</ms:site_name>
<ms:site_code>COLLGN</ms:site_code>
</ms:Parks_Open_Spaces>
</gml:featureMember>
</wfs:FeatureCollection>


11 changes: 11 additions & 0 deletions .cypress/cypress/integration/bromley.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ describe('Bromley cobrand', function() {
cy.route('**mapserver/bromley*PROW*', 'fixture:bromley-prow.xml').as('prow');
cy.route('**mapserver/bromley*Crystal_Palace*', 'fixture:crystal_palace_park.xml').as('crystal');
cy.route('**mapserver/bromley*National_Sports*', 'fixture:national_sports_centre.xml').as('sport_centre');
cy.route('**mapserver/bromley*Parks_Open_Spaces*', 'fixture:bromley-parks.xml').as('parks');
cy.route('/report/new/ajax*').as('report-ajax');
cy.viewport(480, 800);
cy.visit('http://bromley.localhost:3001/report/new?latitude=51.4021&longitude=0.01578');
cy.contains('Bromley');
cy.wait('@prow');
cy.wait('@crystal');
cy.wait('@sport_centre');
cy.wait('@parks');
cy.wait('@report-ajax');
cy.get('#mob_ok').click();
});
Expand Down Expand Up @@ -57,4 +59,13 @@ describe('Bromley cobrand', function() {
cy.get('#mob_ok').should('not.be.visible');
});

it('adds stopper for Street Cleansing categories within a park', function() {
cy.visit('http://bromley.localhost:3001/report/new?longitude=0.007803&latitude=51.403986');
cy.wait('@parks');
cy.get('#mob_ok').click();
cy.pickCategory('Street Cleansing');
cy.contains('The selected location is in a park');
cy.get('#mob_ok').should('not.be.visible');
});

});
2 changes: 2 additions & 0 deletions bin/fixmystreet.com/fixture
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ if ($opt->test_fixtures) {
{ area_id => 2482, categories => [
{ group => 'Street Lighting and Road Signs', category => 'Sign Light Not Working' },
{ group => 'Street Lighting and Road Signs', category => 'Lamp Column Damaged' },
{ group => 'Street Cleansing', category => 'Dead Animal' },
{ group => 'Street Cleansing', category => 'Dog Fouling' },
], name => 'Bromley Council', cobrand => 'bromley' },
{ area_id => 164186, categories => ['Shelter Damaged', 'Very Urgent'], name => 'Northamptonshire Highways', cobrand => 'northamptonshire' },
{ area_id => 163793, categories => [
Expand Down
10 changes: 10 additions & 0 deletions data/test-asset-layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ bromley:
actions:
found: fixmystreet.assets.bromley.found
not_found: fixmystreet.assets.bromley.not_found
- wfs_feature: 'Parks_Open_Spaces'
non_interactive: true
nearest_radius: 0
road: true
always_visible: true
stylemap: fixmystreet.assets.stylemap_invisible
no_asset_message: "<p>The selected location is in a park. Please select a ‘Parks and Greenspace’ category instead.</p>"
actions:
found: fixmystreet.assets.bromley.park_asset_found
not_found: fixmystreet.assets.bromley.park_asset_not_found
buckinghamshire:
- - name: 'default'
http_wfs_url: "https://tilma.staging.mysociety.org/mapserver/bucks"
Expand Down
2 changes: 2 additions & 0 deletions t/Mock/MapIt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ my @PLACES = (
[ '?', 51.422382, -0.064555, 2482, 'Bromley Council', 'LBO' ],
# National Sports Centre in Crystal Palace Park
[ '?', 51.419275, -0.071410, 2482, 'Bromley Council', 'LBO' ],
# Point in a park
[ '?', 51.403986, 0.007803, 2482, 'Bromley Council', 'LBO' ],
[ 'KT1 1AA', 51.408688, -0.304465, 2480, 'Kingston upon Thames Council', 'LBO' ],
[ 'SM2 5HF', 51.354679, -0.183895, 2498, 'Sutton Borough Council', 'LBO' ],
[ '?', 51.466707, 0.181108, 2494, 'London Borough of Bexley', 'LBO' ],
Expand Down
Loading