Bulk actions for budgeting projects in admin panel#8986
Bulk actions for budgeting projects in admin panel#8986ahukkanen merged 25 commits intodecidim:developfrom
Conversation
andreslucena
left a comment
There was a problem hiding this comment.
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.
decidim-budgets/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb
Outdated
Show resolved
Hide resolved
…-actions.html.erb Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
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 |
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). |
|
Uops sorry, wrongly closed. |
…/decidim into feature/bulk_actions_for_projects
|
@andreslucena I did notice that there was code like this in projects.js selectedProjectsNotPublishedAnswerCount |
andreslucena
left a comment
There was a problem hiding this comment.
👍🏽 LGTM, thanks for the PR! I think it's really useful, specially for marking the projects as selected once the voting phase has finished.
ahukkanen
left a comment
There was a problem hiding this comment.
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.
decidim-budgets/app/views/decidim/budgets/admin/projects/update_category.js.erb
Show resolved
Hide resolved
decidim-budgets/app/packs/src/decidim/budgets/admin/projects.js
Outdated
Show resolved
Hide resolved
decidim-proposals/app/views/decidim/proposals/admin/proposals/update_category.js.erb
Show resolved
Hide resolved
* 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>
* 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>
* 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>
🎩 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:
📌 Related Issues
https://meta.decidim.org/processes/roadmap/f/122/proposals/16954
Testing
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots