Skip to content

Fix report moderation for all the spaces#8813

Merged
andreslucena merged 6 commits intodecidim:developfrom
i-need-another-coffee:fix/8789
Feb 17, 2022
Merged

Fix report moderation for all the spaces#8813
andreslucena merged 6 commits intodecidim:developfrom
i-need-another-coffee:fix/8789

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

🎩 What? Why?

The permissions required to report content was defined at a participatory space level ( only available for Assemblies, Conferences, Initiatives and Participatory Processes), leaving out (Elections, Votings, Consultations).
Considering the above no comment could be reported in the "ignored" modules.

This PR fixes the issue by moving the Permission to the Default scope.

📌 Related Issues

Link your PR to an issue

Testing

Login and try to report comments or other content on all the modules i have mentioned in the Ignored section.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

roxanaopr
roxanaopr previously approved these changes Feb 15, 2022
@andreslucena andreslucena changed the title Fixing Moderation permissions Fix report moderation for all the spaces Feb 15, 2022
@andreslucena
Copy link
Copy Markdown
Member

I've tried this locally, and I can confirm that this partially fixes some cases:

  • In Elections/Votings: Before we had the "You are not authorized to perform this action" callout, now it works well, just as expected.
  • In Consultations: Before we had the "You are not authorized to perform this action" callout, now it gives an exception:
NameError (uninitialized constant Decidim::Questions) 

activesupport (6.0.4.1) lib/active_support/inflector/methods.rb:284:in `const_get'
activesupport (6.0.4.1) lib/active_support/inflector/methods.rb:284:in `block in constantize'
activesupport (6.0.4.1) lib/active_support/inflector/methods.rb:280:in `each'
activesupport (6.0.4.1) lib/active_support/inflector/methods.rb:280:in `inject'
activesupport (6.0.4.1) lib/active_support/inflector/methods.rb:280:in `constantize'
activesupport (6.0.4.1) lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
/home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/participable.rb:98:in `admins_query'
/home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/participable.rb:11:in `admins_query'
/home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/participable.rb:23:in `admins'
/home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/participable.rb:30:in `moderators'
/home/apereira/Work/decidim/decidim/decidim-core/app/commands/decidim/create_report.rb:70:in `participatory_space_moderators'
/home/apereira/Work/decidim/decidim/decidim-core/app/commands/decidim/create_report.rb:74:in `send_report_notification_to_moderators'
/home/apereira/Work/decidim/decidim/decidim-core/app/commands/decidim/create_report.rb:33:in `call'
rectify (0.13.0) lib/rectify/command.rb:30:in `call'
/home/apereira/Work/decidim/decidim/decidim-core/app/controllers/decidim/reports_controller.rb:16:in `create'

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it isn't working for consultations (see my comment). Can you check it 🙏🏽?

@alecslupu
Copy link
Copy Markdown
Contributor Author

@andreslucena I have found the issue with the Questions, and required that a method "admin_query" needed to be added to fix the issue. After fixing this, i have noticed that the comments from the questions are not being displayed in the Global Moderation panel. I had the patch the Global moderation context to fix the issue.
please see 5707405 for details

@alecslupu alecslupu force-pushed the fix/8789 branch 2 times, most recently from a4ffbf1 to f711f2c Compare February 16, 2022 05:36
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I retried the consultations' question's comment moderation thing and it works well... This is ready to be merged for me, how do you see it @alecslupu? Is this ready? Thanks for taking care of this one too!

@alecslupu
Copy link
Copy Markdown
Contributor Author

This can be merged from my point of view.

@andreslucena andreslucena merged commit 897b796 into decidim:develop Feb 17, 2022
@andreslucena
Copy link
Copy Markdown
Member

Can you please backport to v0.26-stable 🙏🏽? Thanks

@alecslupu alecslupu deleted the fix/8789 branch February 17, 2022 11:45
alecslupu added a commit to i-need-another-coffee/decidim that referenced this pull request Feb 17, 2022
entantoencuanto added a commit that referenced this pull request Feb 18, 2022
* develop: (134 commits)
  Remove Rectify::Presenter references (#8758)
  Clarify the locales on the list of admins (#8838)
  Fix activity cell disappearing author images (#8826)
  Fix notifications when there is a note proposal in other spaces than processes (#8822)
  Fix accountability text search (#8831)
  Fix displaying hidden meetings in show process page (#8823)
  Fix docs for install-decidim.sh permissions (#8839)
  Fix report moderation for all the spaces (#8813)
  Clarify the comment at the resource search class (#8829)
  Fix displaying hidden related resources (#8812)
  Replace Decidim mentions in UI with 'the platform' (#8827)
  Add natively a .keep file to empty directory to include on git committing (#8830)
  Fix scope validation on initiative's creation (#8755)
  Replace `searchlight` with `ransack` which is already a core dependency (#8748)
  Fix characters not encoded in highlighted participatory process group title (#8820)
  Test ensuring the moderated comments are not computed in stats (#8816)
  Update rails to 6.0.4.6 and puma to 5.6.2 (#8817)
  Fix displaying hidden meetings in processes group's "upcoming meetings" content block (#8818)
  Fix displaying hidden meetings in homepage's "upcoming meetings" content block (#8809)
  Improve "Release Candidates" release docs (#8804)
  ...
microstudi added a commit to Platoniq/decidim that referenced this pull request Feb 21, 2022
# Conflicts:
#	decidim-comments/app/models/decidim/comments/comment.rb
@microstudi microstudi mentioned this pull request Feb 21, 2022
6 tasks
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments in Consultations can't be moderated

3 participants