Skip to content

Implement ContentBlock for Process Groups (Admin UI)#6655

Merged
tramuntanal merged 9 commits intodevelopfrom
feature/process_groups_improvements-admin_groups_ui
Nov 24, 2020
Merged

Implement ContentBlock for Process Groups (Admin UI)#6655
tramuntanal merged 9 commits intodevelopfrom
feature/process_groups_improvements-admin_groups_ui

Conversation

@entantoencuanto
Copy link
Copy Markdown
Contributor

@entantoencuanto entantoencuanto commented Oct 9, 2020

🎩 What? Why?

The idea is to extend the content blocks feature used in organization homepage to participatory processes groups

The Decidim::ContentBlock model has an scoped_resource_id which can be used to define a collection of content blocks for each participatory process group

This PR:

  • Changes the ReorderContentBlock command to accept an optional scoped_resource_id argument
  • Defines the controller and views in participatory processes admin required to manage content blocks as in organization homepage
  • Adds a layout in participatory process group views including a secondary nav div with a link to info and homepage sections
  • Updates ReorderContentBlock command test and adds some system tests
  • Registers the hero content_block in the decidim/participatory_processes engine with its own scope :participatory_process_group (more content blocks will be added in the future)

📌 Related Issues

Link your PR to an issue

Testing

As admin edit a participatory process group

📋 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
Screen Shot 2020-10-07 at 10 52 29
Screen Shot 2020-10-07 at 11 37 41
Screen Shot 2020-10-07 at 11 37 56

♥️ Thank you!

@andreslucena andreslucena changed the title Feature/process groups improvements - Admin groups UI Implement ContentBlock for Process Groups (Admin UI) Oct 13, 2020
@entantoencuanto entantoencuanto force-pushed the feature/process_groups_improvements-admin_groups_ui branch from 017aef2 to 56b0726 Compare October 13, 2020 15:44
@entantoencuanto entantoencuanto force-pushed the feature/process_groups_improvements-admin_groups_ui branch from 8cebdff to b3f743d Compare October 21, 2020 11:54
@entantoencuanto entantoencuanto force-pushed the feature/process_groups_improvements-admin_groups_ui branch from b3f743d to 70e8e9e Compare November 4, 2020 12:19
@entantoencuanto entantoencuanto marked this pull request as ready for review November 6, 2020 18:57
This argument is optional and allows us to manage sets of content
blocks belonging to an instance of a model instead of only a global
set of content blocks as organization homepage blocks
The examples checks the behavior when scoped_resource_id argument is
provided
* Checks secondary nav elements
* Check management of participatory process group homepage content
  blocks
@entantoencuanto entantoencuanto force-pushed the feature/process_groups_improvements-admin_groups_ui branch from 70e8e9e to 8700667 Compare November 10, 2020 16:01
@tramuntanal
Copy link
Copy Markdown
Contributor

Hi @decidim/product @entantoencuanto is this PR accepted and ready for review?

@tramuntanal tramuntanal self-assigned this Nov 13, 2020
@carolromero
Copy link
Copy Markdown
Member

@tramuntanal yes, this ready to review, thanks

Copy link
Copy Markdown
Contributor

@tramuntanal tramuntanal left a comment

Choose a reason for hiding this comment

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

@entantoencuanto LGTM but please keep ca.yml and es.yml unchanged as they should be modified via Crowdin

Also, note that we need codecov/patch to be ok. Find here the parts of the code that need more coverage: https://codecov.io/gh/decidim/decidim/compare/080e4a55aaab4810d1d27e49a10cb61ec9984f42...87006677fb0e067f65b8a5f38dbee44a75530a9e/diff

Comment on lines +97 to +99
participatory_process_groups_submenu:
info: Informació
landing_page: Pàgina d'inici
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

other translations than :en should be done via Crowdin

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

Thanks! I'll make the required changes, removing es and ca unrequired translations in this PR and the others and fix the test coverage (at first the coverage reports made reference to files that did not seem to have to do with the PR, but current report makes much more sense)

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

The test coverage report has done weird things again 😅. I think I'm doing something wrong, is there any way to prevent it?

Screen Shot 2020-11-20 at 12 10 46

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

@tramuntanal I think that the coverage is ready. There is only a missing line when the Decidim::Admin::ReorderContentBlocks command returns invalid, but I'm not sure how to reach this line without a stub. This action is almost the same as used in homepage content blocks controller:

def update
enforce_permission_to :update, :organization, organization: current_organization
@form = form(ContentBlockForm).from_params(params)
UpdateContentBlock.call(@form, content_block, :homepage) do
on(:ok) do
redirect_to edit_organization_homepage_path
end
on(:invalid) do
edit # Sets the model to the view so that it can render the form
render :edit
end
end
end

Copy link
Copy Markdown
Contributor

@tramuntanal tramuntanal left a comment

Choose a reason for hiding this comment

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

Ok!

@tramuntanal tramuntanal merged commit 219c1e9 into develop Nov 24, 2020
@tramuntanal tramuntanal deleted the feature/process_groups_improvements-admin_groups_ui branch November 24, 2020 07:55
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.

5 participants