Skip to content

Bulk actions for budgeting projects in admin panel#8986

Merged
ahukkanen merged 25 commits intodecidim:developfrom
mainio:feature/bulk_actions_for_projects
May 13, 2022
Merged

Bulk actions for budgeting projects in admin panel#8986
ahukkanen merged 25 commits intodecidim:developfrom
mainio:feature/bulk_actions_for_projects

Conversation

@lahdeero
Copy link
Copy Markdown
Contributor

@lahdeero lahdeero commented Mar 8, 2022

🎩 What? Why?

Add admin group actions to budget projects. This is similar functionality to what we have with proposals.

There is also small changes to proposal bulk actions:

  • Fix callout notification translations
  • Use shared callout notification
  • Minor refactoring

📌 Related Issues

https://meta.decidim.org/processes/roadmap/f/122/proposals/16954

Testing

  1. Sign in as admin
  2. Go to Processes -> choose a process -> Components -> Budgets -> Manage projects
  3. Select projects
  4. Change category / scope / selected for implementation in actions dropdown.

📋 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

projects_group_actions

♥️ Thank you!

@andreslucena andreslucena changed the title Group actions for budgeting projects admin Bulk actions for budgeting projects in admin panel Apr 4, 2022
andreslucena
andreslucena previously approved these changes Apr 4, 2022
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.

LGTM. I tried it in the staging server and could do all the different actions. Couldn't find any bug.

Regarding the code, I see that it was copied from the current implementation for proposals (i.e. https://github.com/decidim/decidim/blob/develop/decidim-proposals/app/packs/src/decidim/proposals/admin/proposals.js is mostly the same as decidim-budgets/app/packs/src/decidim/budgets/admin/projects.js - even with a typo in a comment 😄 (// Expose functions to make them **avaialble** in .js.erb templates). I think its the way to go as it'll enable us to refactor it and remove duplication when the time arrives.

The other changes are great: moving a proposal helper method from decidim-admin to decidim-proposals, cleaning up the projects table, moving the js_callout partial to a shared directory, etc.

…-actions.html.erb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@lahdeero
Copy link
Copy Markdown
Contributor Author

lahdeero commented Apr 4, 2022

Regarding the code, I see that it was copied from the current implementation for proposals

Yeah 😁. Now that I looked it again it may need some cleaning because I'm not sure if projects have answers... I can take closer look tomorrow

@andreslucena
Copy link
Copy Markdown
Member

andreslucena commented Apr 5, 2022

I'm not sure if projects have answers

I haven't catch that, but no, projects don't have answers (at least for now, maybe it could make sense in the future, but as far as I know it isn't planned).

@andreslucena
Copy link
Copy Markdown
Member

Uops sorry, wrongly closed.

@andreslucena andreslucena reopened this Apr 5, 2022
@lahdeero
Copy link
Copy Markdown
Contributor Author

lahdeero commented Apr 5, 2022

@andreslucena I did notice that there was code like this in projects.js

selectedProjectsNotPublishedAnswerCount 

Did some cleaning in ec84d29 and updated QA

andreslucena
andreslucena previously approved these changes Apr 22, 2022
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.

👍🏽 LGTM, thanks for the PR! I think it's really useful, specially for marking the projects as selected once the voting phase has finished.

Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen left a comment

Choose a reason for hiding this comment

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

I found few places that could use some refactoring.

I would aim not to duplicate code and instead find ways to create APIs which allow us to use the same code in multiple places.

Even after these changes I'm not expecting it to be a perfect "bulk actions API" but just to aim to reduce the amount of duplicate code.

@ahukkanen ahukkanen merged commit 7c023cd into decidim:develop May 13, 2022
@ahukkanen ahukkanen deleted the feature/bulk_actions_for_projects branch May 13, 2022 15:37
andreslucena added a commit that referenced this pull request May 19, 2022
* Initial

* Can change projects scope

* Can select and unselect projects

* Move js-callout partial to admin shared

* Some refactoring and add tests

* Fix i18n path and js linter errors

* Dont hide import proposals to projects button

* Dont change closing character

* Enable permissions

* Fix proposal callout translations

* Allow boolean args and add comments

* Update decidim-budgets/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Show selected count and clean copy paste code

* Fix typo

* Combine js.erb views

* Refactor projects to use bulk actions api

* Proposals admin uses bulk actions api

* Update bulk actions for proposals

* Fix tests

* Combine proposal update category and update scope

* Fix tests again

* Update merge proposal selectors and tests

* Give up with bulk actions api

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
andreslucena added a commit that referenced this pull request May 19, 2022
* Initial

* Can change projects scope

* Can select and unselect projects

* Move js-callout partial to admin shared

* Some refactoring and add tests

* Fix i18n path and js linter errors

* Dont hide import proposals to projects button

* Dont change closing character

* Enable permissions

* Fix proposal callout translations

* Allow boolean args and add comments

* Update decidim-budgets/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Show selected count and clean copy paste code

* Fix typo

* Combine js.erb views

* Refactor projects to use bulk actions api

* Proposals admin uses bulk actions api

* Update bulk actions for proposals

* Fix tests

* Combine proposal update category and update scope

* Fix tests again

* Update merge proposal selectors and tests

* Give up with bulk actions api

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
* Initial

* Can change projects scope

* Can select and unselect projects

* Move js-callout partial to admin shared

* Some refactoring and add tests

* Fix i18n path and js linter errors

* Dont hide import proposals to projects button

* Dont change closing character

* Enable permissions

* Fix proposal callout translations

* Allow boolean args and add comments

* Update decidim-budgets/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Show selected count and clean copy paste code

* Fix typo

* Combine js.erb views

* Refactor projects to use bulk actions api

* Proposals admin uses bulk actions api

* Update bulk actions for proposals

* Fix tests

* Combine proposal update category and update scope

* Fix tests again

* Update merge proposal selectors and tests

* Give up with bulk actions api

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@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.

4 participants