Skip to content

Fix: multiple items related to amendments step settings and wizard#5263

Merged
oriolgual merged 20 commits intodecidim:masterfrom
CodiTramuntana:fix/amendments_visibility_options_and_controller
Jul 26, 2019
Merged

Fix: multiple items related to amendments step settings and wizard#5263
oriolgual merged 20 commits intodecidim:masterfrom
CodiTramuntana:fix/amendments_visibility_options_and_controller

Conversation

@aitorlb
Copy link
Copy Markdown
Contributor

@aitorlb aitorlb commented Jul 10, 2019

🎩 What? Why?

Fixed Decidim::Admin::SettingsHelper::amendments_visibility_form_field(form, options)

Fixed Decidim::Admin::SettingsHelper::participatory_texts_extra_options

  • The :help_text explaining why the :participatory_texts_enabled was disabled was being added even if the setting wasn't being disabled.

Fixed Decidim::AmendmentsController#ensure_is_draft

  • This before filter did not checked that the current_user was the author of the amendment_draft

Fixed Decidim::Proposals::ProposalsController#show

  • The guard clause was not checking that the proposal, if it was an emendation, was visible to the user based on the component's amendments settings. Also, now allows complete access to super admins.

Fixed decidim-proposals/app/views/decidim/proposals/proposals/_filters.html.erb:15

  • Conditional statement to show the "Type" filter was including emendations "drafts".

Fixed Decidim::Proposals::ParticipatoryTextProposalCell

  • The "Amend" button and counter were not updated with the new amendments step settings. Now, the counter only reflects emendations that are visible to the user based on the :amendments_visibilty setting and the button may or may not be disabled based on the :amendment_creation_enabled setting.

Changed concern Decidim::Amendable

  • #visible_emendations_for(current_user) now filters out emendations "drafts".
  • #amendable_type has been dropped in favor of self.class (as discussed here); can be reverted if reviewers ask for it.

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • Add tests

📷 Screenshots (optional)

Amendments visibility options BEFORE

visibility_options_before

Amendments visibility options AFTER

visibility_options_after

Amend button disabled in Participatory Texts

amend_button_disabled

aitorlb added 6 commits July 10, 2019 20:26
Updated dummy resource to work with amendable
Refactored amendable to work with both authorable and coauthorable models
Updated forms with new amendable methods
end

# Handles the logic to assign an author to the resource, be it Coauthorable or Authorable.
def add_author(author, user_group = nil)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Proposals are Coauthorable, DummyResources are Authorable.

@aitorlb aitorlb marked this pull request as ready for review July 11, 2019 08:03
@aitorlb aitorlb requested a review from a team as a code owner July 11, 2019 08:03
@aitorlb aitorlb changed the title Fix: amendments visibility options and controller Fix: multiple items related to amendments step settings and wizard Jul 11, 2019
oriolgual
oriolgual previously approved these changes Jul 25, 2019
@oriolgual
Copy link
Copy Markdown
Contributor

@aitorlb could you please rebase to fix the conflicts?

@oriolgual oriolgual merged commit ec6b67d into decidim:master Jul 26, 2019
@tramuntanal tramuntanal deleted the fix/amendments_visibility_options_and_controller branch February 19, 2021 16:50
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