Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show hidden comments to moderators if requested #4251

Merged

Conversation

AntonKhorev
Copy link
Collaborator

Continuation of #4245.

With comment ids shown it's possible to hide specific comments. But the unhiding also requires comment ids. They are not known because the comments are hidden from the api calls.

Here a parameter is added to show hidden comments. It makes hidden comments visible to users who can unhide comments. The request looks like this:

/api/0.6/changeset/<id>?include_discussion=true&show_hidden_comments=true

I chose to add a parameter instead of showing the comments to anyone with permissions in case there are too many hidden comments. Maybe later some kind of limit will be added, making changeset with discussion requests to look like search requests. In this case show_hidden_comments would act similar to filters like closed for changesets/notes.

The visible attribute is added to each comment to indicate if it's hidden. See also zerebubuth/openstreetmap-cgimap#289 (comment).

See #3934 for why the parameter is named show_hidden_... I added _comments at the end in case there's something else to be hidden in changeset metadata. This allows for tags or bbox hiding to be added later if necessary.

@AntonKhorev
Copy link
Collaborator Author

can't write this because Rubocop

assert_equal true, js["changeset"]["open"]

can't write this because updated Rubocop

assert js["changeset"]["open"]

e8af4b8 no, thanks

assert_operator js["changeset"], :[], "open"

have to write this instead

assert_operator true, :==, js["changeset"]["open"]

@tomhughes tomhughes merged commit 53817fa into openstreetmap:master Feb 25, 2024
10 checks passed
@tomhughes
Copy link
Member

The rubocop thing was a temporary aberration that I think we've discussed elsewhere, and it's not actually insisting on going back to something sensible.

Other than that it looks good so I've applied the rubocop fixups and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants