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

2025-01-30 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 6 commits. bc47525980dcbeb7604a76a141e9c59e65a67f8b Adds optional using of notes records 762a6dd2562cca5fc2e3f6ac81fb3db747c0fa30 Adds helper routine note_description bd1af6bfbd70026bae3e798da811eecc5b68258a Replaces using description with note_description 3a09e3eb07f1c23

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

2025-01-28 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. > @@ -7,6 +7,7 @@ end json.properties do json.id note.id + json.description note_description(note) Thanks, postponed to some future PR. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-we

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

2025-01-28 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. > - def test_description -comment = create(:note_comment) -assert_equal comment.body, comment.note.description - -user = create(:user) -comment = create(:note_comment, :author => user) -assert_equal comment.body, comment.note.de

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

2025-01-28 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. > - # Return the note's description, derived from the first comment - def description -comments.first.body - end Thanks, fixed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pu

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

2025-01-28 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def author -comments.first.author - end - - # Return the note's author ID, derived from the first comment - def author_id -comments.first.author_id - end - - # Return the note's author IP address, derived from the first comment -

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

2025-01-28 Thread Nenad Vujicic via rails-dev
> The commits here are doing things in a strange order. One way to untangle > them is to make another pull request that drops author_id/_ip without doing > other things. Added #5568 The problem with the current solution is JS is breaking (displaying only a subset of notes from bounding box) w

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

2025-01-28 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 5 commits. 9c250186827ebd03019136b7e03b89e02cfe291c Adds optional using of notes records b8be2499b03fcfbe488a6644a3bc6d2839984a4f Adds helper routine note_description af5ed1047a15d262cb06f96d9f813ee97b97000f Replaces using description with note_description b59e20494e557af

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

2025-01-28 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > @@ -7,6 +7,7 @@ end json.properties do json.id note.id + json.description note_description(note) Let's suppose you have a normal note. No deleted users touched it. From the API point of view its description is in the first comment. If you a

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

2025-01-28 Thread Anton Khorev via rails-dev
The commits here are doing things in a strange order. One way to untangle them is to make another pull request that drops author_id/_ip without doing other things. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511#issuecomment

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

2025-01-28 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > @@ -7,6 +7,7 @@ end json.properties do json.id note.id + json.description note_description(note) Why are we changing the API? Did anyone suggested changing the API? -- Reply to this email directly or view it on GitHub: https://github.com/o

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

2025-01-28 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > - def test_description -comment = create(:note_comment) -assert_equal comment.body, comment.note.description - -user = create(:user) -comment = create(:note_comment, :author => user) -assert_equal comment.body, comment.note.desc

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

2025-01-28 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > - # Return the note's description, derived from the first comment - def description -comments.first.body - end Don't you use this method in the helper before this commit and the helper assumes it returns the migrated description? -- Reply

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

2025-01-28 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def author -comments.first.author - end - - # Return the note's author ID, derived from the first comment - def author_id -comments.first.author_id - end - - # Return the note's author IP address, derived from the first comment - de

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

2025-01-27 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 9 commits. 26b3a557d0e1ebe4e58db6613a29e4607953eaad Adds optional using of notes records c0371ab00eba60ccac109a65145695cd259db1ca Added helper routine note_description a1747d6d306c8a28151c24654349b3140101232c Replaced using description with note_description 2e5288961234ce

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

2025-01-27 Thread Nenad Vujicic via rails-dev
@AntonKhorev @tomhughes do you have any further comment / request on this PR? Thanks! -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511#issuecomment-2616343008 You are receiving this because you are subscribed to this thread.

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

2025-01-24 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 9 commits. 354ff7345d672b582ad4ab4a500cb6c5ec99d9b3 Adds optional using of notes records 0fd95b34d2e62ce5cc5cef7c375408561a9138eb Added helper routine note_description 5989ea88418f6e087fcf3591e48470cca45a4295 Replaced using description with note_description 230998c0575174

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

