[openstreetmap/openstreetmap-website] Add show_hidden parameter for note queries (PR #3934)
Anton Khorev
notifications at github.com
Thu Feb 16 00:33:36 UTC 2023
As a moderator you can hide a note. And you can unhide it of course. The problem is that you can only unhide the note if you know its id. If you've found the note with an api search call, you can't repeat the search to find the note again because hidden notes are skipped by api searches. What if you still want to find the note?
One possible solution is to make hidden notes accessible by search/bbox api calls if the user is logged in and is a moderator. But that might be unexpected by apps that are used to receive notes with either "open" or "closed" status. With this change, if they make a search with authorization headers, they may also get notes with "hidden" status. Not even openstreetmap-website note layer knows how to display such notes.
Another solution, which is implemented here, is to add a parameter, similar to the (undocumented) [`show_redactions`](https://github.com/openstreetmap/openstreetmap-website/blob/83f6f19bfbfaf421d8a678d0ac20a6ffe83cba6d/app/controllers/api/old_controller.rb#L76) parameter that lets moderators see redacted elements. I called the parameter `show_hidden` because in case of notes it has nothing to do with redactions.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/3934
-- Commit Summary --
* Add show_hidden parameter for note queries
-- File Changes --
M app/controllers/api/notes_controller.rb (8)
M test/controllers/api/notes_controller_test.rb (10)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/3934.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3934.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3934
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3934 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230215/f8f75000/attachment.htm>
More information about the rails-dev
mailing list