[openstreetmap/openstreetmap-website] Browse deleted objects (#1448)

Frederik Ramm notifications at github.com
Sun Feb 19 13:51:06 UTC 2017


This changes the "browse" view of nodes, ways, and relations to use a newly introduced API call named "fordisplay". The "fordisplay" call behaves identical to "full" for visible objects, but for invisible objects will return a previous, visible version of the object, together with either current or previous versions of dependencies. When "fordisplay" returns an object that is not currently visible, it will add a "deleted=true" attribute to the root element of the XML document, enabling the Javascript frontend code responsible for displaying the object on Leaflet to choose another style.

This is how a deleted object is represented on the browse page:

![deleted](https://cloud.githubusercontent.com/assets/705471/23102876/8fb719c8-f6b1-11e6-9083-deb66126c007.png)

This pull request fixes the nuisance that if you examine a changeset that deletes an object, and you click on the struck-through object ID, you're stranded with a browse page that doesn't even tell you where the object used to be.

This pull request does not contain implementation of the "fordisplay" API calls in cgimap.

Also, this pull request adds a few fixtures for tests and this introduces one test failure in AmfController that I was unable to understand or fix.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/1448

-- Commit Summary --

  * Display (a suitable older version of) deleted objects when browsing.
  * fix accidental revert of an upstream change

-- File Changes --

    M app/assets/javascripts/leaflet.map.js (18)
    M app/assets/javascripts/osm.js.erb (4)
    M app/controllers/node_controller.rb (20)
    M app/controllers/relation_controller.rb (104)
    M app/controllers/way_controller.rb (25)
    M app/models/node.rb (11)
    M app/models/relation.rb (10)
    M app/models/way.rb (11)
    M config/routes.rb (3)
    D db/structure.sql (2689)
    M test/controllers/amf_controller_test.rb (2)
    M test/controllers/changeset_controller_test.rb (2)
    M test/controllers/node_controller_test.rb (8)
    M test/controllers/way_controller_test.rb (25)
    M test/fixtures/current_nodes.yml (2)
    M test/fixtures/current_ways.yml (2)
    M test/fixtures/nodes.yml (12)
    M test/fixtures/way_nodes.yml (8)
    M test/fixtures/ways.yml (9)
    M test/models/old_node_test.rb (2)
    M test/models/old_way_test.rb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/1448.patch
https://github.com/openstreetmap/openstreetmap-website/pull/1448.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1448
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170219/7ce73b2f/attachment.html>


More information about the rails-dev mailing list