2025-01-24 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-24 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 8 commits. dd7351f38fe3011592da001e5d21bce6f7f79ed9 Added helper routine note_description f654d29d8d73591cbd4255cd12145f0e9019a4d9 Replaced using description with note_description 5ccab1b63361a68025c953f9a3e2f3acff5477ea Removed unnecessary methods from Note 742597d3b9900

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] 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-22 Thread Anton Khorev via rails-dev
@AntonKhorev 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-22 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end Thanks! Started displaying "deleted" if note's author is deleted

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

2025-01-22 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def author_id -comments.first.author_id +if user_ip.nil? && user_id.nil? + comments.first.author_id +else + user_id +end end Thanks! Started using `all_comments` instead of `comments`. -- Reply to this email dire

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

2025-01-22 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >end - # Return the note's author IP address, derived from the first comment + # Return the note's author IP address, unless record is unavailable and + # it will be derived from the first comment def author_ip Thanks! Removed both `aut

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

2025-01-22 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 2 commits. 58971ce24ab40e29f82b38ed62ad0ce66fb42a53 Adds optional use of notes records aee9a1043232a30488e944e5647b70004329994b Updated Note model unit tests -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511/files/04bc2d4b540d6438d506a

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

2025-01-21 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >end - # Return the note's author IP address, derived from the first comment + # Return the note's author IP address, unless record is unavailable and + # it will be derived from the first comment def author_ip Do we need this method at a

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

2025-01-21 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def author_id -comments.first.author_id +if user_ip.nil? && user_id.nil? + comments.first.author_id +else + user_id +end end Now you are revealing the true author as soon as migration happens, but not before. -- R

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

2025-01-21 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end Copying is not the problem, the problem is you won't be able to th

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

2025-01-21 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end Have we reached a decision on this? We planned to copy the body

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

2025-01-20 Thread Nenad Vujicic via rails-dev
@nenad-vujicic commented on this pull request. >def author_id -comments.first.author_id +if user_ip.nil? && user_id.nil? + comments.first.author_id +else + user_id +end end The latest push should fix this. Thanks! -- Reply to this email directly or view it on

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

2025-01-20 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 1 commit. 04bc2d4b540d6438d506afd351a0fc3c1f063aa9 Adds optional use of notes records -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511/files/a6d27220424cb6293d4b572477c53ef7313cc3c1..04bc2d4b540d6438d506afd351a0fc3c1f063aa9 You are rec

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

2025-01-19 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end I don't think I've said that as such. What I have said is that we n

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

2025-01-19 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end Weren't you insisting on not showing the true description until LW

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

2025-01-19 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end We could make it consistent by using `all_comments` instead but that

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

2025-01-19 Thread Nenad Vujicic via rails-dev
> Why does this need to use `[:user_id]` etc rather than the more typical > `.user_id` form? I replaced using `[:user_id]` with `user_id` (same with user_ip), but had to leave self[:description] because of possible recursion. I couldn't use self.{user_id, user_ip, description} because of Ruboco

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

2025-01-19 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def author_id -comments.first.author_id +if user_ip.nil? && user_id.nil? + comments.first.author_id +else + user_id +end end If user_id is a true id of the user who created the note, it won't necessarily match `auth

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

2025-01-19 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. >def description -comments.first.body +if user_ip.nil? && user_id.nil? + comments.first.body +else + RichText.new("text", self[:description]) +end end I assume that `self[:description]` is going to be the true note de

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

2025-01-19 Thread Nenad Vujicic via rails-dev
@nenad-vujicic pushed 2 commits. bb9d30fef5a295b42bffaf0cfe49329e9fb9989b Adds optional use of notes records 57b066df587a29ffe6f79db8da9061be839dc7f6 small fix -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511/files/31dbd76c9cf4ec2e7d11673f0a272bab8d615807.

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

2025-01-18 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. Why does this need to use `[:user_id]` etc rather than the more typical `.user_id` form? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5511#pullrequestreview-2560409294 You are recei

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

2025-01-17 Thread Nenad Vujicic via rails-dev
### Description PR adds use of `description`, `user_id`, `user_ip` from `notes` table if data-migration is done, otherwise use `body`, `author_id`, `author_ip` from note's first comment. Decision procedure "data-migration is done" is defined with "is user_ip or user_id not nil?". This PR is 4t