aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZarino Zappia <mail@zarino.co.uk>2018-03-19 12:09:57 +0000
committerZarino Zappia <mail@zarino.co.uk>2018-03-20 10:06:42 +0000
commit3d012b7007a44d3be01400c0acb4166d0f73ba3f (patch)
treee0f5e60858493e7bca45b1c5fb66e6203ea0b8e0
parentff2a390dda475c24607365103e3ef72adc73aa63 (diff)
Clicking "big green banner" on /around begins a report
Data collected by #2001 has shown that some people are clicking the big green "Click map to report a problem" banner on fixmystreet.com/around. We assume the same is true for other cobrands. As suggested in #2016, this commit adds a click handler to that banner element, which will begin a new report at the centre of the screen. It might not be the exact right location, but the pin can be repositioned from the /report/new form, and beginning a report is better than just soaking up the click and doing nothing.
-rw-r--r--.cypress/cypress/integration/simple_spec.js14
-rw-r--r--CHANGELOG.md1
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js8
3 files changed, 23 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/simple_spec.js b/.cypress/cypress/integration/simple_spec.js
index 39000a022..fe0867c76 100644
--- a/.cypress/cypress/integration/simple_spec.js
+++ b/.cypress/cypress/integration/simple_spec.js
@@ -14,3 +14,17 @@ describe('My First Test', function() {
cy.get('form').submit();
});
});
+
+describe('Clicking the "big green banner" on a map page', function() {
+ before(function() {
+ cy.visit('/');
+ cy.get('[name=pc]').type('BS10 5EE');
+ cy.get('#postcodeForm').submit();
+ cy.get('.big-green-banner').click();
+ });
+
+ it('begins a new report', function() {
+ cy.url().should('include', '/report/new');
+ cy.get('#form_title').should('be.visible');
+ });
+});
diff --git a/CHANGELOG.md b/CHANGELOG.md
index efcdca382..b922ad5e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
- Increase size of "sub map links" (hide pins, permalink, etc) #2003
- Edge-to-edge email layout on narrow screens #2010
- Add default placeholder to report extra fields. #2027
+ - Clicking the "Click map" instruction banner now begins a new report #2033
- Bugfixes:
- Stop asset layers obscuring marker layer. #1999
- Don't delete hidden field values when inspecting reports. #1999
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index c187c218c..443d7d986 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -669,6 +669,14 @@ $.extend(fixmystreet.set_up, {
});
},
+ clicking_banner_begins_report: function() {
+ $('.big-green-banner').on('click', function(){
+ if (fixmystreet.map.getCenter) {
+ fixmystreet.display.begin_report( fixmystreet.map.getCenter() );
+ }
+ });
+ },
+
map_controls: function() {
//add permalink on desktop, force hide on mobile
//add links container (if its not there)