[openstreetmap/openstreetmap-website] Create api map resource (PR #5545)

2025-01-23 Thread Anton Khorev via rails-dev
`map_path` -> `api_map_path` You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5545 -- Commit Summary -- * Create api map resource -- File Changes -- R app/controllers/api/maps_controller.rb (4) M app/control

[openstreetmap/openstreetmap-website] Simplify write_notes scope check in api notes controller (PR #5544)

2025-01-23 Thread Anton Khorev via rails-dev
`scope_enabled?` returns nil if there's no `doorkeeper_token`, then `author` stays undefined. The else branch removed in this PR would have done the same because there's no `current_user` in this case too. You can view, comment on, or merge this pull request online at: https://github.com/opens

[openstreetmap/openstreetmap-website] Move scope_enabled? to ApiController (PR #5543)

2025-01-23 Thread Anton Khorev via rails-dev
`scope_enabled?` is only called from api controllers/views and it references `doorkeeper_token` available only during api calls. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5543 -- Commit Summary -- * Move scope

[openstreetmap/openstreetmap-website] Remove doorkeeper_token branch from web deny_access (PR #5542)

2025-01-23 Thread Anton Khorev via rails-dev
`deny_access` was split into `web_deny_access` and `api_deny_access` in https://github.com/openstreetmap/openstreetmap-website/commit/8f70fb21146b1e8b90125e02d54e70bceea1d5fd. Later `api_deny_access` was moved to `ApiController` in https://github.com/openstreetmap/openstreetmap-website/commit/74

Re: [openstreetmap/openstreetmap-website] Message read_mark and mute resources (PR #5536)

2025-01-23 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > @@ -43,7 +43,7 @@ def initialize(user) can :update, DiaryEntry, :user => user can [:create], DiaryComment can [:show, :create, :destroy], Follow -can [:read, :create, :mark, :unmute, :destroy], Message +can

Re: [openstreetmap/openstreetmap-website] Message read_mark and mute resources (PR #5536)

2025-01-23 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 4 commits. cc3bccb9b3adc5f057d902a07282ed77e96ce5c2 Create message read_mark resource 3490eb580cf00e34de8e7abe112f9d5002e3a92f Remove unused css classes from inbox table fafed5f82159141b724dd517facb561d305bb9b1 Create message mute resource 9d3471204f231c6da22d4e401bbb5f85cb

Re: [openstreetmap/openstreetmap-website] Add linting for .js.erb files (Issue #5523)

2025-01-23 Thread Marwin Hochfelsner via rails-dev
Is this the shortest time the _awaiting upstream_ tag was necessary? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5523#issuecomment-2611228271 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Adds optional use of notes records (PR #5511)

2025-01-23 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def description -comments.first.body +if !author.nil? && author.status == "deleted" + RichText.new("text", I18n.t("notes.show.description_when_author_is_deleted")) +elsif user_ip.nil? && user_id.nil? + comments.first.body

Re: [openstreetmap/openstreetmap-website] Adds optional use of notes records (PR #5511)

2025-01-23 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 5 commits. 855ad4a0b09ebfb89f200dcc2064de71497460f7 Added helper routine note_description f4b173f4f15340e45bfbf787828d6df0415881a3 Replaced using description with note_description 9ed20bea95eb3f7969cfe4cad76510da4cbdc7f9 Removed unnecessary methods from Note 41e41fd9b2620

Re: [openstreetmap/openstreetmap-website] Adds optional use of notes records (PR #5511)

2025-01-23 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 6 commits. b3f9efc95650bec172400793bb94dcb31d77de69 Adds optional using of notes records fc83eec9d7b27de7be23784f475d6deda06a309c Added helper routine note_description 8e64da58a34cd78a2e214edbd5ca0a5da5434456 Replaced using description with note_description 8d6d58148981df

Re: [openstreetmap/openstreetmap-website] Initialize I18n and OSM as soon as application.js loads (PR #5538)

2025-01-23 Thread Holger Jeromin via rails-dev
> but I guess this OK as head must have loaded in order for the javascript to > load. Yes. FYI: `document.body` is not ready sync (if your `

Re: [openstreetmap/openstreetmap-website] Trace data resource (PR #5537)

2025-01-23 Thread Tom Hughes via rails-dev
Merged #5537 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5537#event-16048015190 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Add user transient attribute to oauth factories (PR #5541)

2025-01-23 Thread Tom Hughes via rails-dev
Merged #5541 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5541#event-16048015164 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Trace data resource (PR #5537)

2025-01-23 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5537#issuecomment-2610621188 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Message read_mark and mute resources (PR #5536)

2025-01-23 Thread Tom Hughes via rails-dev
@tomhughes requested changes on this pull request. > @@ -43,7 +43,7 @@ def initialize(user) can :update, DiaryEntry, :user => user can [:create], DiaryComment can [:show, :create, :destroy], Follow -can [:read, :create, :mark, :unmute, :destroy], Message +

Re: [openstreetmap/openstreetmap-website] Add user transient attribute to oauth factories (PR #5541)

2025-01-23 Thread Tom Hughes via rails-dev
I think I did it the way I did to make it consistent with the non-test code, where there is no user/resource_owner association on the access token model that doorkeeper provides, but this does make the tests a lot nicer. -- Reply to this email directly or view it on GitHub: https://github.com/o

Re: [openstreetmap/openstreetmap-website] Initialize I18n and OSM as soon as application.js loads (PR #5538)

2025-01-23 Thread Tom Hughes via rails-dev
I generally try to avoid doing anything before `ready` fires as it's hard to know what's safe but I guess this OK as `head` must have loaded in order for the javascript to load. I do wonder what #5402 is doing that it needs this before the page is ready though... -- Reply to this email directl

Re: [openstreetmap/openstreetmap-website] Adds optional use of notes records (PR #5511)

2025-01-23 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def description -comments.first.body +if !author.nil? && author.status == "deleted" + RichText.new("text", I18n.t("notes.show.description_when_author_is_deleted")) +elsif user_ip.nil? && user_id.nil? + comments.first.body

[openstreetmap/openstreetmap-website] Add user transient attribute to oauth factories (PR #5541)

2025-01-23 Thread Anton Khorev via rails-dev
It's annoying to type ``` create(:oauth_access_token, :resource_owner_id => user.id, ... ``` This PR shortens it to ``` create(:oauth_access_grant, :user => user, ... ``` Doorkeper classes don't have actual associations with our models and looks like this line in `oauth_access_grant` factory nev

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-01-23 Thread Emin Kocan via rails-dev
@kcne pushed 1 commit. 5f064f291a73032c11d413f39997ab4efd4d2515 Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5402/files/77cffabe7b7cf36a9a2ef85655c014dd00e28874..5f064f291a73032c11d413f39997ab4efd4d2515 You are

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-01-23 Thread Emin Kocan via rails-dev
@kcne pushed 1 commit. 77cffabe7b7cf36a9a2ef85655c014dd00e28874 Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5402/files/296f7c77a64cb18d513386654c43d57a8c9de18c..77cffabe7b7cf36a9a2ef85655c014dd00e28874 You are

[openstreetmap/openstreetmap-website] Create a ChangesetSubscription model (Issue #5540)

2025-01-23 Thread Andy Allan via rails-dev
We have various subscription models, such as NoteSubscription and DiaryEntrySubscription. We also have a table "changeset_subscribers" which does the same thing (pairs of user_id/object_id), but we don't have a corresponding model. Instead we declare it as a join association in Changesets, and u

Re: [openstreetmap/openstreetmap-website] Refactoring Controllers to use Resourceful Actions (Issue #5539)

2025-01-23 Thread Andy Allan via rails-dev
OK maybe Changesets#subscribe was a bad example, since the refactored controller can be named directly after the "changeset_subscription" model, without nesting! -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5539#issuecomment

[openstreetmap/openstreetmap-website] Refactoring Controllers to use Resourceful Actions (Issue #5539)

2025-01-23 Thread Andy Allan via rails-dev
For a few years we've been slowly refactoring our controllers to use "Resourceful Actions". I think it is worth having an issue here to explain the process, so that other people know what's going on, and how they can help. In Rails you can name your controller actions whatever you like. For exam

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-01-23 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. 71de44bc64893c53dd47448bb7dc01d23a0311bf Add heatmap javascript logic, styles and localization 296f7c77a64cb18d513386654c43d57a8c9de18c Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5402

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-01-23 Thread Emin Kocan via rails-dev
@kcne pushed 6 commits. 13a4257e7f5de1a3c2730ec054a70a45d1406385 Add cal-heatmap lib with plugins and dependencies to vendor/assets/javascripts 7b682c528118abdb46f86d6f372c39f612b6de84 Update manifest.js for asset linking 75b4c70b476b080ee5d4bfeb62db50be543c7e83 Add heatmap data caching and qu

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-01-23 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > +//= require d3 +//= require cal-heatmap +//= require calendar-label +//= require popper +//= require tooltip You were right, I was overriding changes in the later commit, instead of just updating this commit. It's fixed now. Thank you. -- Reply to thi

Re: [openstreetmap/openstreetmap-website] Show "reporting user" on "issues" screen (PR #4990)

2025-01-23 Thread David Tsiklauri via rails-dev
@nertc commented on this pull request. > @@ -44,6 +44,11 @@ def index end @issues, @newer_issues_id, @older_issues_id = get_page_items(@issues, :limit => @params[:limit]) + +@unique_reporters = @issues.each_with_object({}) do |issue, reporters| + reporters[issue.id] = issue