openpoke/decidim-module-reporting-proposals

Hide proposals without reporting

Closed this issue · 0 comments

Original requirement:

As a process-admin, I would like to be able to hide proposals directly via the backend without the need of first report the proposal via frontend.

Context

In Decidim a proposal needs to be reported before it can be hidden (see openpoke/decidim#22).

Allowing admins to hide content without reporting it first does not comply with the social contract, so this is going to be done in this module.

Tasks

  • Add a configuration option for this module Decidim::ReportingProposals.allow_admins_to_hide_proposals
  • If configuration active, override the view when managing a proposal in the admin, add a button saying "hide this proposal" (the flag in the mockup). Show the same modal window that appears in the frontend side when you press the "report" flag button.

Frontend current flag report button:
image

Mockup:
image

  • Add a controller in this module that handles the action of creating a report and hiding the content (use existing commands CreateReport and/or HideResource from decidim).
  • Add a entry to the spec/lib/overrides_spec.rb to keep track of the overriden view file.
  • Prevent to generate notifications/emails to other admins if hidden by the admin. Affected user should still receive their notification.
  • When hiding, use the same modal with the options on why are you hidding that (can be used as confirmation dialog)
  • Add behaviour specs for this

Dev notes: