[openstreetmap/openstreetmap-website] Load notes with remote control (PR #3718)

Anton Khorev notifications at github.com
Wed Sep 28 21:25:09 UTC 2022


The breakdown by commit is not ideal because I didn't know what I'd have to change when I started writing. Everything here can be broken down into six independent parts:

1. making notes to be "current objects" of the map
2. using note current objects to update edit links
3. calling the remote control commands - these 3 parts are required to see any working changes
4. test - previous 3 parts are required unless you want to tolerate failing tests
5. using the "closed" note marker as the "hidden" one too - not required, as long as you want javascript errors to keep happening when the "Hide" button is pressed
6. removing note id data attributes from the buttons in the view template - this is not required, but they are not used anywhere because the path is also written for each button and it contains the id. I removed the ids while I was thinking how to pass one to the edit link. The code before my changes didn't require these ids at all, they were ignored. Then there's also a client-side router for pages that contain a map. It is set up here: https://github.com/openstreetmap/openstreetmap-website/blob/f398c1e5eb35fa9e355544fb2860bc2ca9cfbe67/app/assets/javascripts/index.js#L360 It also passes the id to the note route handler - and it was also ignored. I decided to use it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3718#issuecomment-1261480992
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/3718/c1261480992 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220928/f6e462d4/attachment.htm>


More information about the rails-dev mailing list