[openstreetmap/openstreetmap-website] Fix allow_thirdparty_images options (PR #5469)

2025-01-04 Thread Anton Khorev via rails-dev
When you write something like `allow_thirdparty_images :only => :index` you'd expect the CSP to be altered only on `index` action. But actually `:only => ...` was ignored and `allow_thirdparty_images` ran on all actions because `content_security_policy` didn't receive `options` correctly. Other

Re: [openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-04 Thread Anton Khorev via rails-dev
> and to prove their uselessness You can see that the `_osm_location` cookie is updated. If you remove some event listeners, the cookie won't be updated on these events. If you do `map.off("layeradd layerremove")` then after changing layers, going to some non-map-view page and going back to the

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-04 Thread Anton Khorev via rails-dev
I'd store the counter in a cookie, set an expiration date for that cookie to something like a week and replace the existing "You are not logged in" alert with this more motivating one with a note counter server-side. -- Reply to this email directly or view it on GitHub: https://github.com/opens

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-04 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > @@ -152,6 +152,16 @@ OSM.NewNote = function (map) { .on("input", updateControls) .focus(); +var anonymousNotesCount = Number(localStorage.getItem("anonymousNotesCount")); + +if (typeof OSM.user === "undefined" && anonymousNo

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-04 Thread Anton Khorev via rails-dev
When I run system tests, I replace ```ruby driven_by :selenium, :using => :headless_firefox do |options| options.add_preference("intl.accept_languages", "en") end ``` with ```ruby driven_by :selenium, :using => :firefox do |options| options.add_preference("intl.accept_languages",

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-04 Thread Anton Khorev via rails-dev
> a bug with `bundle exec erblint` Don't the docs tell you to run it as `bundle exec erblint .`? See `CONTRIBUTING.md`. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5467#issuecomment-2571505537 You are receiving this because

Re: [openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-04 Thread Tom Hughes via rails-dev
If they're valid notes I don't really see the problem? Are these genuine notes or is this some sort of spam attack? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5468#issuecomment-2571446909 You are receiving this because you ar

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-04 Thread Tom Hughes via rails-dev
Closed #5467 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5467#event-15816390123 You are receiving this because you are subscribed to this thread. Message ID: ___ rai

Re: [openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-04 Thread Tom Hughes via rails-dev
A snap based firefox is unlikely to work. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5467#issuecomment-2571446173 You are receiving this because you are subscribed to this thread. Message ID: __

[openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

2025-01-04 Thread etiennejourdier via rails-dev
### Motivation In the French community, we've had a problem for over a year with someone creating a huge number of anonymous notes, which hampers the processing of other relevant notes in the same area. See [this discussion](https://forum.openstreetmap.fr/t/notes-anonymes-a-gogo/18362) on the F

[openstreetmap/openstreetmap-website] bug with selenium while running the tests (Issue #5467)

2025-01-04 Thread etiennejourdier via rails-dev
### URL _No response_ ### How to reproduce the issue? Hi, I am preparing my very first PR, but I can't run the tests requested in [CONTRIBUTING.md](https://github.com/openstreetmap/openstreetmap-website/blob/master/CONTRIBUTING.md) `bundle exec teaspoon` gives me this error: ``` /home//.rbenv/

[openstreetmap/openstreetmap-website] "layeradd layerremove" event handlers dramatically slow down Map data layer rendering (Issue #5466)

2025-01-04 Thread Roman Deev via rails-dev
### URL _No response_ ### How to reproduce the issue? I was trying to figure out why the Map Data layer is slow when displaying a lot of elements. In Firefox Profiler, I saw that a lot of time was spent on handlers for adding new objects to the map. https://github.com/user-attachments/assets/

Re: [openstreetmap/openstreetmap-website] Show outbox after sending new message (PR #5465)

2025-01-04 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 1 commit. 335078997851d1adfcd96a0473a0a9c3aa611785 Show outbox after sending new message -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5465/files/5a9851c498cc745cf2cee705b27bd732adaeb6d6..335078997851d1adfcd96a0473a0a9c3aa611785 You are re

[openstreetmap/openstreetmap-website] Show outbox after sending new message (PR #5465)

2025-01-04 Thread Anton Khorev via rails-dev
Currently if you send a new message, you are redirected to your inbox. But you probably want to see the result of the message being sent, and that is in the outbox. Redirect to inbox existed long ago https://github.com/openstreetmap/openstreetmap-website/commit/e6af088dda8e85f53b11ffbaddb11edf0

[openstreetmap/openstreetmap-website] Add OldElementsController base class (PR #5464)

2025-01-04 Thread Anton Khorev via rails-dev
You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5464 -- Commit Summary -- * Add OldElementsController base class * Move element version actions template to old elements directory * Move browse history template t

[openstreetmap/openstreetmap-website] Remove old browse redirects (PR #5463)

2025-01-04 Thread Anton Khorev via rails-dev
Remove browse redirects introduced in https://github.com/openstreetmap/openstreetmap-website/commit/3cd5f45e08d977d04a778ab8802f71df85edc314. They are over 10 years old and probably not used by anyone. Depending on if they are actually not used according to the logs of course. You can view, comm

[openstreetmap/openstreetmap-website] Use resourceful routes for terms view/accept/decline (PR #5462)

2025-01-04 Thread Anton Khorev via rails-dev
- make user terms a nested resource inside the account resource - `GET /user/terms` changed to `GET /account/terms`. It's inconvenient to have it at `/user/terms` because that depends on the declaration order. If user resources are declared first, they capture `terms` as a username. I still add a