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

Track map state in URL for easier link sharing #2301

Merged
merged 3 commits into from
Feb 5, 2019

Conversation

davea
Copy link
Member

@davea davea commented Oct 19, 2018

  • /around pages
  • /reports pages

Fixes #2242.

@ghost ghost assigned davea Oct 19, 2018
@ghost ghost added the Reviewing label Oct 19, 2018
@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #2301 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2301      +/-   ##
==========================================
+ Coverage   80.72%   80.79%   +0.06%     
==========================================
  Files         192      192              
  Lines       12395    12386       -9     
  Branches     2308     2307       -1     
==========================================
+ Hits        10006    10007       +1     
+ Misses       1615     1598      -17     
- Partials      774      781       +7
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/Zurich.pm 87.44% <ø> (-0.03%) ⬇️
perllib/FixMyStreet/Cobrand/Default.pm 83.87% <ø> (-0.23%) ⬇️
perllib/FixMyStreet/App.pm 87.05% <ø> (-0.45%) ⬇️
perllib/FixMyStreet/Cobrand/Bristol.pm 37.93% <ø> (+1.26%) ⬆️
perllib/FixMyStreet/Map/Google.pm 65.21% <100%> (+37.94%) ⬆️
perllib/FixMyStreet/Map/OSM.pm 95.12% <100%> (+0.06%) ⬆️
perllib/Utils.pm 99% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47befd5...1ba5f1c. Read the comment docs.

@davea davea changed the title WIP Track map state in URL for easier link sharing Track map state in URL for easier link sharing Oct 23, 2018
@davea davea force-pushed the 2242-automatic-permalink branch 2 times, most recently from 4b8ebfc to 6e1512a Compare December 13, 2018 09:49
@davea davea requested a review from dracos January 2, 2019 09:35
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions, more for discussing than anything necessarily needing changing, as I'm not sure I understood everything :)

web/js/map-OpenLayers.js Show resolved Hide resolved
web/js/map-OpenLayers.js Outdated Show resolved Hide resolved
web/js/map-OpenLayers.js Outdated Show resolved Hide resolved
web/js/map-OpenLayers.js Show resolved Hide resolved
perllib/FixMyStreet/Map/OSM.pm Outdated Show resolved Hide resolved
@davea
Copy link
Member Author

davea commented Jan 17, 2019

Thanks for the feedback - I think I've addressed everything!

@ghost ghost assigned dracos Jan 18, 2019
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One query about the "problems nearby" exemption logic, is all I think, on the existing code.
The outstanding issue not covered is URLs having lat/lon and latitude/longitude in them. Only use of the long-form is the geocoder disambiguation, so perhaps we should look at switching them to short-form, unless there's some reason why they're not...

// may have changed since then if e.g. the map filters have been updated.
// NB this won't change the base of the 'problems nearby' permalink on
// /report, as this would result in it pointing at the wrong page.
if (this.base !== '/around' && fixmystreet.page !== 'report') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be or, not and - if you only want to exclude /around on a report page? Don't think it matters for the othe one on a report page, though, as the URL will be the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, thinking a bit about this, should we even be in this function if we are on a report page? All it's going to do is add cruft to the permalink url.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to permalink an offset pin? e.g. https://www.fixmystreet.com/report/1234567?zoom=2&lat=51.5588&lon=-1.14649&layers=BT But I agree this seems pretty unlikely.

web/js/map-OpenLayers.js Show resolved Hide resolved
web/js/map-OpenLayers.js Outdated Show resolved Hide resolved
Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

davea and others added 2 commits February 4, 2019 18:31
Remove the server-side zoom-in-url fix, instead use an ArgParser
subclass to default to the provided data if nothing in URL. Then
we can switch to using short lat/lon in geocoder URLs.
@dracos dracos merged commit 1ba5f1c into master Feb 5, 2019
@ghost ghost removed the Reviewing label Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants